【发布时间】:2021-02-14 05:38:41
【问题描述】:
我有这个json 结构
"abc":{
current_checklist:[
{
....
},
{
"sections":[
...
]
},
{
...
}
]
}
我想使用ListView,其中itemCount 是基于部分的。应该怎么写?
Widget _displayCheckList(ABCData abcData) {
return ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount:
abcData.abc.currentChecklist.???,length, // how to get the "sections" length?
itemBuilder: (context, index) {
return Text("Hello");
},
);
}
}
【问题讨论】:
-
sections是仅在current_checklist的一个对象中可用还是在所有对象中都可用? -
@RaviSinghLodhi 所有人
标签: list flutter listview dart