RefreshIndicator constructor Null safety
- {Key? key,
- required Widget child,
- double displacement = 40.0,
- double edgeOffset = 0.0,
- required RefreshCallback onRefresh,
- Color? color,
- Color? backgroundColor,
- ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
- String? semanticsLabel,
- String? semanticsValue,
- double strokeWidth = RefreshProgressIndicator.defaultStrokeWidth,
- 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 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,
}) : assert(child != null),
assert(onRefresh != null),
assert(notificationPredicate != null),
assert(strokeWidth != null),
assert(triggerMode != null);