xuelongqy / flutter_easy_refresh

A flutter widget that provides pull-down refresh and pull-up load.
https://xuelongqy.github.io/flutter_easy_refresh/
MIT License
3.88k stars 633 forks source link

手动调用callLoad加载无效 #683

Open jiang1654 opened 1 year ago

jiang1654 commented 1 year ago

平台:MacOs、Windows 版本:easy_refresh: ^3.3.1 问题描述: 桌面端滚轮上拉自动刷新无效,因此使用ScrollController监听滑动到最底部再去手动加载,但是调用callLoad()方法没有作用,加了延迟footer才收到了回调,但是底部不显示footer,没有任何报错信息。

_scrollController.addListener(() { debugPrint( '当前高度:${_scrollController.position.pixels} 最大高度${_scrollController.position.maxScrollExtent}'); if (_scrollController.position.pixels == (_scrollController.position.maxScrollExtent)) { Future.delayed(const Duration(microseconds: 300), () async { if (isLoading) { return; } isLoading = true; debugPrint('正在加载更多...'); await _refreshController.callLoad(); }); } });

EasyRefresh( controller: controller.refreshController, onRefresh: () async { controller.onRefresh(); }, onLoad: () async { controller.onLoadMore(); }, child: ListView.builder( padding: EdgeInsets.only(bottom: 40), itemCount: controller.list.length, controller: controller.scrollController, itemBuilder: (context, index) { LibraryModel listItem = controller.list[index]; return RecordListItemView( index, listItem, onDeleteTap: () { controller.deleteItem(listItem); }, onTap: () async { controller.onRefresh(); }, ); }));

xuelongqy commented 1 year ago

桌面端滚轮目前无法越界