CupertinoSliverRefreshControl constructor

const CupertinoSliverRefreshControl({Key key, double refreshTriggerPullDistance: _defaultRefreshTriggerPullDistance, double refreshIndicatorExtent: _defaultRefreshIndicatorExtent, RefreshControlIndicatorBuilder builder: buildSimpleRefreshIndicator, RefreshCallback onRefresh })

Create a new refresh control for inserting into a list of slivers.

The refreshTriggerPullDistance and refreshIndicatorExtent arguments must not be null.

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({
  Key key,
  this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
  this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
  this.builder = buildSimpleRefreshIndicator,
  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.'
     ),
     super(key: key);