RefreshIndicator constructor

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

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 RefreshIndicator({
  super.key,
  required this.child,
  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,
  this.elevation = 2.0,
})  : _indicatorType = _IndicatorType.material,
      onStatusChange = null,
      assert(elevation >= 0.0);