didChangeAppLifecycleState method
Called when the system puts the app in the background or returns the app to the foreground.
Implementation
// To override WidgetsBindingObserver.didChangeAppLifecycleState()
void didChangeAppLifecycleState(AppLifecycleState state) {
/// Passing these possible values:
/// AppLifecycleState.inactive (may be paused at any time)
/// AppLifecycleState.hidden
/// AppLifecycleState.paused (may enter the suspending state at any time)
/// AppLifecycleState.resumed
/// AppLifecycleState.detached
// Record the triggered event
assert(() {
if (_debugPrintEvents) {
debugPrint(
'$_consoleLeadingLine didChangeAppLifecycleState($state) in $_consoleClassName');
}
return true;
}());
}