RefreshConfiguration.copyAncestor constructor
RefreshConfiguration.copyAncestor({
- Key? key,
- required BuildContext context,
- required Widget child,
- IndicatorBuilder? headerBuilder,
- double? dragSpeedRatio,
- bool? enableBallisticRefresh,
- bool? enableBallisticLoad,
- bool? enableLoadingWhenNoData,
- bool? enableSmartPreload,
- SpringDescription? springDescription,
- bool? enableScrollWhenRefreshCompleted,
- bool? enableLoadingWhenFailed,
- double? twiceTriggerDistance,
- bool? skipCanRefresh,
- double? maxOverScrollExtent,
- double? maxUnderScrollExtent,
- double? topHitBoundary,
- double? bottomHitBoundary,
- double? headerTriggerDistance,
- bool? enableRefreshVibrate,
- bool? enableLoadMoreVibrate,
复制祖先节点的 RefreshConfiguration,并可选择性覆盖部分属性
如果参数为 null,将自动继承祖先 RefreshConfiguration 的属性,无需手动复制
适用场景:
- 应用中某个 SmartRefresher 需要与其他组件不同的配置
- 局部覆盖全局配置
必填参数:
context:构建上下文,用于查找祖先配置child:子组件树
Implementation
RefreshConfiguration.copyAncestor({
super.key,
required BuildContext context,
required this.child,
IndicatorBuilder? headerBuilder,
IndicatorBuilder? footerBuilder,
double? dragSpeedRatio,
ShouldFollowContent? shouldFooterFollowWhenNotFull,
bool? enableBallisticRefresh,
bool? enableBallisticLoad,
bool? enableLoadingWhenNoData,
bool? enableSmartPreload,
SpringDescription? springDescription,
bool? enableScrollWhenRefreshCompleted,
bool? enableLoadingWhenFailed,
double? twiceTriggerDistance,
bool? skipCanRefresh,
double? maxOverScrollExtent,
double? maxUnderScrollExtent,
double? topHitBoundary,
double? bottomHitBoundary,
double? headerTriggerDistance,
double? footerTriggerDistance,
bool? enableRefreshVibrate,
bool? enableLoadMoreVibrate,
bool? hideFooterWhenNotFull,
}) : assert(RefreshConfiguration.of(context) != null,
"search RefreshConfiguration anscestor return null,please Make sure that RefreshConfiguration is the ancestor of that element"),
headerBuilder = headerBuilder ?? RefreshConfiguration.of(context)!.headerBuilder,
footerBuilder = footerBuilder ?? RefreshConfiguration.of(context)!.footerBuilder,
dragSpeedRatio = dragSpeedRatio ?? RefreshConfiguration.of(context)!.dragSpeedRatio,
twiceTriggerDistance = twiceTriggerDistance ?? RefreshConfiguration.of(context)!.twiceTriggerDistance,
headerTriggerDistance = headerTriggerDistance ?? RefreshConfiguration.of(context)!.headerTriggerDistance,
footerTriggerDistance = footerTriggerDistance ?? RefreshConfiguration.of(context)!.footerTriggerDistance,
springDescription = springDescription ?? RefreshConfiguration.of(context)!.springDescription,
hideFooterWhenNotFull = hideFooterWhenNotFull ?? RefreshConfiguration.of(context)!.hideFooterWhenNotFull,
maxOverScrollExtent = maxOverScrollExtent ?? RefreshConfiguration.of(context)!.maxOverScrollExtent,
maxUnderScrollExtent = maxUnderScrollExtent ?? RefreshConfiguration.of(context)!.maxUnderScrollExtent,
topHitBoundary = topHitBoundary ?? RefreshConfiguration.of(context)!.topHitBoundary,
bottomHitBoundary = bottomHitBoundary ?? RefreshConfiguration.of(context)!.bottomHitBoundary,
skipCanRefresh = skipCanRefresh ?? RefreshConfiguration.of(context)!.skipCanRefresh,
enableScrollWhenRefreshCompleted =
enableScrollWhenRefreshCompleted ?? RefreshConfiguration.of(context)!.enableScrollWhenRefreshCompleted,
enableBallisticRefresh = enableBallisticRefresh ?? RefreshConfiguration.of(context)!.enableBallisticRefresh,
enableBallisticLoad = enableBallisticLoad ?? RefreshConfiguration.of(context)!.enableBallisticLoad,
enableLoadingWhenNoData = enableLoadingWhenNoData ?? RefreshConfiguration.of(context)!.enableLoadingWhenNoData,
enableSmartPreload = enableSmartPreload ?? RefreshConfiguration.of(context)!.enableSmartPreload,
enableLoadingWhenFailed = enableLoadingWhenFailed ?? RefreshConfiguration.of(context)!.enableLoadingWhenFailed,
enableRefreshVibrate = enableRefreshVibrate ?? RefreshConfiguration.of(context)!.enableRefreshVibrate,
enableLoadMoreVibrate = enableLoadMoreVibrate ?? RefreshConfiguration.of(context)!.enableLoadMoreVibrate,
shouldFooterFollowWhenNotFull =
shouldFooterFollowWhenNotFull ?? RefreshConfiguration.of(context)!.shouldFooterFollowWhenNotFull,
super(child: child);