CupertinoSliverRefreshControl constructor

const CupertinoSliverRefreshControl({
  1. Key? key,
  2. double refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
  3. double refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
  4. RefreshControlIndicatorBuilder? builder = buildRefreshIndicator,
  5. 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.',
      );