[Flutter] 下拉刷新
作者:互联网
官方自带的下拉刷新组件
定义刷新方法
//下拉刷新数据
Future<Null> _handleRefresh() async {
await Future.delayed(Duration(seconds: 2));
setState(() {
//此处获取数据
_getData()
});
}
RefreshIndicator刷新组件包裹
RefreshIndicator(
onRefresh: _handleRefresh,
child:ListView.builder(
...
)
)
标签:RefreshIndicator,获取数据,handleRefresh,Future,刷新,组件,Flutter 来源: https://www.cnblogs.com/TobuTobu/p/15967024.html