scaled list
a horizontal list view with lots of modification including a scaled current item.
- provided with curved custom painting and dots indictor below it.
- it makes the widget of item builder responsive to the device screen’s width and height.
- you can also set the relative width, margin width, height of selected and unselected card to the entire screen
usage
@override
widget build(buildcontext context) {
return scaffold(
body: scaledlist(
itemcount: data.categories.length,
itemcolor: (index) {
return kmixedcolors[index % kmixedcolors.length];
},
itembuilder: (index, selectedindex) {
final category = data.categories[index];
return column(
mainaxisalignment: mainaxisalignment.center,
children: [
container(
height: selectedindex == index
? 100
: 80,
child: image.asset(category.image),
),
sizedbox(height: 15),
text(
category.name,
style: textstyle(
color: colors.white,
fontsize: selectedindex == index
? 25
: 20),
)
],
);
},
),
);
}
usage scenarios
- when you like to add items in scaled manner and add custom curved painting over each item.
Comments are closed.