TopAppWidget constructor

const TopAppWidget({
  1. Key? key,
  2. void didChangeAppLifecycleState(
    1. AppLifecycleState state
    )?,
  3. InjectedTheme? injectedTheme,
  4. InjectedI18N? injectedI18N,
  5. Widget onWaiting()?,
  6. List<Future> ensureInitialization()?,
  7. List<Future> waiteFor()?,
  8. Widget onError(
    1. dynamic error,
    2. void refresh()
    )?,
  9. InjectedAuth? injectedAuth,
  10. required Widget builder(
    1. BuildContext
    ),
})

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);