RefreshIndicator constructor Null safety

const RefreshIndicator(
  1. {Key? key,
  2. required Widget child,
  3. double displacement,
  4. double edgeOffset,
  5. required RefreshCallback onRefresh,
  6. Color? color,
  7. Color? backgroundColor,
  8. ScrollNotificationPredicate notificationPredicate,
  9. String? semanticsLabel,
  10. String? semanticsValue,
  11. double strokeWidth,
  12. RefreshIndicatorTriggerMode triggerMode}

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.


const RefreshIndicator({
  Key? key,
  required this.child,
  this.displacement = 40.0,
  this.edgeOffset = 0.0,
  required this.onRefresh,
  this.notificationPredicate = defaultScrollNotificationPredicate,
  this.strokeWidth = 2.0,
  this.triggerMode = RefreshIndicatorTriggerMode.onEdge,
}) : assert(child != null),
     assert(onRefresh != null),
     assert(notificationPredicate != null),
     assert(strokeWidth != null),
     assert(triggerMode != null),
     super(key: key);