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. OnTwoLevel? onTwoLevel,
  12. DragStartBehavior? dragStartBehavior,
  13. bool? primary,
  14. double? cacheExtent,
  15. int? semanticChildCount,
  16. bool? reverse,
  17. ScrollPhysics? physics,
  18. Axis? scrollDirection,
  19. 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.dragStartBehavior,
    this.primary,
    this.cacheExtent,
    this.semanticChildCount,
    this.reverse,
    this.physics,
    this.scrollDirection,
    this.scrollController})
    : builder = null,
      super(key: key);