CustomRefreshIndicator constructor
CustomRefreshIndicator({
- Key? key,
- required Widget child,
- required AsyncCallback onRefresh,
- required IndicatorBuilder builder,
- IndicatorController? controller,
- IndicatorTrigger trigger = IndicatorTrigger.leadingEdge,
- IndicatorTriggerMode triggerMode = IndicatorTriggerMode.onEdge,
- ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
- bool autoRebuild = true,
- double? offsetToArmed,
- OnStateChanged? onStateChanged,
- double? containerExtentPercentageToArmed,
- @Deprecated('In favor of durations parameter') Duration? indicatorCancelDuration = const Duration(milliseconds: 300),
- @Deprecated('In favor of durations parameter') Duration? indicatorSettleDuration = const Duration(milliseconds: 150),
- @Deprecated('In favor of durations parameter') Duration? indicatorFinalizeDuration = const Duration(milliseconds: 100),
- @Deprecated('In favor of durations parameter') Duration? completeStateDuration,
- bool leadingScrollIndicatorVisible = false,
- bool trailingScrollIndicatorVisible = true,
- RefreshIndicatorDurations durations = const RefreshIndicatorDurations(),
Implementation
CustomRefreshIndicator({
super.key,
required this.child,
required this.onRefresh,
required this.builder,
this.controller,
this.trigger = IndicatorTrigger.leadingEdge,
this.triggerMode = IndicatorTriggerMode.onEdge,
this.notificationPredicate = defaultScrollNotificationPredicate,
this.autoRebuild = true,
this.offsetToArmed,
this.onStateChanged,
double? containerExtentPercentageToArmed,
@Deprecated('In favor of durations parameter')
Duration? indicatorCancelDuration = const Duration(milliseconds: 300),
@Deprecated('In favor of durations parameter')
Duration? indicatorSettleDuration = const Duration(milliseconds: 150),
@Deprecated('In favor of durations parameter')
Duration? indicatorFinalizeDuration = const Duration(milliseconds: 100),
@Deprecated('In favor of durations parameter') Duration? completeStateDuration,
this.leadingScrollIndicatorVisible = false,
this.trailingScrollIndicatorVisible = true,
RefreshIndicatorDurations durations = const RefreshIndicatorDurations(),
}) : assert(
containerExtentPercentageToArmed == null || offsetToArmed == null,
'Providing `extentPercentageToArmed` argument take no effect when `offsetToArmed` is provided. '
'Remove redundant argument.',
),
durations = RefreshIndicatorDurations(
cancelDuration: indicatorCancelDuration ?? durations.cancelDuration,
completeDuration: completeStateDuration ?? durations.completeDuration,
finalizeDuration: indicatorFinalizeDuration ?? durations.finalizeDuration,
settleDuration: indicatorSettleDuration ?? durations.settleDuration,
),
// set the default extent percentage value if not provided
containerExtentPercentageToArmed = containerExtentPercentageToArmed ?? defaultContainerExtentPercentageToArmed;