DefaultLoadingOverlay class

The default indicator drawn over content that is still on screen: a dimmed scrim with a centred progress indicator, both staged so short loads stay quiet.

Nothing is drawn for the first scrimDelay. Then the scrim fades in over scrimFadeDuration. The progress indicator only appears after indicatorDelay, fading in over indicatorFadeDuration. A load that finishes within a couple of frames therefore shows no dimming and no spinner at all, one that takes a few hundred milliseconds shows a gentle dim, and only a genuinely slow one shows the spinner.

Used over a route snapshot while the destination view model initialises, and by ViewModelWidget.buildLoadingOverlay when a view model calls loading(style: LoadingIndicatorStyle.overlay). Replace or tune it with NavigationLogic.defaultLoadingOverlay; keep a replacement translucent so the content underneath shows through.

Inheritance

Constructors

DefaultLoadingOverlay({Key? key, Duration scrimDelay = const Duration(milliseconds: 100), Duration scrimFadeDuration = const Duration(milliseconds: 300), double scrimOpacity = 0.32, Duration indicatorDelay = const Duration(milliseconds: 800), Duration indicatorFadeDuration = const Duration(milliseconds: 250), Widget indicator = const Center(child: CircularProgressIndicator())})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
indicator Widget
The progress indicator shown after indicatorDelay.
final
indicatorDelay Duration
How long to wait before the indicator starts fading in. Loads that finish inside this window never show a spinner.
final
indicatorFadeDuration Duration
How long the indicator takes to fade in.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrimDelay Duration
How long to wait before the scrim starts fading in. Loads that finish inside this window show no dimming at all.
final
scrimFadeDuration Duration
How long the scrim takes to fade in.
final
scrimOpacity double
Opacity of the scrim colour (ColorScheme.scrim) once fully faded in.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<DefaultLoadingOverlay>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited