直接放上github地址:
https://github.com/peng8350/flutter_pulltorefresh/blob/master/README_CN.md
只能说超级好用,可定制性高,里面存在的bug少,用这个感觉都可以不用SingleChildScrollView这个控件了。
用法:
dependencies:
pull_to_refresh: ^1.5.0
导入包:
import 'package:pull_to_refresh/pull_to_refresh.dart';
在某个Widget中进行使用
List<String> items = ["1", "2", "3", "4", "5", "6", "7", "8"];
RefreshController _refreshController =
RefreshController(initialRefresh: true);
void _onRefresh() async{
// monitor network fetch
await Future.delayed(Duration(milliseconds: 1000));
// if failed,use refreshFailed()
_refreshController