SmartRefresher constructor

SmartRefresher(
  1. {Key key,
  2. @required RefreshController controller,
  3. Widget child,
  4. Widget header,
  5. Widget footer,
  6. bool enablePullDown = true,
  7. bool enablePullUp = false,
  8. bool enableTwoLevel = false,
  9. VoidCallback onRefresh,
  10. VoidCallback onLoading,
  11. VoidCallback onTwoLevel,
  12. OnOffsetChange onOffsetChange,
  13. DragStartBehavior dragStartBehavior,
  14. bool primary,
  15. double cacheExtent,
  16. int semanticChildCount,
  17. bool reverse,
  18. ScrollPhysics physics,
  19. Axis scrollDirection,
  20. ScrollController scrollController}
)

creates a widget help attach the refresh and load more function controller must not be null, child is your refresh content,Note that there's a big difference between children inheriting from ScrollView or not. If child is extends ScrollView,inner will get the slivers from ScrollView,if not,inner will wrap child into SliverToBoxAdapter. If your child inner container Scrollable,please consider about converting to Sliver,and use CustomScrollView,or use builder constructor such as AnimatedList,RecordableList,doesn't allow to put into child,it will wrap it into SliverToBoxAdapter If you don't need pull down refresh ,just enablePullDown = false, If you need pull up load ,just enablePullUp = true

Implementation

SmartRefresher(
    {Key key,
    @required this.controller,
    this.child,
    this.header,
    this.footer,
    this.enablePullDown: true,
    this.enablePullUp: false,
    this.enableTwoLevel: false,
    this.onRefresh,
    this.onLoading,
    this.onTwoLevel,
    this.onOffsetChange,
    this.dragStartBehavior,
    this.primary,
    this.cacheExtent,
    this.semanticChildCount,
    this.reverse,
    this.physics,
    this.scrollDirection,
    this.scrollController})
    : assert(controller != null),
      builder = null,
      super(key: key);