Flutter 颤振中如何从listview获取数据
我创建了一个列表,用动态数据填充它。 现在我需要listview中存在的所有数据。Flutter 颤振中如何从listview获取数据,flutter,Flutter,我创建了一个列表,用动态数据填充它。 现在我需要listview中存在的所有数据。 我该怎么做呢?也许与大家分享一下您的代码说明会更好 Scaffold( appBar: AppBar( title: Text(title), ), // if the dynamic data is a future data declare a bool and set to true when data recived //bool list = tru
我该怎么做呢?也许与大家分享一下您的代码说明会更好
Scaffold(
appBar: AppBar(
title: Text(title),
),
// if the dynamic data is a future data declare a bool and set to true when data recived
//bool list = true; and setstate at the change of data
body: list!=true?Container(child:Center(child:CircularProgressIndicator())): ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return ListTile(
title: Text('${items[index]}'),
);
},
),
),
);