I love to talk on trending ⚡ technology ⚡, stay hungry stay foolish. Connect with me here
You are my visitor, Thank You!🎉🎉
A flutter widget that provides pull-down refresh and pull-up load.
Home Page: https://xuelongqy.github.io/flutter_easy_refresh/
License: MIT License
已定义的各种样式,如ClassicsHeader和ClassicsFooter,并不能自定义动画延时,但其父类是有finishDelay在控制的,若要修改该属性,只能复制源码重新实现一个子类。
建议在子类的构造函数中增加finishDelay参数,并传递给父类。
在夜神模拟器5.1上面运行demo, BasicPage只有第一次能下拉刷新, 真机上没有此现象.
以为代码有误, 鼓捣了半天, 发现了这个问题, 给后面的同志提个醒儿
现在的RefreshHeader只有一个refrresh finished, 无法展示刷功或者刷新失败
库很好用...已经集成啦 ....希望我们上线前能用上新版本0-0期待大佬
autoLoad设置为true也没有自动加载,还是需要手动上拉才会加载
我加上了behavior属性,他在iOS端看起来有点奇怪,不知道您发觉没有,他会突然跳一下.这种情况下发生在了下拉和上拉后,界面开始减速时,当界面滑动速度很慢,而又刚好到达顶端时,刷新动画,会突然加速,然后返回。如果快速上下拉动的话,动画效果看不出来。我认为是您在做动画时,控制动画时间的原因,动画时间过短造成的。我会尝试修改源码,也希望您能给个反馈
https://github.com/xuelongqy/flutter_easyrefresh/blob/03ce507092b3ee1236b8c6ce8832b5beeb008de8/lib/src/refresher.dart#L1201
https://github.com/xuelongqy/flutter_easyrefresh/blob/03ce507092b3ee1236b8c6ce8832b5beeb008de8/lib/src/refresher.dart#L1202
https://github.com/xuelongqy/flutter_easyrefresh/blob/03ce507092b3ee1236b8c6ce8832b5beeb008de8/lib/src/refresher.dart#L1203
这个地方如果外层传入了 scrollController,就变成null了,外层 scrollController无法监听到滚动事件。
Hello,
Thank you I really like this package. I tried adding TabBar to your Sliver example https://github.com/xuelongqy/flutter_easyrefresh/blob/master/example/lib/page/sliver_page.dart
but when its collapse TabBar also collapsing how can i use this package with SliverAppBar and TabBar both for this i need to use NestedScrollView but i dont know if this package works well with it ?
When using a BottomAppBar the Footer is behind the BottomAppBar on loading new data
复现步骤:
1.第一次上拉进行加载更多
2.加载完成后再上拉,上拉的手势无效,就是整个列表不会随手势的上拉而上拉加载更多,不知道是不是手势冲突被拦截了
iOS平台,默认情况下点击状态栏可以滚动到最顶部吗?是不是需要单独处理
我现在的做法是设置color:Theme.of(context).primaryColor,可以将颜色的默认值也设定为主题色吗?
If you set onRefresh to null, but refreshHeader not null (in my case onRefresh is null in some condition), you got those exceptions :
type 'Container' is not a subtype of type 'RefreshHeader' in type cast
#0 EasyRefreshState.build (package:flutter_easyrefresh/src/refresher.dart:1099:56)
#1 StatefulElement.build (package:flutter/src/widgets/framework.dart:3809:27)
type 'Container' is not a subtype of type 'RefreshHeader' in type cast
#0 EasyRefreshState.build (package:flutter_easyrefresh/src/refresher.dart:1148:29)
#1 StatefulElement.build (package:flutter/src/widgets/framework.dart:3809:27)
I manually edit the source code in line 1099 to:
widget.refreshHeader == null || !widget.refreshHeader.isFloat
? header
: new Container(),
and line 1148 to:
child: widget.refreshHeader != null &&
widget.refreshHeader.isFloat
? header
: new Container(),
to get around this issue.
加载更多后,当没有更多数据时屏蔽加载更多的回调,然后发现下拉刷新使用不了,下拉没反应
代码如下
EasyRefresh(
key: _easyRefreshKey,
autoLoad: true,
behavior: ScrollOverBehavior(),
onRefresh: () {
return bloc.refreshStudyList(widget.type);
},
loadMore: snap.data.hasMore? () {
return bloc.loadMore(widget.type);
}:null,
refreshHeader: MyHeader(
key: _easyRefreshHeaderKey,
color: AppColor.primaryColor,
),
refreshFooter: snap.data.hasMore?
MyFooter(
key: _easyRefreshFooterKey,
)
: null,
child: ListView.builder(
itemBuilder: (context, index) {
// if(!snap.data.hasMore){
// if(snap.data.totalCount -1 == index){
// return NoMoreWidget;
// }
// }
return StudyItem(study: snap.data.list[index],);
},
itemCount: snap.data.totalCount,
),
)
很好的控件,源码也很整洁。不过遇到一个问题是,目前的加载更多的动画有点慢,而且加载完成还会显示加载的更新时间,是否可以增加动画的设置?
自定义refreshFooter后加载更多会滚动到listview的顶部,当我把自定义refreshFooter去除后,又能正常工作
loadMore: () async {
print("loadMore $this");
setState(() {
for (var i = 0; i < 10; i++) {
strGrid.addAll(addStrGrid);
}
});
},
我将延时去掉,
列表有大量数据的时候,快速滑动,来回切换tab,偶尔会出现界面不响应的问题。
复现较为困难,偶尔会出现,一旦出现就不停打印出错信息,手指在屏幕上滑动会导致报错信息打印。
怀疑和flutter/flutter#14452 这个问题有关。
打印日志如下:
flutter: loadMore _NestedScrollViewPageState#384a5(ticker inactive)
flutter: loadMore _NestedScrollViewPageState#384a5(ticker inactive)
flutter: ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
flutter: The following assertion was thrown while handling a gesture:
flutter: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 490 pos 12: '_hold == null':
flutter: is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 ScrollableState._handleDragStart
flutter: #3 DragGestureRecognizer.acceptGesture.
flutter: #4 GestureRecognizer.invokeCallback
flutter: #5 DragGestureRecognizer.acceptGesture
flutter: #6 GestureArenaManager._resolveInFavorOf
flutter: #7 GestureArenaManager._resolve
flutter: #8 GestureArenaEntry.resolve
flutter: #9 OneSequenceGestureRecognizer.resolve
flutter: #10 DragGestureRecognizer.handleEvent
flutter: #11 PointerRouter._dispatch
flutter: #12 PointerRouter.route
flutter: #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent
flutter: #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent
flutter: #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent
flutter: #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue
flutter: #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket
flutter: #21 _invoke1 (dart:ui/hooks.dart:230:10)
flutter: #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:151:5)
flutter: (elided 5 frames from class _AssertionError and package dart:async)
flutter:
flutter: Handler: onStart
flutter: Recognizer:
flutter: VerticalDragGestureRecognizer#e09ac(start behavior: start)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: loadMore _NestedScrollViewPageState#384a5(ticker inactive)
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 478 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 487 pos 12: '_drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 495 pos 12: '_hold == null || _drag == null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 501 pos 12: '_hold == null || _drag == null': is not true.
有修改header和footer高度和里面文本字体大小的方法吗
我想在结束时动态在head中显示本次更新了多少条数据,怎么设置或者设置更新了多少条数据呢
我的是flutter1.0版本, 夜神模拟器. 跑作者的example也一样...
错误日志如下
E/flutter (28676): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (28676): NoSuchMethodError: The method '>' was called on null.
E/flutter (28676): Receiver: null
E/flutter (28676): Tried calling: >(null)
E/flutter (28676): #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
E/flutter (28676): #1 EasyRefreshState._checkStateAndCallback (package:flutter_easyrefresh/src/refresher.dart:704:47)
E/flutter (28676): #2 EasyRefreshState._refreshStart (package:flutter_easyrefresh/src/refresher.dart:382:5)
E/flutter (28676): <asynchronous suspension>
E/flutter (28676): #3 EasyRefreshState.initState.<anonymous closure>.<anonymous closure> (package:flutter_easyrefresh/src/refresher.dart:256:13)
E/flutter (28676): #4 State.setState (package:flutter/src/widgets/framework.dart:1130:30)
E/flutter (28676): #5 EasyRefreshState.initState.<anonymous closure> (package:flutter_easyrefresh/src/refresher.dart:250:9)
E/flutter (28676): #6 _AnimationController&Animation&AnimationEagerListenerMixin&AnimationLocalListenersMixin&AnimationLocalStatusListenersMixin.notifyStatusListeners (package:flutter/src/animation/listener_helpers.dart:188:19)
E/flutter (28676): #7 AnimationController._checkStatusChanged (package:flutter/src/animation/animation_controller.dart:682:7)
E/flutter (28676): #8 AnimationController._tick (package:flutter/src/animation/animation_controller.dart:698:5)
E/flutter (28676): #9 Ticker._tick (package:flutter/src/scheduler/ticker.dart:228:5)
E/flutter (28676): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
E/flutter (28676): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleBeginFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:906:11)
E/flutter (28676): #12 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:370:8)
E/flutter (28676): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:904:17)
E/flutter (28676): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleBeginFrame (package:flutter/src/scheduler/binding.dart:834:5)
感谢您提供的刷新库,iOS端当滑动到顶部和底部的时候,behavior行为很奇怪,我不知道您测试了没
可以开发一个类似下拉进入淘宝二楼的功能吗?
how can i show message such as no internet , no data found, no more
Scrollbar目前加入了就报错了
想有个地方配置全局刷新动画,不然每个页面要写一个太麻烦了
在 EasyRefresh 部件里面使用 reverse 翻转数组的时候 翻转无效
求解决
您好,很喜欢这个组件包,有个需求,在下拉拖动的时候,进行一些操作,类似淘宝或京东的APP下拉的时候,隐藏AppBar,刷新完成后显示AppBar,现在在不改变源码的情况下,只能使用onRefresh方法
CustomScrollView( slivers: <Widget>[ CupertinoSliverNavigationBar( backgroundColor: Color.fromRGBO(110, 90, 160, 1.0), middle: Container(height: 0, width: 0), largeTitle: IconButton( color: Colors.white, alignment: Alignment.centerLeft, icon: Icon(Icons.menu), onPressed: () {}, ), previousPageTitle: 'Cupertino', ), CupertinoSliverRefreshControl( refreshTriggerPullDistance: 120.0, refreshIndicatorExtent: 120.0, builder: ..., onRefresh: () { return Future<void>.delayed(const Duration(seconds: 5)) ..then<void>((_) { if (mounted) { setState(() => repopulateList()); } }); }, ), ], )
我的 NotificationListener 里面用的是 其他Refresh插件,监听有效,我用这个插件后 NotificationListener 监听不起作用了,不知道你有没有遇到。
Can we make refresh animations work with Flare ?
Like in this example
https://github.com/2d-inc/Flare-Flutter/tree/master/example/space_reload
hello,
how can use waiting loading As it exists in FutureBuilder
switch (snapshot.connectionState) {
case ConnectionState.none:
return Text('Press button to start.');
case ConnectionState.active:
case ConnectionState.waiting:
return Text('Awaiting result...');
case ConnectionState.done:
if (snapshot.hasError)
return Text('Error: ${snapshot.error}');
return Text('Result: ${snapshot.data}');
}
错误信息:trying to call updateHeight() of null
需要用到的场景例如:在没有更多数据时我只希望直接在底部显示“没有更多数据”等,而不希望用户每次上拉都出现上拉加载的动画。
NestedScrollView+TabBarView里,加入AutomaticKeepAliveClientMixin后,滑动会出现滑动到中途自动回到顶部。
下滑到一定程度之后,切换tab页签,再次快速上滑,再次切换tab页签,再次快速上滑,页面出现滚动位置到页面最顶部的问题。
注意观察滚动条的位置,会发现滚动条位置突然挪上去了。
同时这组代码特别容易复现 #50 的问题。
import 'dart:async';
import 'package:example/generated/translations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
/// NestedScrollView页面
class NestedScrollViewPage extends StatefulWidget {
@override
_NestedScrollViewPageState createState() => _NestedScrollViewPageState();
}
class _NestedScrollViewPageState extends State<NestedScrollViewPage>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
ScrollController _controller;
TabController _tabController;
@override
void initState() {
super.initState();
_controller = new ScrollController();
_tabController = new TabController(length: 2, vsync: this);
}
@override
bool get wantKeepAlive => true;
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
body: new NestedScrollView(
controller: _controller,
headerSliverBuilder: (context, innerBoxIsScrolled) {
return <Widget>[
new SliverAppBar(
title: Text("NestedScrollView"),
centerTitle: true,
expandedHeight: 190.0,
flexibleSpace: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(),
),
floating: false,
pinned: true,
bottom: new PreferredSize(
child: new Card(
color: Theme.of(context).primaryColor,
elevation: 0.0,
margin: new EdgeInsets.all(0.0),
shape: new RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(0.0)),
),
child: new TabBar(controller: _tabController, tabs: <Widget>[
new Tab(
text: Translations.of(context).text("List"),
),
new Tab(
text: Translations.of(context).text("Grid"),
),
]),
),
preferredSize: new Size(double.infinity, 46.0),
),
),
];
},
body: TabBarView(
controller: _tabController,
children: <Widget>[
TestPage(
controller: _controller,
),
TestPage(
controller: _controller,
)
],
),
),
);
}
}
class TestPage extends StatefulWidget {
final ScrollController controller;
TestPage({this.controller});
@override
_TestPageState createState() => _TestPageState();
}
class _TestPageState extends State<TestPage>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
GlobalKey<RefreshHeaderState> _headerKeyGrid =
new GlobalKey<RefreshHeaderState>();
GlobalKey<RefreshHeaderState> _connectorHeaderKeyGrid =
new GlobalKey<RefreshHeaderState>();
GlobalKey<RefreshFooterState> _footerKeyGrid =
new GlobalKey<RefreshFooterState>();
GlobalKey<RefreshFooterState> _connectorFooterKeyGrid =
new GlobalKey<RefreshFooterState>();
GlobalKey<EasyRefreshState> _easyRefreshKey =
new GlobalKey<EasyRefreshState>();
List<String> addStrGrid = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0",
];
List<String> strGrid = [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0",
];
@override
bool get wantKeepAlive => true;
@override
Widget build(BuildContext context) {
super.build(context);
Widget headerGrid = ClassicsHeader(
key: _headerKeyGrid,
refreshText: Translations.of(context).text("pullToRefresh"),
refreshReadyText: Translations.of(context).text("releaseToRefresh"),
refreshingText: Translations.of(context).text("refreshing") + "...",
refreshedText: Translations.of(context).text("refreshed"),
moreInfo: Translations.of(context).text("updateAt"),
bgColor: Colors.transparent,
textColor: Colors.black,
);
Widget footerGrid = ClassicsFooter(
key: _footerKeyGrid,
loadHeight: 50.0,
loadText: Translations.of(context).text("pushToLoad"),
loadReadyText: Translations.of(context).text("releaseToLoad"),
loadingText: Translations.of(context).text("loading"),
loadedText: Translations.of(context).text("loaded"),
noMoreText: Translations.of(context).text("noMore"),
moreInfo: Translations.of(context).text("updateAt"),
bgColor: Colors.transparent,
textColor: Colors.black,
);
return new EasyRefresh(
key: _easyRefreshKey,
builder: (context, child, scrollController) {
return Scrollbar(child: child);
},
outerController: widget.controller,
refreshHeader:
ConnectorHeader(key: _connectorHeaderKeyGrid, header: headerGrid),
refreshFooter:
ConnectorFooter(key: _connectorFooterKeyGrid, footer: footerGrid),
child: CustomScrollView(
controller: widget.controller,
semanticChildCount: null, //strGrid.length,
slivers: <Widget>[
SliverList(
delegate: SliverChildListDelegate(<Widget>[headerGrid]),
),
SliverGrid(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
delegate: SliverChildBuilderDelegate(
(context, index) {
return new Container(
height: 100.0,
child: Card(
child: new Center(
child: new Text(
"$index",
style: new TextStyle(fontSize: 18.0),
),
),
));
},
childCount: strGrid.length,
)),
SliverList(
delegate: SliverChildListDelegate(<Widget>[footerGrid]),
)
],
),
onRefresh: () async {
print("onRefresh $this");
await new Future.delayed(const Duration(seconds: 1), () {
setState(() {
strGrid.clear();
strGrid.addAll(addStrGrid);
});
});
},
loadMore: () async {
print("loadMore $this");
// await new Future.delayed(const Duration(seconds: 1), () {
// if (strGrid.length < 140) {
setState(() {
for (var i = 0; i < 10; i++) {
strGrid.addAll(addStrGrid);
}
});
// }
// });
},
);
}
}
动画这块的有什么好的学习资料嘛看了你的几个例子觉得动画很强大,我看例子的时候有点吃力
ClassicsFooter和MaterialFooter不能修改完成延时时间么
上下来回拖拉,会出现抖动。
我明明已经往数组里加东西里还是会显示No More。
希望有个属性可以控制要不要显示No More。
希望能提供个属性配置让我上拉加载结束后直接渲染不需要再弹提示
Launching lib\flutter_easyrefresh\secondfloor\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Syncing files to device Android SDK built for x86...
D/ ( 7277): HostConnection::get() New Host Connection established 0xe9b525c0, tid 7297
D/EGL_emulation( 7277): eglMakeCurrent: 0xed95f640: ver 2 0 (tinfo 0xe9b4bda0)
I/flutter ( 7277): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 7277): The following assertion was thrown building Container(constraints: BoxConstraints(w=Infinity,
I/flutter ( 7277): h=-12.4; NOT NORMALIZED), dirty):
I/flutter ( 7277): BoxConstraints has a negative minimum height.
I/flutter ( 7277): The offending constraints were:
I/flutter ( 7277): BoxConstraints(w=Infinity, h=-12.4; NOT NORMALIZED)
I/flutter ( 7277):
I/flutter ( 7277): When the exception was thrown, this was the stack:
I/flutter ( 7277): #0 BoxConstraints.debugAssertIsValid..throwError (package:flutter/src/rendering/box.dart:504:9)
I/flutter ( 7277): #1 BoxConstraints.debugAssertIsValid. (package:flutter/src/rendering/box.dart:534:19)
I/flutter ( 7277): #2 BoxConstraints.debugAssertIsValid (package:flutter/src/rendering/box.dart:551:6)
I/flutter ( 7277): #3 new ConstrainedBox (package:flutter/src/widgets/basic.dart:1969:27)
I/flutter ( 7277): #4 Container.build (package:flutter/src/widgets/container.dart:381:17)
I/flutter ( 7277): #5 StatelessElement.build (package:flutter/src/widgets/framework.dart:3789:28)
I/flutter ( 7277): #6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3736:15)
I/flutter ( 7277): #7 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #8 StatelessElement.update (package:flutter/src/widgets/framework.dart:3796:5)
I/flutter ( 7277): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #10 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)
I/flutter ( 7277): #11 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4992:17)
I/flutter ( 7277): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #14 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #15 ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
I/flutter ( 7277): #16 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #17 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #18 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #19 ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
I/flutter ( 7277): #20 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #21 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)
I/flutter ( 7277): #22 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4992:17)
I/flutter ( 7277): #23 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #24 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #25 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #26 StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter ( 7277): #27 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #29 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #30 ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
I/flutter ( 7277): #31 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #32 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #33 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #34 StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter ( 7277): #35 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #36 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
I/flutter ( 7277): #37 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #39 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #40 StatelessElement.update (package:flutter/src/widgets/framework.dart:3796:5)
I/flutter ( 7277): #41 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #42 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
I/flutter ( 7277): #43 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #44 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #45 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #46 StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter ( 7277): #47 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #48 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #49 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #50 StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter ( 7277): #51 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #52 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #53 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #54 ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
I/flutter ( 7277): #55 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #56 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #57 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #58 ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
I/flutter ( 7277): #59 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #60 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #61 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #62 StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter ( 7277): #63 Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter ( 7277): #64 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
I/flutter ( 7277): #65 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter ( 7277): #66 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2273:33)
I/flutter ( 7277): #67 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:700:20)
I/flutter ( 7277): #68 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:268:5)
I/flutter ( 7277): #69 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:988:15)
I/flutter ( 7277): #70 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:928:9)
I/flutter ( 7277): #71 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:840:5)
I/flutter ( 7277): #75 _invoke (dart:ui/hooks.dart:209:10)
I/flutter ( 7277): #76 _drawFrame (dart:ui/hooks.dart:168:3)
I/flutter ( 7277): (elided 3 frames from package dart:async)
I/flutter ( 7277): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 7277): Another exception was thrown: A RenderFlex overflowed by 99317 pixels on the bottom.
I/flutter ( 7277): Another exception was thrown: BoxConstraints has a negative minimum height.
你好,我1.2.4版本还是出现这个问题,我在曾经的issues 中看到过,但是我还是出现这个问题,
new EasyRefresh( key: _easyRefreshKey, refreshHeader: MaterialHeader( key: _headerKey, ), refreshFooter: MaterialFooter( key: _footerKey, ), child: CustomScrollView( slivers: <Widget>[ SliverList( delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { return OrganizationItem( index: index, followButtonHidden: true, item: list[index]); }, childCount: list==null ? 0 : list.length, ), ) ], ), onRefresh: () async { await new Future.delayed(const Duration(seconds: 1), () { list.clear(); this.isShowLoading=false; isMore=true; pageNum='1'; followListRequest(studentId, pageNum, pageSize); }); }, loadMore: () async { await new Future.delayed(const Duration(seconds: 1), () { if(isMore){ this.isShowLoading=false; pageNum=(int.parse(pageNum)+1).toString(); // followListRequest(studentId, pageNum, pageSize); }else{ Alert.toast(context, '已加载完全部' , position: ToastPosition.center, duration: ToastDuration.short); } }); }, ),
这是我的代码,上拉加载就报错NoSuchMethodError: The method '>' was called on null,麻烦解决一下
将系统设置成简体中文,语言不能修改
很喜欢这个第三方,但比如im类应用reverse是很必要的,可否能考虑下?
下拉刷新的时候
错误信息:The method 'updateHeight' was called on null.
可能和sdk升级后,部分原生API发生变化有关。
目前监听headerHeightChanged事件没问题,但footerHeightChanged事件只有到达底部才能触发。有些功能就实现不了
文档不清楚啊
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.