CustomRefreshIndicator constructor

const CustomRefreshIndicator({
  1. Key? key,
  2. required Widget child,
  3. required Widget loaderWidget,
  4. double displacement = 40.0,
  5. double edgeOffset = 0.0,
  6. required RefreshCallback onRefresh,
  7. Color? color,
  8. Color? backgroundColor,
  9. ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
  10. String? semanticsLabel,
  11. String? semanticsValue,
  12. double strokeWidth = RefreshProgressIndicator.defaultStrokeWidth,
  13. RefreshIndicatorTriggerMode triggerMode = RefreshIndicatorTriggerMode.onEdge,
})

Creates a refresh indicator.

The onRefresh, child, and notificationPredicate arguments must be non-null. The default displacement is 40.0 logical pixels.

The semanticsLabel is used to specify an accessibility label for this widget. If it is null, it will be defaulted to MaterialLocalizations.refreshIndicatorSemanticLabel. An empty string may be passed to avoid having anything read by screen reading software. The semanticsValue may be used to specify progress on the widget.

Implementation

const CustomRefreshIndicator({
  Key? key,
  required this.child,
  required this.loaderWidget,
  this.displacement = 40.0,
  this.edgeOffset = 0.0,
  required this.onRefresh,
  this.color,
  this.backgroundColor,
  this.notificationPredicate = defaultScrollNotificationPredicate,
  this.semanticsLabel,
  this.semanticsValue,
  this.strokeWidth = RefreshProgressIndicator.defaultStrokeWidth,
  this.triggerMode = RefreshIndicatorTriggerMode.onEdge,
})  : assert(child != null),
      assert(onRefresh != null),
      assert(notificationPredicate != null),
      assert(strokeWidth != null),
      assert(triggerMode != null),
      super(key: key);