CupertinoSliverSwipeRefresh constructor

CupertinoSliverSwipeRefresh({
  1. double refreshTriggerPullDistance = 100.0,
  2. double refreshIndicatorExtent = 60.0,
  3. RefreshControlIndicatorBuilder? builder,
  4. bool? enabled,
  5. Color? backgroundColor,
  6. SwipeRefreshCallback? onRefresh,
  7. Key? key,
})

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

CupertinoSliverSwipeRefresh({
  this.refreshTriggerPullDistance = 100.0,
  this.refreshIndicatorExtent = 60.0,
  RefreshControlIndicatorBuilder? builder,
  bool? enabled,
  Color? backgroundColor,
  this.onRefresh,
  Key? key,
})  : _key = key,
      builder = builder ??
          ((
            context,
            refreshState,
            pulledExtent,
            refreshTriggerPullDistance,
            refreshIndicatorExtent,
          ) =>
              buildRefreshIndicator(
                context,
                refreshState,
                pulledExtent,
                refreshTriggerPullDistance,
                refreshIndicatorExtent,
                enabled ?? onRefresh != null,
                backgroundColor,
              )),
      super(key: null);