CupertinoSliverRefreshControl constructor
const
CupertinoSliverRefreshControl({
- Key? key,
- double refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
- double refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
- RefreshControlIndicatorBuilder? builder = buildRefreshIndicator,
- RefreshCallback? onRefresh,
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 CupertinoSliverRefreshControl({
super.key,
this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
this.builder = buildRefreshIndicator,
this.onRefresh,
}) : assert(refreshTriggerPullDistance != null),
assert(refreshTriggerPullDistance > 0.0),
assert(refreshIndicatorExtent != null),
assert(refreshIndicatorExtent >= 0.0),
assert(
refreshTriggerPullDistance >= refreshIndicatorExtent,
'The refresh indicator cannot take more space in its final state '
'than the amount initially created by overscrolling.',
);