DelayedHud3<T1, T2, T3> class
In the following example, we will use a ChangeNotificationProvider to trigger showing the HUD. It is also using a delayed start. When one of the providers change values, the callback showHud will be called and the providers will be passed to this function. You can then check its value to determine if you need to show the HUD.
DelayedHud1<TestViewModel>(
hud: hud,
child: Text('DelayedHud1<TestViewModel, AnotherViewModel, YetAnotherViewModel>'),
delayedStart: delay,
showHud: (viewModel1, viewModel2, viewModel3) {
return viewModel.isBusy || viewModel2.isSaving || viewModel3.isProcessing;
},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DelayedHud3
Constructors
Properties
- child → Widget
-
Widget that will be rendered by the HUD.
Ideally this widget is a scaffold so when the HUD is rendered it covers the entire screen.
final
- color → Color?
-
This is the color used to cover the screen in between the child and the HUD control.
If you don't specify this value, a translucent black color will be used.
final
- delayedStart → Duration?
-
Duration that the HUD will wait before you show it.
If null, it starts automatically. Ideally, consider a duration of 250ms.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hud → Widget?
-
Widget that is rendered when a HUD needs to be displayed.
Typically this would be a CircularProgressIndicator()
final
- hudWidget → (Widget Function(T1 value1, T2 value2, T3? value3)?)
-
This is an alternative to the hud attribute.
This is a callback that lets you generate a Widget using the various providers used.
This gives you additional context in case the HUD is context aware.
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
- showHud → bool Function(T1 value1, T2 value2, T3 value3)
-
Return true and the HUD widget will be shown or if there is a delayedStart defined then the timer will start.
The timer will trigger showing the HUD widget. Use the value of the provider to determine if you should show the HUD or not.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _DelayedHudState3 -
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}) → 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