我在扑扑中更新鲜& 我正在尝试在列表视图中显示1到100之间的数字,但不知道要设置什么?
答案 0 :(得分:2)
尝试一下
new ListView.builder
(
itemCount: 100,
itemBuilder: (BuildContext ctxt, int Index) {
return new Text(Index.toString());
}
)
有关更多详细信息,请参见以下链接:https://medium.com/@DakshHub/flutter-displaying-dynamic-contents-using-listview-builder-f2cedb1a19fb
答案 1 :(得分:0)
var list=100;
--------------
body: new ListView(
children: new List.generate(list, (int index){
return new ListTile(title: new Text("List Number - $index"),
);
})
),