TopAppWidget class
Widget to put on top of the app.
It disposes all non auto disposed injected model when the app closes.
Useful also to dispose resources and reset injected states for test.
It is also use to provide and listen to InjectedTheme, InjectedI18N
It can also be used to display a splash screen while initialization plugins.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TopAppWidget
Constructors
-
TopAppWidget({Key? key, void didChangeAppLifecycleState(AppLifecycleState state)?, InjectedTheme? injectedTheme, InjectedI18N? injectedI18N, Widget onWaiting()?, List<
Future> ensureInitialization()?, List<Future> waiteFor()?, Widget onError(dynamic error, void refresh())?, InjectedAuth? injectedAuth, required Widget builder(BuildContext)}) -
Widget to put on top of the app.
const
Properties
- builder → Widget Function(BuildContext)
-
Child widget to render
final
- didChangeAppLifecycleState → (void Function(AppLifecycleState state)?)
-
Called when the system puts the app in the background or returns the app to the foreground.
final -
ensureInitialization
→ (List<
Future> Function()?) -
List of future (plugins initialization) to wait for, and display a waiting screen while waiting
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- injectedAuth → InjectedAuth?
-
final
- injectedI18N → InjectedI18N?
-
Provide and listen to the InjectedI18N.
Example:
final
- injectedTheme → InjectedTheme?
-
Provide and listen to the InjectedTheme.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onError → (Widget Function(dynamic error, void refresh())?)
-
final
- onWaiting → (Widget Function()?)
-
Widget (Splash Screen) to display while it is waiting for dependencies to
initialize.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
waiteFor
→ (List<
Future> Function()?) -
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _TopAppWidgetState -
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