SmartRefresher constructor
SmartRefresher({
- Key? key,
- required RefreshController controller,
- Widget? child,
- Widget? header,
- bool enablePullDown = true,
- bool enablePullUp = false,
- bool enableTwoLevel = false,
- VoidCallback? onRefresh,
- VoidCallback? onLoading,
- OnTwoLevel? onTwoLevel,
- DragStartBehavior? dragStartBehavior,
- bool? primary,
- double? cacheExtent,
- int? semanticChildCount,
- bool? reverse,
- ScrollPhysics? physics,
- Axis? scrollDirection,
- 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);