EasyRefreshSliverRefreshControl constructor

const EasyRefreshSliverRefreshControl({
  1. Key? key,
  2. double refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
  3. double refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
  4. required RefreshControlBuilder builder,
  5. Duration? completeDuration,
  6. OnRefreshCallback? onRefresh,
  7. required ValueNotifier<bool> focusNotifier,
  8. required ValueNotifier<TaskState> taskNotifier,
  9. required ValueNotifier<bool> callRefreshNotifier,
  10. required bool taskIndependence,
  11. required BindRefreshIndicator bindRefreshIndicator,
  12. bool enableControlFinishRefresh = false,
  13. bool enableInfiniteRefresh = false,
  14. bool enableHapticFeedback = false,
  15. bool headerFloat = false,
})

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 EasyRefreshSliverRefreshControl({
  Key? key,
  this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
  this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
  required this.builder,
  this.completeDuration,
  this.onRefresh,
  required this.focusNotifier,
  required this.taskNotifier,
  required this.callRefreshNotifier,
  required this.taskIndependence,
  required this.bindRefreshIndicator,
  this.enableControlFinishRefresh = false,
  this.enableInfiniteRefresh = false,
  this.enableHapticFeedback = false,
  this.headerFloat = false,
})  : assert(refreshTriggerPullDistance > 0.0),
      assert(refreshIndicatorExtent >= 0.0),
      assert(
          headerFloat || refreshTriggerPullDistance >= refreshIndicatorExtent,
          'The refresh indicator cannot take more space in its final state '
          'than the amount initially created by overscrolling.'),
      super(key: key);