Code Monkey home page Code Monkey logo

flutter_easy_refresh's Introduction

Hi there 👋, I'm codiss.

I love to talk on trending ⚡ technology ⚡, stay hungry stay foolish. Connect with me here 邮箱

  • 🚀 I use daily: Dart Flutter Android JavaScript Vue Git Shell Nginx Vite NPM

  • 💻 I work using: VS Code IntelliJ Android Studio Gitee GitHub GitLab macOS Windows

  • ⚙️ I also use and work: IntelliJ Flutter Vue HTML5 CSS3

  • 🌱 I’m currently learning: mpv Flutter Vue Jetpack Compose


You are my Visitor Count visitor, Thank You!🎉🎉

Github Stats


flutter_easy_refresh's People

Contributors

giampaologabba avatar hqwlkj avatar hwh97 avatar imhansai avatar laiiihz avatar lay523 avatar linxunfeng avatar notbucai avatar pwuts avatar xuelongqy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_easy_refresh's Issues

autoLoad与loadMore 冲突

设置autoLoad: true,同时设置loadMore:null
这时候滑动到底部,UI界面就会卡主,同时报错:
33c0b654f323475596a8e8e32218517b

关于iOS上拉下拉优化问题

我加上了behavior属性,他在iOS端看起来有点奇怪,不知道您发觉没有,他会突然跳一下.这种情况下发生在了下拉和上拉后,界面开始减速时,当界面滑动速度很慢,而又刚好到达顶端时,刷新动画,会突然加速,然后返回。如果快速上下拉动的话,动画效果看不出来。我认为是您在做动画时,控制动画时间的原因,动画时间过短造成的。我会尝试修改源码,也希望您能给个反馈

scrollController没有调用?

Exception: type 'Container' is not a subtype of type 'RefreshHeader' in type cast

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,
          ),
        )

下拉加载更多的动画可否自定义?

很好的控件,源码也很整洁。不过遇到一个问题是,目前的加载更多的动画有点慢,而且加载完成还会显示加载的更新时间,是否可以增加动画的设置?

NestedScrollView+TabBarView里,滑动过程中,偶尔会出现界面卡死的问题

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.

head动态参数

我想在结束时动态在head中显示本次更新了多少条数据,怎么设置或者设置更新了多少条数据呢

在Sliver中加载更多报错

错误日志如下

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)

能否增加下拉拖动的回调

您好,很喜欢这个组件包,有个需求,在下拉拖动的时候,进行一些操作,类似淘宝或京东的APP下拉的时候,隐藏AppBar,刷新完成后显示AppBar,现在在不改变源码的情况下,只能使用onRefresh方法

have u ever try CupertinoSliverRefreshControl in cupertino?

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 无效

我的 NotificationListener 里面用的是 其他Refresh插件,监听有效,我用这个插件后 NotificationListener 监听不起作用了,不知道你有没有遇到。

how can use waiting loading As it exists in FutureBuilder

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}');
    }

NestedScrollView+TabBarView里,加入AutomaticKeepAliveClientMixin后,滑动会出现滑动到中途自动回到顶部的问题

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);
          }
        });
        // }
        // });
      },
    );
  }
}

每次上拉加载结束后总会显示No More

我明明已经往数组里加东西里还是会显示No More。
希望有个属性可以控制要不要显示No More。
希望能提供个属性配置让我上拉加载结束后直接渲染不需要再弹提示

SecondFloorPage多次拖动后有可能引起异常,直至应用崩溃

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.

image

NoSuchMethodError: The method '>' was called on null

你好,我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,麻烦解决一下

有关reverse

很喜欢这个第三方,但比如im类应用reverse是很必要的,可否能考虑下?

Flutter 升级到1.2.0 报错问题

下拉刷新的时候
错误信息:The method 'updateHeight' was called on null.
可能和sdk升级后,部分原生API发生变化有关。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.