AppLifecycleListener constructor
- WidgetsBinding? binding,
- VoidCallback? onResume,
- VoidCallback? onInactive,
- VoidCallback? onHide,
- VoidCallback? onShow,
- VoidCallback? onPause,
- VoidCallback? onRestart,
- VoidCallback? onDetach,
- AppExitRequestCallback? onExitRequested,
- ValueChanged<
AppLifecycleState> ? onStateChange,
Creates an AppLifecycleListener.
Implementation
AppLifecycleListener({
WidgetsBinding? binding,
this.onResume,
this.onInactive,
this.onHide,
this.onShow,
this.onPause,
this.onRestart,
this.onDetach,
this.onExitRequested,
this.onStateChange,
}) : binding = binding ?? WidgetsBinding.instance,
_lifecycleState = (binding ?? WidgetsBinding.instance).lifecycleState {
assert(debugMaybeDispatchCreated('widgets', 'AppLifecycleListener', this));
this.binding.addObserver(this);
}