a widget provided to the flutter scroll component drop-down refresh and pull up load.

Overview

flutter_pulltorefresh

Intro

a widget provided to the flutter scroll component drop-down refresh and pull up load.support android and ios. If you are Chinese,click here(中文文档)

Features

  • pull up load and pull down refresh
  • It's almost fit for all Scroll witgets,like GridView,ListView...
  • provide global setting of default indicator and property
  • provide some most common indicators
  • Support Android and iOS default ScrollPhysics,the overScroll distance can be controlled,custom spring animate,damping,speed.
  • horizontal and vertical refresh,support reverse ScrollView also(four direction)
  • provide more refreshStyle: Behind,Follow,UnFollow,Front,provide more loadmore style
  • Support twoLevel refresh,implments just like TaoBao twoLevel,Wechat TwoLevel
  • enable link indicator which placing other place,just like Wechat FriendCircle refresh effect

Usage

add this line to pubspec.yaml

   dependencies:

    pull_to_refresh: ^2.0.0

import package

    import 'package:pull_to_refresh/pull_to_refresh.dart';

simple example,It must be noted here that ListView must be the child of SmartRefresher and cannot be separated from it. For detailed reasons, see here

  List<String> items = ["1", "2", "3", "4", "5", "6", "7", "8"];
  RefreshController _refreshController =
      RefreshController(initialRefresh: false);

  void _onRefresh() async{
    // monitor network fetch
    await Future.delayed(Duration(milliseconds: 1000));
    // if failed,use refreshFailed()
    _refreshController.refreshCompleted();
  }

  void _onLoading() async{
    // monitor network fetch
    await Future.delayed(Duration(milliseconds: 1000));
    // if failed,use loadFailed(),if no data return,use LoadNodata()
    items.add((items.length+1).toString());
    if(mounted)
    setState(() {

    });
    _refreshController.loadComplete();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SmartRefresher(
        enablePullDown: true,
        enablePullUp: true,
        header: WaterDropHeader(),
        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,
        onLoading: _onLoading,
        child: ListView.builder(
          itemBuilder: (c, i) => Card(child: Center(child: Text(items[i]))),
          itemExtent: 100.0,
          itemCount: items.length,
        ),
      ),
    );
  }

  // from 1.5.0, it is not necessary to add this line
  //@override
 // void dispose() {
    // TODO: implement dispose
  //  _refreshController.dispose();
  //  super.dispose();
 // }

The global configuration RefreshConfiguration, which configures all Smart Refresher representations under the subtree, is generally stored at the root of MaterialApp and is similar in usage to ScrollConfiguration. In addition, if one of your SmartRefresher behaves differently from the rest of the world, you can use RefreshConfiguration.copyAncestor() to copy attributes from your ancestor RefreshConfiguration and replace attributes that are not empty.

    // Smart Refresher under the global configuration subtree, here are a few particularly important attributes
     RefreshConfiguration(
         headerBuilder: () => WaterDropHeader(),        // Configure the default header indicator. If you have the same header indicator for each page, you need to set this
         footerBuilder:  () => ClassicFooter(),        // Configure default bottom indicator
         headerTriggerDistance: 80.0,        // header trigger refresh trigger distance
         springDescription:SpringDescription(stiffness: 170, damping: 16, mass: 1.9),         // custom spring back animate,the props meaning see the flutter api
         maxOverScrollExtent :100, //The maximum dragging range of the head. Set this property if a rush out of the view area occurs
         maxUnderScrollExtent:0, // Maximum dragging range at the bottom
         enableScrollWhenRefreshCompleted: true, //This property is incompatible with PageView and TabBarView. If you need TabBarView to slide left and right, you need to set it to true.
         enableLoadingWhenFailed : true, //In the case of load failure, users can still trigger more loads by gesture pull-up.
         hideFooterWhenNotFull: false, // Disable pull-up to load more functionality when Viewport is less than one screen
         enableBallisticLoad: true, // trigger load more by BallisticScrollActivity
        child: MaterialApp(
            ........
        )
    );

1.5.6 add new feather: localization ,you can add following code in MaterialApp or CupertinoApp:

    MaterialApp(
            localizationsDelegates: [
              // this line is important
              RefreshLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,
              GlobalMaterialLocalizations.delegate
            ],
            supportedLocales: [
              const Locale('en'),
              const Locale('zh'),
            ],
            localeResolutionCallback:
                (Locale locale, Iterable<Locale> supportedLocales) {
              //print("change language");
              return locale;
            },
    )

ScreenShots

Examples

Style basic header in other place reverse + horizontal
Style twoLevel use with other widgets chat
Style simple custom header(使用SpinKit) dragableScrollSheet+LoadMore Gif Indicator

Indicator

各种指示器

refresh style pull up load style
RefreshStyle.Follow
Follow
RefreshStyle.UnFollow
不跟随
LoadStyle.ShowAlways
永远显示
LoadStyle.HideAlways
永远隐藏
RefreshStyle.Behind
背部
RefreshStyle.Front
前面悬浮
LoadStyle.ShowWhenLoading
当加载中才显示,其它隐藏
Style ClassicIndicator WaterDropHeader MaterialClassicHeader
Style WaterDropMaterialHeader Shimmer Indicator Bezier+Circle

about SmartRefresher's child explain

Since 1.4.3, the child attribute has changed from ScrollView to Widget, but this does not mean that all widgets are processed the same. SmartRefresher's internal implementation mechanism is not like NestedScrollView

There are two main types of processing mechanisms here, the first categoryis the component inherited from ScrollView. At present, there are only three types, ListView, GridView, CustomScrollView. The second category is components that are not inherited from ScrollView, which generally put empty views, NoScrollable views (NoScrollable convert Scrollable), PageView, and you don't need to estimate height by LayoutBuilder yourself.

For the first type of mechanism, slivers are taken out of the system "illegally". The second is to put children directly into classes such as `SliverToBox Adapter'. By splicing headers and footers back and forth to form slivers, and then putting slivers inside Smart Refresher into CustomScrollView, you can understand Smart Refresher as CustomScrollView, because the inside is to return to CustomScrollView. So, there's a big difference between a child node and a ScrollView.

Now, guess you have a requirement: you need to add background, scrollbars or something outside ScrollView. Here's a demonstration of errors and correct practices

   //error
   SmartRefresher(
      child: ScrollBar(
          child: ListView(
             ....
      )
    )
   )

   // right
   ScrollBar(
      child: SmartRefresher(
          child: ListView(
             ....
      )
    )
   )

Demonstrate another wrong doing,put ScrollView in another widget

   //error
   SmartRefresher(
      child:MainView()
   )

   class MainView extends StatelessWidget{
       Widget build(){
          return ListView(
             ....
          );
       }

   }

The above mistake led to scrollable nesting another scrollable, causing you to not see the header and footer no matter how slippery you are. Similarly, you may need to work with components like NotificationListener, ScrollConfiguration..., remember, don't store them outside ScrollView (you want to add refresh parts) and Smart Refresher memory.。

More

Exist Problems

  • about NestedScrollView,When you slide down and then slide up quickly, it will return back. The main reason is that NestedScrollView does not consider the problem of cross-border elasticity under bouncingScrollPhysics. Relevant flutter issues: 34316, 33367, 29264. This problem can only wait for flutter to fix this.
  • SmartRefresher does not have refresh injection into ScrollView under the subtree, that is, if you put AnimatedList or RecordableListView in the child is impossible. I have tried many ways to solve this problem and failed. Because of the principle of implementation, I have to append it to the head and tail of slivers. In fact, the problem is not that much of my Component issues, such as AnimatedList, can't be used with AnimatedList and GridView unless I convert AnimatedList to SliverAnimatedList is the solution. At the moment, I have a temporary solution to this problem, but it's a bit cumbersome to rewrite the code inside it and then outside ScrollView. Add SmartRefresher, see my two examples Example 1Example 2

Thanks

SmartRefreshLayout

LICENSE


MIT License

Copyright (c) 2018 Jpeng

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Comments
  • App is not built using new version 1.6.4

    App is not built using new version 1.6.4

    Trying to build a flutter app using new version of the library 1.6.4. Logs when building:

    [+18456 ms] ../../../../../../.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.4/lib/src/smart_refresher.dart:434:9: Error: No named parameter with the name 'keyboardDismissBehavior'.
    [        ]         keyboardDismissBehavior:
    [        ]         ^^^^^^^^^^^^^^^^^^^^^^^
    [        ] ../../../../flutter/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match.
    [        ]   const CustomScrollView({
    [        ]         ^^^^^^^^^^^^^^^^
    [+8058 ms] ../../../../../../.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.4/lib/src/smart_refresher.dart:434:9: Error: No named parameter with the name 'keyboardDismissBehavior'.
    [   +2 ms]         keyboardDismissBehavior:
    [        ]         ^^^^^^^^^^^^^^^^^^^^^^^
    [        ] ../../../../flutter/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match.
    [        ]   const CustomScrollView({
    [        ]         ^^^^^^^^^^^^^^^^
    [+9585 ms] FAILURE: Build failed with an exception.
    [        ] * Where:
    [        ] Script '/Users/sergey/Projects/Flutter/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 904
    [        ] * What went wrong:
    [        ] Execution failed for task ':app:compileFlutterBuildDebug'.
    [        ] > Process 'command '/Users/sergey/Projects/Flutter/flutter/bin/flutter'' finished with non-zero exit value 1
    [        ] * Try:
    [        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    [        ] * Get more help at https://help.gradle.org
    [        ] BUILD FAILED in 38s
    [{"event":"app.progress","params":{"appId":"13afa2cc-8a69-46e0-b928-0536b88bb6f7","id":"0","progressId":null,"finished":true}}]
    [ +481 ms] Exception: Gradle task assembleDebug failed with exit code 1
    [   +8 ms] 
               #0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
               #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:474:9)
               <asynchronous suspension>
               #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:977:18)
               #3      _rootRunUnary (dart:async/zone.dart:1198:47)
               #4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
               #5      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
               #6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
               #7      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
               #8      Future._completeWithValue (dart:async/future_impl.dart:529:5)
               #9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
               #10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
               #11     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
               #12     _rootRunUnary (dart:async/zone.dart:1198:47)
               #13     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
               #14     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
               #15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
               #16     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
               #17     Future._completeWithValue (dart:async/future_impl.dart:529:5)
               #18     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
               #19     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
               #20     AndroidDevice.isLocalEmulator (package:flutter_tools/src/android/android_device.dart)
               #21     _rootRunUnary (dart:async/zone.dart:1198:47)
               #22     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
               #23     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
               #24     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
               #25     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
               #26     Future._completeWithValue (dart:async/future_impl.dart:529:5)
               #27     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
               #28     _rootRun (dart:async/zone.dart:1190:13)
               #29     _CustomZone.run (dart:async/zone.dart:1093:19)
               #30     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
               #31     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
               #32     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
               #33     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
               #34     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
               #35     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
    

    It seems the error is in smart_refresher.dart file on 434 line, "No named parameter with the name 'keyboardDismissBehavior'" for CustomScrollView widget.

    opened by sergey-regotun 26
  • 基于fish redux使用时报错  初始化问题

    基于fish redux使用时报错 初始化问题

    flutter: ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
    flutter: The following assertion was thrown during a scheduler callback:
    flutter: Try not to call requestRefresh() before build,please call after the ui was rendered
    flutter: 'package:pull_to_refresh/src/smart_refresher.dart': Failed assertion: line 259 pos 12: 'position !=
    flutter: null'
    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      RefreshController.requestRefresh (package:pull_to_refresh/src/smart_refresher.dart:259:12)
    flutter: #3      new RefreshController.<anonymous closure> (package:pull_to_refresh/src/smart_refresher.dart:251:9)
    flutter: #4      _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1012:15)
    flutter: #5      _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:960:9)
    flutter: #6      _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:864:5)
    flutter: #10     _invoke (dart:ui/hooks.dart:219:10)
    flutter: #11     _drawFrame (dart:ui/hooks.dart:178:3)
    flutter: (elided 5 frames from class _AssertionError and package dart:async)
    flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
    
    
    opened by flutterbest 16
  • flutter 3.0 support

    flutter 3.0 support

                     ^
    

    /D:/soft/flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-2.0.0/lib/src/internals/indicator_wrap.dart:393:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

    • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/D:/soft/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance!.addPostFrameCallback((_) {
    opened by jeromekai 15
  • Don't use one refreshController to multiple SmartRefresher,It will cause some unexpected bugs mostly in TabBarView

    Don't use one refreshController to multiple SmartRefresher,It will cause some unexpected bugs mostly in TabBarView

    Don't use one refreshController to multiple SmartRefresher,It will cause some unexpected bugs mostly in TabBarView package:pull_to_refresh/src/smart_refresher.dart':

    image image

    opened by jahnli 15
  • Looking up a deactivated widget's ancestor is unsafe.

    Looking up a deactivated widget's ancestor is unsafe.

    I change tab with pull_to_refresh and catch this exception:

    Exception
    ════════ Exception caught by animation library ═════════════════════════════════
    The following assertion was thrown while notifying listeners for AnimationController:
    Looking up a deactivated widget's ancestor is unsafe.
    
    At this point the state of the widget's element tree is no longer stable.
    
    To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
    
    When the exception was thrown, this was the stack
    #0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure> 
    package:flutter/…/widgets/framework.dart:3825
    #1      Element._debugCheckStateIsActiveForAncestorLookup 
    package:flutter/…/widgets/framework.dart:3839
    #2      Element.dependOnInheritedWidgetOfExactType 
    package:flutter/…/widgets/framework.dart:3881
    #3      Scrollable.of 
    package:flutter/…/widgets/scrollable.dart:255
    #4      _MaterialClassicHeaderState.initState.<anonymous closure> 
    package:pull_to_refresh/…/indicator/material_indicator.dart:79
    ...
    The AnimationController notifying listeners was: AnimationController#14251(⏮ 0.000; paused)
    ════════════════════════════════════════════════════════════════════════════════
    ══╡ EXCEPTION CAUGHT BY ANIMATION LIBRARY ╞═════════════════════════════════════════════════════════
    The following assertion was thrown while notifying listeners for AnimationController:
    Looking up a deactivated widget's ancestor is unsafe.
    At this point the state of the widget's element tree is no longer stable.
    To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by
    calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
    When the exception was thrown, this was the stack:
    #0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure> 
    package:flutter/…/widgets/framework.dart:3825
    #1      Element._debugCheckStateIsActiveForAncestorLookup 
    package:flutter/…/widgets/framework.dart:3839
    #2      Element.dependOnInheritedWidgetOfExactType 
    package:flutter/…/widgets/framework.dart:3881
    #3      Scrollable.of 
    package:flutter/…/widgets/scrollable.dart:255
    #4      _MaterialClassicHeaderState.initState.<anonymous closure> 
    package:pull_to_refresh/…/indicator/material_indicator.dart:79
    #5      AnimationLocalListenersMixin.notifyListeners 
    package:flutter/…/animation/listener_helpers.dart:137
    #6      AnimationController.value= 
    package:flutter/…/animation/animation_controller.dart:368
    #7      _MaterialClassicHeaderState.resetValue 
    package:pull_to_refresh/…/indicator/material_indicator.dart:146
    #8      _WaterDropMaterialHeaderState.resetValue 
    package:pull_to_refresh/…/indicator/material_indicator.dart:292
    #9      RefreshIndicatorState._handleModeChange 
    package:pull_to_refresh/…/internals/indicator_wrap.dart:239
    #10     ChangeNotifier.notifyListeners 
    package:flutter/…/foundation/change_notifier.dart:209
    #11     ValueNotifier.value= 
    package:flutter/…/foundation/change_notifier.dart:276
    #12     IndicatorStateMixin.initState 
    package:pull_to_refresh/…/internals/indicator_wrap.dart:622
    #13     _MaterialClassicHeaderState.initState 
    package:pull_to_refresh/…/indicator/material_indicator.dart:92
    #14     _WaterDropMaterialHeaderState.initState 
    package:pull_to_refresh/…/indicator/material_indicator.dart:227
    #15     StatefulElement._firstBuild 
    package:flutter/…/widgets/framework.dart:4684
    #16     ComponentElement.mount 
    package:flutter/…/widgets/framework.dart:4520
    #17     Element.inflateWidget 
    package:flutter/…/widgets/framework.dart:3490
    #18     MultiChildRenderObjectElement.mount 
    package:flutter/…/widgets/framework.dart:5991
    #19     _ViewportElement.mount 
    package:flutter/…/widgets/viewport.dart:207
    ...     Normal element mounting (88 frames)
    #107    Element.inflateWidget 
    package:flutter/…/widgets/framework.dart:3490
    #108    Element.updateChild 
    package:flutter/…/widgets/framework.dart:3258
    #109    _LayoutBuilderElement._layout.<anonymous closure> 
    package:flutter/…/widgets/layout_builder.dart:137
    #110    BuildOwner.buildScope 
    package:flutter/…/widgets/framework.dart:2620
    #111    _LayoutBuilderElement._layout 
    package:flutter/…/widgets/layout_builder.dart:117
    #112    RenderObject.invokeLayoutCallback.<anonymous closure> 
    package:flutter/…/rendering/object.dart:1868
    #113    PipelineOwner._enableMutationsToDirtySubtrees 
    package:flutter/…/rendering/object.dart:920
    #114    RenderObject.invokeLayoutCallback 
    package:flutter/…/rendering/object.dart:1868
    #115    RenderConstrainedLayoutBuilder.rebuildIfNecessary 
    package:flutter/…/widgets/layout_builder.dart:226
    #116    _RenderLayoutBuilder.performLayout 
    package:flutter/…/widgets/layout_builder.dart:299
    #117    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #118    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #119    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #120    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #121    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #122    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #123    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #124    RenderSliverFixedExtentBoxAdaptor.performLayout 
    package:flutter/…/rendering/sliver_fixed_extent_list.dart:248
    #125    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #126    RenderSliverEdgeInsetsPadding.performLayout 
    package:flutter/…/rendering/sliver_padding.dart:137
    #127    _RenderSliverFractionalPadding.performLayout 
    package:flutter/…/widgets/sliver_fill.dart:170
    #128    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #129    RenderViewportBase.layoutChildSequence 
    package:flutter/…/rendering/viewport.dart:471
    #130    RenderViewport._attemptLayout 
    #131    RenderViewport.performLayout 
    package:flutter/…/rendering/viewport.dart:1374
    #132    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #133    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #134    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #135    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #136    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #137    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #138    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #139    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #140    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #141    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #142    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #143    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #144    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #145    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #146    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #147    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #148    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #149    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #150    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #151    RenderProxyBoxMixin.performLayout 
    package:flutter/…/rendering/proxy_box.dart:115
    #152    RenderObject.layout 
    package:flutter/…/rendering/object.dart:1769
    #153    MultiChildLayoutDelegate.layoutChild 
    package:flutter/…/rendering/custom_layout.dart:173
    #154    _ScaffoldLayout.performLayout 
    package:flutter/…/material/scaffold.dart:495
    #155    MultiChildLayoutDelegate._callPerformLayout 
    package:flutter/…/rendering/custom_layout.dart:242
    #156    RenderCustomMultiChildLayoutBox.performLayout 
    package:flutter/…/rendering/custom_layout.dart:401
    #157    RenderObject._layoutWithoutResize 
    package:flutter/…/rendering/object.dart:1632
    #158    PipelineOwner.flushLayout 
    package:flutter/…/rendering/object.dart:889
    #159    RendererBinding.drawFrame 
    package:flutter/…/rendering/binding.dart:404
    #160    WidgetsBinding.drawFrame 
    package:flutter/…/widgets/binding.dart:867
    #161    RendererBinding._handlePersistentFrameCallback 
    package:flutter/…/rendering/binding.dart:286
    #162    SchedulerBinding._invokeFrameCallback 
    package:flutter/…/scheduler/binding.dart:1117
    #163    SchedulerBinding.handleDrawFrame 
    package:flutter/…/scheduler/binding.dart:1056
    #164    SchedulerBinding._handleDrawFrame 
    package:flutter/…/scheduler/binding.dart:972
    #168    _invoke  (dart:ui/hooks.dart:253:10)
    #169    _drawFrame  (dart:ui/hooks.dart:211:3)
    (elided 3 frames from dart:async)
    The AnimationController notifying listeners was:
      AnimationController#14251(⏮ 0.000; paused)
    
    flutter doctor --version
    Flutter 1.20.0-8.0.pre.75 • channel master • https://github.com/flutter/flutter.git
    Framework • revision bb3280885c (8 hours ago) • 2020-07-13 16:28:27 -0700
    Engine • revision f10f172573
    Tools • Dart 2.9.0 (build 2.9.0-20.0.dev 06cb010247)
    
    need details 
    opened by Gorniv 14
  • 明明执行了RefreshCompleted(),但是还是提示刷新中

    明明执行了RefreshCompleted(),但是还是提示刷新中

    image

    void _onRefresh(Action action, Context<RewardCollectionState> ctx) {
      getMoment().then((moments) {
        ctx.dispatch(RewardCollectionActionCreator.modify((clone) {
          clone.moments = moments;
        }));
        ctx.state.refreshController.refreshCompleted();
      }).catchError((e) {
        ctx.state.refreshController.refreshFailed();
      });
    }
    
    fish_redux 
    opened by EaglesChen 12
  • 这个代码中,怎么缓存页面

    这个代码中,怎么缓存页面

    https://github.com/peng8350/flutter_pulltorefresh/blob/master/example/lib/ui/example/useStage/Nested.dart

    怎么缓存页面。 我的解决办法是: class _RefreshListViewState extends State with AutomaticKeepAliveClientMixin {

    @override bool get wantKeepAlive => true; 了 但是这样 ,一个页面发生 更多加载,全部页面的都出发了

    opened by BadDeveloper2022 10
  • How to remove animation with enableBallisticRefresh=false?

    How to remove animation with enableBallisticRefresh=false?

    When setting enableBallisticRefresh: false (which is the default), as expected, no refresh is triggered when scrolling up. However, the refresh animation is still visible. How can I only start the refresh animation when the drag/fling gesture was started when the scroll was at position 0?

    opened by themadmrj 9
  • Error: No named parameter with the name 'keyboardDismissBehavior'.

    Error: No named parameter with the name 'keyboardDismissBehavior'.

    when use “flutter build ios --release --no-codesign” , it will throw a error message "Error: No named parameter with the name 'keyboardDismissBehavior'."

    opened by AnadaYuKi 9
  • Is it possible to pause collapse of header when refreshstatus.failed?

    Is it possible to pause collapse of header when refreshstatus.failed?

    Hi,

    I have a short question. Is it possible to stop the refresh header from collapsing when refreshstaus is set to .failed? Currently I am using the Shimmerheader like this:

    body: SafeArea(
            child: SmartRefresher(
              header: buildShimmerHeader(),
              controller: _refreshController,
              enablePullUp: false,
              onRefresh: () async {
                if (!_isOffline) {
                 // try refreshing... it fails
    
                  _refreshController.refreshFailed();
                } else {
                 //...
                }
              },
              child: ListView()
    

    Shimmerheader:

    final Widget body = ScaleTransition(
          scale: _scaleController,
          child: FadeTransition(
            opacity: _fadeController,
            child: mode == RefreshStatus.refreshing
                ? Shimmer.fromColors(
                    period: widget.period,
                    direction: widget.direction,
                    baseColor: widget.baseColor,
                    highlightColor: widget.highlightColor,
                    child: Center(
                      child: widget.text,
                    ),
                  )
                : mode == RefreshStatus.failed
                    ? Center(
              child: RichText(
                text: TextSpan(
                  children: [
                    WidgetSpan(
                      child: Padding(
                        padding: EdgeInsets.only(bottom: 1.5),
                        child: Icon(
                          Icons.error,
                          size: 23.0,
                          color: Colors.grey,
                        ),
                      ),
                    ),
                    TextSpan(
                      text: " Refresh failed",
                    ),
                  ],
                  style: TextStyle(
                    color: Colors.grey,
                    fontSize: 22,
                  ),
                ),
              ),
            )
                    : Center(
                        child: widget.text,
                      ),
          ),
        );
    
    

    What currently happens:

    1. onRefresh, ShimmerHeader does as normal
    2. refresh fails -> RefreshStatus.failed
    3. Shimmer Header text changes "Pull to refresh" -> "Refresh failed"
    4. Header collapses immediately

    What I want to do:

    1. onRefresh, ShimmerHeader does as normal
    2. refresh fails -> RefreshStatus.failed
    3. Shimmer Header text changes "Pull to refresh" -> "Refresh failed"
    4. Header waits 2 seconds before collapsing (<- How do I achieve this????)

    I know that onModeChange() exists, but this does not work:

     void onModeChange(RefreshStatus mode) async {
        if (mode == RefreshStatus.failed){
          _scaleController.stop(canceled: false);
          await Future.delayed(Duration(milliseconds: 2000));
          _scaleController.forward();
        }
      }
    

    How to I achieve this?

    I would be very grateful for your help :)

    opened by vionc 9
  • 关于在安卓中的惯性越界回弹

    关于在安卓中的惯性越界回弹

    在iOS中,利用惯性到达顶部的时候如果速度不为0,那么会触发越界回弹,但是SmartRefresher在安卓中利用惯性到达顶部的时候如果速度不为0时会弹出水波纹的效果而不是越界回弹,能否加一个这样的效果从而让安卓和iOS两端的体验一致呢,就是能够有越界回弹的效果,或者设置一个属性让用户定制是否启用越界回弹

    opened by luckysmg 9
  • add possibility to return RenderSliver instead of _RenderLayoutBuilder

    add possibility to return RenderSliver instead of _RenderLayoutBuilder

    when I try to wrap SliverList with SmartRefersher inside CustomScrollView it gives me this error -> A RenderViewport expected a child of type RenderSliver but received a child of type _RenderLayoutBuilder. The relevant error-causing widget was SmartRefresher

    so I hope that anyone can customize SmartRefersher with some thing like SliverSmartRefersher to make it possible to add it as a child of CustomScrollView

    this is the code that I want to achieve, what's give me the above error

    CustomScrollView(
                    slivers: [
                      SliverToBoxAdapter(
                        child: UserInfoWidget(
                          user: data,
                        ),
                      ),
                      SliverPersistentHeader(
                        pinned: true,
                        delegate: _PresistentHeaderDelegate(
                          child: const UserProfileTapWidget(),
                        ),
                      ),
                      SmartRefresher(
                        onRefresh: () {},
                        controller: RefreshController(),
                        child: SliverList(
                          delegate: SliverChildBuilderDelegate(
                            (context, index) {
                              return const PostWidget(myPost: true);
                            },
                            childCount: 10,
                          ),
                        ),
                      )
                    ],
                  ),
    
    opened by abdullahalamodi 0
  • pull to refresh above nestedscrollview like instagram

    pull to refresh above nestedscrollview like instagram

    i want to set refresh on above the nestedscrollview like this (smartrefresher=>nestedscrollview with sliverappbar=>tabbarview) there is a package named easy refresh that works on nested but has few issues if U can make youre package like this it would be very nice. i uploaded my screen that made by easy refresh...but as i say it has few issues that make this package unusable for larger apps. https://github.com/xuelongqy/flutter_easy_refresh by the way thanks for youre package.

    https://user-images.githubusercontent.com/120022216/206938477-da7c55cd-0fde-4747-8aa7-f4ffe2b6ed65.mp4

    opened by RezaKhajvand 0
  • refreshController.position.addListener not working after pull to refresh

    refreshController.position.addListener not working after pull to refresh

    After pull to refresh has completed, whenever the subsequent scrolling, pull to refresh scolling is not able to be detected anymore.

    Whatever that runs in the function (){} is not working

    opened by shungz89 0
Releases(2.0.0)
  • 2.0.0(May 7, 2021)

    Breaking Changes:

    • Remove onOffsetChange in SmartRefresher,autoLoad in RefreshConfiguration,scrollController in RefreshController
    • add argument to onTwoLevel(callback when closed)

    features

    • migrate null-safety
    • add needCallback in requestRefresh and requestLoading for avoiding the callback of onRefresh or onLoading

    Bug fix

    • In NestedScrollView+ClampingScrollPhysics(Android ScrollBehaviour),header can be seen when fling to top.
    • unMounted widget used crash error when fast rebuild in requestRefresh
    • fix sliverRefreshBody layoutSize instead of -0.001,it will crash error when viewportMainAxis=0

    Other

    • Add assert to avoid invalid usage
    Source code(tar.gz)
    Source code(zip)
  • 1.6.5(Apr 11, 2021)

  • 1.6.4-nullsafety.0(Mar 19, 2021)

  • 1.5.0(Jul 13, 2019)

    Fix a Big Bug in FrontStyle:When overScroll(pixels <0.0),it shouldn't be disabled gesture add shouldFollowContentWhenNotFull add support to scrollable widget Fix ignore reverse load more paintOrigin issue change hideFooterWhenNotfull default value to false update header default releaseIcon and footer idle default Icon

    Source code(tar.gz)
    Source code(zip)
  • 1.6.4(Jan 19, 2021)

  • 1.6.3(Nov 17, 2020)

    • fix bug:gesture disabled after refresh complete in an error refreshState
    • fix problem:Footer hide back suddenly(this cause by the flutter breaking change)
    • add vibrate option to enable vibrate when trigger onRefresh or onLoading
    • fix SmartRefresher key in mutiple widgets
    • add other languages
    Source code(tar.gz)
    Source code(zip)
  • 1.6.2(Sep 30, 2020)

  • 1.6.1(Jul 25, 2020)

    • fix nestedSrollView requestRefresh error
    • fix NestedScrollView cast error
    • fix twice loading when no data return
    • reuse the state when update refreshController
    • add other language
    Source code(tar.gz)
    Source code(zip)
  • 1.6.0(Jun 21, 2020)

    • fix slow bounce back when load more too fast
    • fix footer renderError with reverse:true,behaviour return to 1.5.7
    • add check null in requestRefresh()
    • fix refreshText reverse error(ClassicHeader) when reverse:true
    Source code(tar.gz)
    Source code(zip)
  • 1.5.8(Jan 13, 2020)

    • fix breaking change crash error after flutter 1.13.6 upgrade
    • add other language
    • fix material header frequently setState slow down the performance
    • fix bug:loadFinish throw error when dispose widget(short time to trigger)
    • fix WaterDropMaterialHeader "color" invalid
    Source code(tar.gz)
    Source code(zip)
  • 1.5.6(Sep 7, 2019)

    • add new feature:refresh localizations
    • The footer layout size should be added to calculate whether the Viewport is full of a screen
    • fix physics check error when theme use other platform
    • add topHitBoundary,bottomHitBoundary in RefreshConfiguration
    • move headerOffset from RefreshConfiguration,move to indicator setting
    • In Android systems,default change: fast fling will be stopped in 0 pixels(Android系统(Clamping)默认情况下,快速惯性向上滑动,当准备越界时会被阻断)
    • Optimized part indicator,auto attach primaryColor from Theme,text style adjust etc..
    • Optimize requestRefresh() and requestLoading(),avoid spring back when far from target point,add one parameter controll whether to move down or top
    Source code(tar.gz)
    Source code(zip)
  • 1.5.5(Aug 31, 2019)

    breaking change

    • add new canLoading state for footer
    • add canLoadingText,canLoadingIcon,completeDuration in footer
    • enableLoadingWhenFailed default value change to true
    • shouldFollowContentWhenNotFull: in noMore state default return true

    twoLevel

    • add TwoLevelHeader,reduce the difficulty of using the second floor function

    Bug fix

    • twoLevel bug: fix viewportDimenssion use error,which lead to height dynamic error
    • fix underScroll bug when footer is noMore state or hideWhenNotFull=true and viewport not full one screen in Android
    • NeverScrollPhysics is ignored,when passing NeverScrollPhysics,it should disable scroll

    other

    • add enableBallisticLoad(same with enableBallisticRefresh) in RefreshConfiguration
    • add requestTwoLevel method in RefreshController
    • add endLoading,readyToLoad for CustomFooter
    • add ScrollView's props to SmartRefresher,mostly for SingleChildView not ScrollView
    Source code(tar.gz)
    Source code(zip)
  • 1.5.4(Aug 12, 2019)

    • add new RefreshConfiguration constructor "copyAncestor"
    • fix bug 1: when !enablePullDown && !enablePullUp crash error
    • fix bug 2: "pixels" call on null when refresh completed and ready to springback In a very short time and disposed
    • enable "primary" attr working,Avoiding clicking on the status bar to cause scrolling to the top in some stiuation
    • requestRefresh() and requestLoading() change to return a future
    Source code(tar.gz)
    Source code(zip)
  • 1.5.3(Aug 4, 2019)

    • add new indicator: BezierCircleHeader
    • change spring default value ,make it fast and smooth
    • fix cast ScrollPosition error with NestedScrollView
    Source code(tar.gz)
    Source code(zip)
  • 1.5.2(Jul 31, 2019)

    • change maxOverScrollExtent default to 60
    • maxScrollExtent should subtract layoutExtent instead of boxExtent when indicator not floating
    • add SmartRefresher builder constructor for some special use stage
    • when child is not extends scrollView,it should convert height to viewport's height when child's height is infite,such as PageView,emptyWidget with Center,else it will use LayoutBuilder get height
    • header,footer now unlimit the type ,convert to widget,but only sliver widget,Considering the problem of combined indicators
    • CustomHeader,CustomFooter expose inner indicator event
    • resetNoData should only can work when footer indicator is noMore state
    • fix twolevel and refresh prior problem
    Source code(tar.gz)
    Source code(zip)
  • 1.5.1(Jul 25, 2019)

    • add api docs in code
    • add test to prevent previous bugs as much as possible
    • enableScrollWhenCompleted default value change to false,when header spring back,doesn't allow to scroll by gesture
    • improve enableScrollWhenCompleted safety ,fix trigger disable scroll times error
    • maxScrollExtent should subtract boxExtent when floating(indicator layoutExtent != 0) or not
    • maxOverScrollExtent default change to 30.0 in Android,maxUnderScrollExtent default change to 0.0 in Android
    • Fix footer onClick not working when click near footer edge
    • fix canTwoLevel text showing in other twoLevel state
    • when enablePullDown= false && enableTwoLevel = true,it should add header into Viewport
    • remove reverse in some header indicators,inner auto check direction,no need to pass paramter
    • fix render error in footer when asix = Horizontal & reverse = true
    Source code(tar.gz)
    Source code(zip)
  • 1.4.9(Jul 9, 2019)

    • Fix MaterialClassicHeader,WaterDropHeader some err
    • Optimze WaterdropMaterial
    • remove hit top in clamping physics
    • add springDescrition,dragSpeedRatio in RefreshConfiguration
    • fix BehindStyle layoutExtent error
    Source code(tar.gz)
    Source code(zip)
  • 1.4.8(Jul 6, 2019)

    • provide three load more style:ShowAlways,HideAlways,ShowWhenLoading
    • add linkFooter
    • Fix Bug: requestRefresh() interupted when physics =Clamping && offset !=0
    • Fix Bug: When viewport not enough onepage ,pull up will change the state to loading,but not callback onLoading
    • revert change before:SmartRefresher change Stateless,Fix position may be null in some stiuations
    • add enableScrollWhenRefreshCompleted,enableBallisticRefresh,enableLoadingWhenFailed bool in RefreshConfiguration
    • enable footerTriggerdistance pass Negative
    Source code(tar.gz)
    Source code(zip)
  • 1.4.7(Jul 2, 2019)

    1.0.0

    • initRelease

    1.0.1

    • Remove bottomColor

    1.0.2

    • Add Failed RefreshMode when catch data failed
    • ReMake Default header and footer builder
    • Replace RefreshMode,loadMode to refreshing,loading
    • Replace onModeChange to onRefresh,onLoadMore

    1.0.3

    • Fix error Props
    • Add interupt Scroll when failure status

    1.0.4

    • Update README and demo

    1.0.5

    • Remove headerHeight,footerHeight to get height inital
    • Make footer stay at the bottom of the world forever
    • replace idle to idel(my English mistake)
    • Fix defaultIndictor error Icon display

    1.0.6

    • Use Material default LoadingBar
    • Add a bool paramter to onOffsetChange to know if pullup or pulldown
    • Fix Bug: when pulled up or pull-down, sizeAnimation and IOS elasticity conflict, resulting in beating.

    1.0.7

    • Fix Bug1: The use of ListView as a container to cause a fatal error (continuous sliding) when the bottom control is reclaimed, using the SingleChildScrollView instead of preventing the base control from recovering many times from the exception
    • Fix Bug2: When the user continues to call at the same time in the two states of pull-down and drop down, the animation has no callback problem when it enters or fails.

    1.0.8

    • Reproducing bottom indicator, no more manual drag to load more
    • Control property values change more,Mainly:1.onModeChange => onRefreshChange,onLoadChange, 2.Add enableAutoLoadMore,3.Remove bottomVisiableRange

    1.1.0

    Notice: This version of the code changes much, Api too

    • Transfer state changes to Wrapper of indicator to reduce unnecessary interface refresh.
    • No longer using Refreshmode or LoadMode,replaced int because the state is hard to determine.
    • Now support the ScrollView in the reverse mode
    • The indicators are divided into two categories, loadIndicator and refreshIndicator, and the two support header and footer
    • provided a controller to invoke some essential operations inside.
    • Move triggerDistance,completeTime such props to Config
    • Add ClassicIndicator Convenient construction indicator

    1.1.1

    • Make triigerDistance be equally vaild for LoadWrapper
    • Add enableOverScroll attribute

    1.1.2

    • Fix Bug:Refreshing the indicator requires multiple dragging to refresh
    • Fix ClassialIndicator syntax errors and display status when no data is added.

    1.1.3

    • Fix contentList's item cannot be cached,Remove shrinkWrap,physics limit
    • Fix onOffsetChange callback error,In completion, failure, refresh state is also callback
    • Add unfollowIndicator implement in Demo(Example3)

    1.1.4

    • Fix enableOverScroll does not work
    • Add default IndicatorBuilder when headerBuilder or footerBuilder is null
    • Fix cannot loading when user loosen gesture and listview enter the rebounding

    1.1.5

    • Fix problem of offsetChange
    • Fix CustomScrollView didn't work
    • Fix refreshIcon not reference in ClassialIndicator

    1.1.6

    • Fix Compile error after flutter update

    1.2.0

    • Fixed the problem that ScrollController was not applied to internal controls
    • Optimize RefreshController
    • RefreshController changed to required now
    • Add feature:reuqestRefresh can jumpTo Bottom or Top
    • Fix problem: Refresh can still be triggered when ScrollView is nested internally
    • Remove rendered twice to get indicator height,replaced by using height attribute in Config
    • change RefreshStatus from int to enum

    1.3.0

    Total

    • Support reverse ScrollView
    • Remove RefreshConfig,LoadConfig,Move to indicator setting
    • Add isNestWrapped to Compatible NestedScrollView
    • replace headerBuilder,footerBuilder attribute to header,footer
    • Separate header and footer operations:onRefresh and onLoading Callback,RefreshStatus is separated into RefreshStatus.LoadStatus
    • Fix Bug: twice loading (the footer state change before the ui update)

    RefreshController

    • Remove sendBack method,replaced by LoadComplete,RefreshComplete ,RefreshFailed,LoadNoData
    • Separate refresh and load operations
    • Add dispose method for Safety in some situation

    Indicator

    • Use another way to achieve drop-down refresh
    • Add drop-down refresh indicator style(Follow,UnFollow,Behind)
    • Add WaterDropIndicator,CustomIndicator
    • Make Custom Indicator easily

    1.3.1

    • Add onClick CallBack for LoadIndicator
    • Fix enablepullUp or down invalid
    • Fix error Loading after 1.3.0 updated

    1.3.2

    • Fix WaterDropHeader some attributes invalid
    • Fix enablePullUp and enablePullDown Dynamic set
    • implements auto hide FooterView when less than one page,no need to set enablePullUp to false
    • improve safety after disposed

    1.3.3

    • Fixed the request Refresh problem: Sometimes it takes two times to be effective
    • Add child key support
    • Fix Bug:Pull-down triggers need to be pulled down more distances to trigger
    • Add resetNoData to resume footer state to idle

    1.3.5

    • Add hideWhenNotFull bool to disable auto hide footer when data not enough one page
    • Add one new RefreshStyle:Front(just like RefreshIndicator)
    • Fix a bug: When the head overflows the view area, there is no clipping operation
    • Add material header(two indicator for FrontStyle)
    • Remove enableOverScroll

    1.3.6

    • Fix NestedScrollView issue in 1.3.5
    • decrease default triggerDistance from 100.0 to 80.0
    • improve dragging scrolling speed of Front Style
    • Add offset attr in Front Style

    1.3.7

    • Adding an asSlivers constructor can be inserted into slivers as a Sliver
    • Fix FrontStyle cannot support dynamic change enablePullDown
    • Fix FrontStyle cannot enter refresh state when init
    • Optimize indicator internal code to avoid locking widgets
    • Fix iOS click status cannot roll back without ScrollController in child
    • Fix one ignored situation after finish refresh -> completed(not in visual range)

    1.3.8

    • Temporary fix deadly bug: PrimaryScrollController cannot shared by multiple Indicators

    1.3.9

    • Avoid inner inject padding by buildSlivers in child(ListView,GridView)
    • Add initialRefresh in RefreshController(when you need to requestRefresh in initState)
    • Fix exception RefreshBouncingPhysics velocity value
    • Add IndicatorConfiguration for build indicator for subtrees SmartRefresher
    • Add SkipCanRefresh,CompleteDuration attr in header
    • Fix trigger more times loading when no data come in and too fast loadComplete
    • remove center,anchor in CustomScrollView to Compatible with old versions

    1.4.0

    • Fix one serious Bug after 1.3.8 upgrade to 1.3.9:enablePullDown = false throw error

    1.4.1

    • Remove isNestedWrapped(deprecated from 1.3.8)
    • Add headerInsertIndex attr in SmartRefresher
    • Rename IndicatorConfiguration to RefreshConfiguration
    • Move some attr from Indicator to RefreshConfiguration:offset,skipCanRefresh,triggerDistance,autoLoad,hideWhenNotFull
    • Add decoration for classicIndicator(both header and footer)
    • Add Fade effect for WaterDropHeader when dismiss
    • Simplify reverse operation,Add MaterialClassicHeader,WaterDropMaterialHeader reverse feature

    1.4.2

    • Improving hideWhenNotFull judgment mechanism
    • Fix triggerDistance error after 1.4.0-1.4.1

    1.4.3

    • change "child" attr limit type from ScrollView to Widget

    1.4.4

    • Fix Bug:Multiples ScrollPositions shared one ScrollController,when calling controller.requestRefresh cause refresh together( such as keepAlive Widget )
    • When the user Dragging ScrollView(pull up), disable make it change to loading state
    • Add one new LoadStatus:failed(provide click to retry loading)
    • Fix some defaultIcon:noMoreIcon default Invisible

    1.4.5

    • Remake FrontStyle implements principle,Make it close to the first three styles,Fix some small problems also: 1.when tap StatusBar,it will trigger refresh instead of scroll to top 2.It seems odd to set aside 100 heights in front of scrollOffset for FrontStyle 3.When hideWhenNotFull = false, dragging to pull down will cause loading together

    • Remake RefreshPhysics,Simpify code,child support physics setting now.

    • ClassicIndicator default refreshingIcon:in iOS use ActivityIndicator,in Android use CircularProgressIndicator

    1.4.6

    • Add horizontal refresh support
    • Fix 1.4.5 default physics Bug in Android simulation
    • Fix Problem: when enablePullDown or enablePullUp = false,it still can overScroll or underScroll when use ClampingScrollPhysics
    • Add maxOverScrollExtent and maxUnderScrollExtent in RefreshConfiguration

    1.4.7

    new Feature:

    • Add twoLevel refresh feature
    • Add linkHeader to link other place header

    SmartRefresher:

    • Remove headerInsertIndex(only first sliver)
    • Fix ignore padding attr when child is BoxScrollView
    • add enableTwoLevel,onTwoLevel attr

    RefreshConfiguration:

    • add enableScrollWhenTwoLevel,closeTwoLevelDistance for twoLevel setting

    RefreshController:

    • Add refreshToidle, twoLevelComplete new api
    • Add initalRefreshStatus,initalLoadStatus new parameter setting default value

    ClassicalIndicator:

    • remove decoration
    • add outerBuilder replace decoration
    • add other attr for twoLevel

    Bug Fix:

    • Fix clicking footer trigger loading when no more state
    • footer indicator shouldn't hide when state in noMore,failed and not full in one page

    other:

    • Remove asSliver usage in all indicators(no need to use,only support first sliver)
    • make indicator auto fit boxSize,just like SliverToBoxAdapter
    Source code(tar.gz)
    Source code(zip)
  • 1.4.6(Jun 25, 2019)

    • Add horizontal refresh support
    • Fix 1.4.5 default physics Bug in Android simulation
    • Fix Problem: when enablePullDown or enablePullUp = false,it still can overScroll or underScroll when use ClampingScrollPhysics
    • Add maxOverScrollExtent and maxUnderScrollExtent in RefreshConfiguration
    Source code(tar.gz)
    Source code(zip)
  • 1.4.5(Jun 18, 2019)

    • Remake FrontStyle implements principle,Make it close to the first three styles,Fix some small problems also: 1.when tap StatusBar,it will trigger refresh instead of scroll to top 2.It seems odd to set aside 100 heights in front of scrollOffset for FrontStyle 3.When hideWhenNotFull = false, dragging to pull down will cause loading together

    • Remake RefreshPhysics,Simpify code,child support physics setting now.

    • ClassicIndicator default refreshingIcon:in iOS use ActivityIndicator,in Android use CircularProgressIndicator

    Source code(tar.gz)
    Source code(zip)
  • 1.4.4(Jun 11, 2019)

    • Fix Bug:Multiples ScrollPositions shared one ScrollController,when calling controller.requestRefresh cause refresh together( such as keepAlive Widget )
    • When the user Dragging ScrollView(pull up), disable make it change to loading state
    • Add one new LoadStatus:failed(provide click to retry loading)
    • Fix some defaultIcon:noMoreIcon default Invisible
    Source code(tar.gz)
    Source code(zip)
  • 1.4.3(Jun 7, 2019)

  • 1.4.2(Jun 6, 2019)

  • 1.4.1(Jun 4, 2019)

    • Remove isNestedWrapped(deprecated from 1.3.8)
    • Add headerInsertIndex attr in SmartRefresher
    • Rename IndicatorConfiguration to RefreshConfiguration
    • Move some attr from Indicator to RefreshConfiguration:offset,skipCanRefresh,triggerDistance,autoLoad,hideWhenNotFull
    • Add decoration for classicIndicator(both header and footer)
    • Add Fade effect for WaterDropHeader when dismiss
    • Simplify reverse operation,Add MaterialClassicHeader,WaterDropMaterialHeader reverse feature
    Source code(tar.gz)
    Source code(zip)
  • 1.3.9(May 27, 2019)

    • Avoid inner inject padding by buildSlivers in child(ListView,GridView)
    • Add initialRefresh in RefreshController(when you need to requestRefresh in initState)
    • Fix exception RefreshBouncingPhysics velocity value
    • Add IndicatorConfiguration for build indicator for subtrees SmartRefresher
    • Add SkipCanRefresh,CompleteDuration attr in header
    • Fix trigger more times loading when no data come in and too fast loadComplete
    • remove center,anchor in CustomScrollView to Compatible with old versions
    Source code(tar.gz)
    Source code(zip)
  • 1.3.8(May 24, 2019)

  • 1.3.7(May 24, 2019)

    • Adding an asSlivers constructor can be inserted into slivers as a Sliver
    • Fix FrontStyle cannot support dynamic change enablePullDown
    • Fix FrontStyle cannot enter refresh state when init
    • Optimize indicator internal code to avoid locking widgets
    • Fix iOS click status cannot roll back without ScrollController in child
    • Fix one ignored situation after finish refresh -> completed(not in visual range)
    Source code(tar.gz)
    Source code(zip)
  • 1.3.6(May 21, 2019)

    • Fix NestedScrollView issue in 1.3.5
    • decrease default triggerDistance from 100.0 to 80.0
    • improve dragging scrolling speed of Front Style
    • Add offset attr in Front Style
    Source code(tar.gz)
    Source code(zip)
  • 1.3.3(May 11, 2019)

    • Fixed the request Refresh problem: Sometimes it takes two times to be effective
    • Add child key support
    • Fix Bug:Pull-down triggers need to be pulled down more distances to trigger
    • Add resetNoData to resume footer state to idle
    Source code(tar.gz)
    Source code(zip)
Owner
Jpeng
Flutter && Android && NLP && CV
Jpeng
filterList is a flutter package which provide utility to search/filter data from provided dynamic list.

filter_list Plugin FilterList is a flutter package which provide utility to search/filter on the basis of single/multiple selection from provided dyna

Sonu Sharma 156 Dec 24, 2022
Clip your widgets with custom shapes provided.

clippy_flutter Clip your widgets with custom shapes provided. #Arc, #Arrow, #Bevel, #ButtCheek, #Chevron, #Diagonal, #Label, #Message, #Paralellogram,

Figen Güngör 238 Dec 11, 2022
Load and get full control of your Rive files in a Flutter project using this library.

⚠️ Please migrate to the new Rive Flutter runtime. This runtime is for the old Rive (formerly Flare) and will only receive updates for breaking issues

2D, Inc 2.6k Dec 31, 2022
Flutter UI challenge- Parallax scroll effect

Flutter UI Challenge- "Urban Planners" Parallax Scroll About project The application was written based on this great UI concept: https://dribbble.com/

Tomasz Pawlikowski 264 Dec 26, 2022
A nested TabBarView overscroll unites outer TabBarView scroll event

union_tabs A nested TabBarView overscroll event unites outer TabBarView scroll event Getting Started 1.Install dependencies: union_tabs: ^1.0.0+7 2.

wilin 20 Sep 7, 2022
A Flutter widget that easily adds the flipping animation to any widget

flip_card A component that provides a flip card animation. It could be used for hiding and showing details of a product. How to use import 'package:fl

Bruno Jurković 314 Dec 31, 2022
A widget that allow user resize the widget with drag

Flutter-Resizable-Widget A widget that allow user resize the widget with drag Note: this widget uses Getx Example bandicam.2021-11-11.12-34-41-056.mp4

MohammadAminZamani.afshar 22 Dec 13, 2022
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web

Flutter EasyLoading English | 简体中文 Live Preview ?? https://nslog11.github.io/flutter_easyloading Installing Add this to your package's pubspec.yaml fi

nslog11 1k Jan 9, 2023
Flutter's core Dropdown Button widget with steady dropdown menu and many options you can customize to your needs.

Flutter DropdownButton2 Intro Flutter's core Dropdown Button widget with steady dropdown menu and many options you can customize to your needs. Featur

AHMED ELSAYED 125 Jan 4, 2023
A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

HeavenOSK 97 Jan 6, 2023
A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!

sliding_up_panel A draggable Flutter widget that makes implementing a SlidingUpPanel much easier! Based on the Material Design bottom sheet component,

Akshath Jain 1.2k Jan 7, 2023
Circular Reveal Animation as Flutter widget!

Circular Reveal Animation Circular Reveal Animation as Flutter widget! Inspired by Android's ViewAnimationUtils.createCircularReveal(...). Статья с оп

Alexander Zhdanov 48 Aug 15, 2022
A Flutter Package providing Avatar Glow Widget

Avatar Glow This Flutter package provides a Avatar Glow Widget with cool background glowing animation. Live Demo: https://apgapg.github.io/avatar_glow

Ayush P Gupta 250 Dec 22, 2022
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.

Motion Tab Bar A beautiful animated widget for your Flutter apps Preview: | | Getting Started Add the plugin: dependencies: motion_tab_bar: ^0.1.5 B

Rezaul Islam 237 Nov 15, 2022
Highly customizable, feature-packed calendar widget for Flutter

TableCalendar Highly customizable, feature-packed calendar widget for Flutter. TableCalendar with custom styles TableCalendar with custom builders Fea

Aleksander Woźniak 1.5k Jan 7, 2023
Flutter 3D Flip Animation Widget

flutter_flip_view This is a flutter Widget base on pure Dart code that provides 3D flip card visuals. Usage add package in your pubspec.yaml dependenc

WosLovesLife 57 Dec 30, 2022
A simple toggle switch widget for Flutter.

Toggle Switch A simple toggle switch widget. It can be fully customized with desired icons, width, colors, text, corner radius, animation etc. It also

Pramod Joshi 84 Nov 20, 2022
Base Flutter widget which triggers rebuild only of props changed

pure_widget Base widget which triggers rebuild only if props changed Installation pubspec.yaml: dependencies: pure_widget: ^1.0.0 Example import 'da

Andrei Lesnitsky 9 Dec 12, 2022
A Stepper Widget in Flutter using GetX

Stepper Flutter GetX Donate If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a

Ripples Code 0 Nov 27, 2021