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 be greater than or equal to 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.


const CupertinoSliverRefreshControl({
  this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
  this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
  this.builder = buildRefreshIndicator,
}) : assert(refreshTriggerPullDistance > 0.0),
     assert(refreshIndicatorExtent >= 0.0),
       refreshTriggerPullDistance >= refreshIndicatorExtent,
       'The refresh indicator cannot take more space in its final state '
       'than the amount initially created by overscrolling.',