Open jiangyubao opened 2 years ago
View this: flutter_pulltorefresh Pull Request #636
tldr;
ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(
dragDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.trackpad,
PointerDeviceKind.stylus,
},
),
child: SmartRefresher(
enablePullDown: true,
header: WaterDropHeader(),
enablePullUp: true,
footer: CustomFooter(
builder: (BuildContext context, LoadStatus mode) {
Widget body;
if (mode == LoadStatus.idle) {
body = Text("pull up load");
} else if (mode == LoadStatus.loading) {
body = CupertinoActivityIndicator();
} else if (mode == LoadStatus.failed) {
body = Text("Load Failed! Click retry!");
} else if (mode == LoadStatus.canLoading) {
body = Text("release to load more");
} else {
body = Text("No more Data");
}
return Container(
height: 55.0,
child: Center(child: body),
);
},
),
controller: _refreshController,
onRefresh: _onRefresh, // Check example above for this method
onLoading: _onLoading, // Check example above for this method
child: Offstage(), // Replace with your own widget
),
);
flutter版本:2.10
编译指令:
cd flutter_pulltorefresh/example flutter create . flutter build web --pwa-strategy none --release --no-source-maps --no-pub --web-renderer html
复现方法: