Reputation: 2405
I am trying to loop my data using for
and ListView.builder
, here is part of my code
Widget listData(Data myList) {
List<Check> tab = myList.data.listItem;
List<Widget> list = new List<Widget>();
for (var i = 0; i < tab.length; i++) {
List<User> user= myList.data.listItem[i].detail;
list.add(Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: user.length,
itemBuilder: (context, index) {
return Text("check= $i");
}),
));
}
return Center(child: new Column(children: list));
}
I have 6 data..but using that code I always get the first data only... the other data doesn't show up in my screen... is there something that I should do to show my all data using ListView.builder and for
looping
Upvotes: 1
Views: 5152
Reputation: 1522
Consider giving some height to the Container
say some 50 or 100..that will solve your issue..
Upvotes: 2