RefreshConfiguration constructor
const
RefreshConfiguration({
- Key? key,
- required Widget child,
- IndicatorBuilder? headerBuilder,
- double dragSpeedRatio = 1.0,
- bool enableLoadingWhenNoData = false,
- bool enableSmartPreload = true,
- bool enableBallisticRefresh = false,
- SpringDescription springDescription = const SpringDescription(mass: 1.0, stiffness: 364.72, damping: 35.2),
- bool enableScrollWhenRefreshCompleted = false,
- bool enableLoadingWhenFailed = true,
- double twiceTriggerDistance = 150.0,
- bool skipCanRefresh = false,
- double? maxOverScrollExtent,
- bool enableBallisticLoad = true,
- double? maxUnderScrollExtent,
- double headerTriggerDistance = 80.0,
- bool enableRefreshVibrate = false,
- bool enableLoadMoreVibrate = false,
- double? topHitBoundary,
- double? bottomHitBoundary,
创建刷新配置
必填参数:
child:子组件树
常用参数:
headerBuilder:全局默认 header 构建器footerBuilder:全局默认 footer 构建器headerTriggerDistance:触发刷新的距离,默认为 80.0enableSmartPreload:是否启用智能预加载,默认为 truefooterTriggerDistance:触发加载的距离,默认为 15.0springDescription:弹簧动画配置enableScrollWhenRefreshCompleted:刷新完成回弹时是否允许滚动
Implementation
const RefreshConfiguration(
{super.key,
required this.child,
this.headerBuilder,
this.footerBuilder,
this.dragSpeedRatio = 1.0,
this.shouldFooterFollowWhenNotFull,
this.enableLoadingWhenNoData = false,
this.enableSmartPreload = true,
this.enableBallisticRefresh = false,
this.springDescription = const SpringDescription(
mass: 1.0,
stiffness: 364.72,
damping: 35.2,
),
this.enableScrollWhenRefreshCompleted = false,
this.enableLoadingWhenFailed = true,
this.twiceTriggerDistance = 150.0,
this.skipCanRefresh = false,
this.maxOverScrollExtent,
this.enableBallisticLoad = true,
this.maxUnderScrollExtent,
this.headerTriggerDistance = 80.0,
this.footerTriggerDistance = 15.0,
this.hideFooterWhenNotFull = false,
this.enableRefreshVibrate = false,
this.enableLoadMoreVibrate = false,
this.topHitBoundary,
this.bottomHitBoundary})
: assert(headerTriggerDistance > 0),
assert(twiceTriggerDistance > 0),
assert(dragSpeedRatio > 0),
super(child: child);