flutter_placeholder_textlines
a simple plugin to generate placeholder lines that emulates text in a ui, useful for displaying placeholder content while loading or empty items.
example of usage
widget _buildcustomcolorsizeplaceholder() {
return container(
width: 200,
child: placeholderlines(
count: 4,
align: textalign.center,
lineheight: 8,
color: colors.blueaccent,
),
);
}
widget _buildsimpletextplaceholder(textalign align) {
return container(
width: 300,
child: placeholderlines(
count: 3,
align: align,
),
);
}
widget _buildsubtitle(string title) {
return container(
padding: edgeinsets.only(
top: 24,
bottom: 16,
),
child: text(
title,
style: textstyle(fontsize: 20),
),
);
}
_buildanimated() {
return container(
width: 300,
child: placeholderlines(
count: 3,
animate: true,
color: colors.purple,
),
);
}
_buildcardexample() {
return material(
borderradius: borderradius.circular(10),
elevation: 9,
child: container(
padding: edgeinsets.symmetric(vertical: 16, horizontal: 20),
width: 300,
child: row(
children: <widget>[
container(
margin: edgeinsets.only(right: 16),
width: 70,
height: 70,
decoration: boxdecoration(color: colors.grey.withopacity(.6), ),
child: center(child: icon(icons.photo_size_select_actual, color: colors.white, size: 38,),),
),
expanded(
child: placeholderlines(
count: 3,
),
),
],
),
),
);
}
also please see example at: https://github.com/victorevox/flutter_placeholder_textlines/tree/master/example
screenshots
Comments are closed.