EasyRefreshSliverRefreshControl constructor
const
EasyRefreshSliverRefreshControl({
- Key? key,
- double refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
- double refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
- required RefreshControlBuilder builder,
- Duration? completeDuration,
- OnRefreshCallback? onRefresh,
- required ValueNotifier<
bool> focusNotifier, - required ValueNotifier<
TaskState> taskNotifier, - required ValueNotifier<
bool> callRefreshNotifier, - required bool taskIndependence,
- required BindRefreshIndicator bindRefreshIndicator,
- bool enableControlFinishRefresh = false,
- bool enableInfiniteRefresh = false,
- bool enableHapticFeedback = false,
- bool headerFloat = false,
Create a new refresh control for inserting into a list of slivers.
The refreshTriggerPullDistance
and refreshIndicatorExtent
arguments
must not be null and must be >= 0.
The builder
argument may be null, in which case no indicator UI will be
shown but the onRefresh
will still be invoked. By default, builder
shows a CupertinoActivityIndicator.
The onRefresh
argument will be called when pulled far enough to trigger
a refresh.
Implementation
const EasyRefreshSliverRefreshControl({
Key? key,
this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
required this.builder,
this.completeDuration,
this.onRefresh,
required this.focusNotifier,
required this.taskNotifier,
required this.callRefreshNotifier,
required this.taskIndependence,
required this.bindRefreshIndicator,
this.enableControlFinishRefresh = false,
this.enableInfiniteRefresh = false,
this.enableHapticFeedback = false,
this.headerFloat = false,
}) : assert(refreshTriggerPullDistance > 0.0),
assert(refreshIndicatorExtent >= 0.0),
assert(
headerFloat || refreshTriggerPullDistance >= refreshIndicatorExtent,
'The refresh indicator cannot take more space in its final state '
'than the amount initially created by overscrolling.'),
super(key: key);