EasyRefreshSliverLoadControl constructor

const EasyRefreshSliverLoadControl({
  1. Key? key,
  2. double loadTriggerPullDistance = _defaultLoadTriggerPullDistance,
  3. double loadIndicatorExtent = _defaultLoadIndicatorExtent,
  4. required LoadControlBuilder builder,
  5. Duration? completeDuration,
  6. OnLoadCallback? onLoad,
  7. required ValueNotifier<bool> focusNotifier,
  8. required ValueNotifier<TaskState> taskNotifier,
  9. required ValueNotifier<bool> callLoadNotifier,
  10. required bool taskIndependence,
  11. required ValueNotifier<double> extraExtentNotifier,
  12. required BindLoadIndicator bindLoadIndicator,
  13. bool enableControlFinishLoad = false,
  14. bool enableInfiniteLoad = true,
  15. bool enableHapticFeedback = false,
  16. bool footerFloat = false,
  17. bool safeArea = false,
  18. EdgeInsets? padding,
})

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

The loadTriggerPullDistance and loadIndicatorExtent 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 onLoad will still be invoked. By default, builder shows a CupertinoActivityIndicator.

The onLoad argument will be called when pulled far enough to trigger a refresh.

Implementation

const EasyRefreshSliverLoadControl({
  Key? key,
  this.loadTriggerPullDistance = _defaultLoadTriggerPullDistance,
  this.loadIndicatorExtent = _defaultLoadIndicatorExtent,
  required this.builder,
  this.completeDuration,
  this.onLoad,
  required this.focusNotifier,
  required this.taskNotifier,
  required this.callLoadNotifier,
  required this.taskIndependence,
  required this.extraExtentNotifier,
  required this.bindLoadIndicator,
  this.enableControlFinishLoad = false,
  this.enableInfiniteLoad = true,
  this.enableHapticFeedback = false,
  this.footerFloat = false,
  this.safeArea = false,
  this.padding,
})  : assert(loadTriggerPullDistance > 0.0),
      assert(loadIndicatorExtent >= 0.0),
      assert(
          loadTriggerPullDistance >= loadIndicatorExtent,
          'The refresh indicator cannot take more space in its final state '
          'than the amount initially created by overscrolling.'),
      super(key: key);