TopAppWidget constructor
const
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(),
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.
Implementation
const TopAppWidget({
Key? key,
this.didChangeAppLifecycleState,
this.injectedTheme,
this.injectedI18N,
this.onWaiting,
this.ensureInitialization,
this.waiteFor,
this.onError,
this.injectedAuth,
required this.builder,
}) : assert(
ensureInitialization == null || onWaiting != null,
'You have to define a waiting splash screen '
'using onWaiting parameter',
),
super(key: key);