didChangeAppLifecycleState method
Called when the system puts the app in the background or returns the app to the foreground.
Implementation
void didChangeAppLifecycleState(AppLifecycleState state) {
/// Passing these possible values:
/// AppLifecycleState.detached
/// AppLifecycleState.resumed
/// AppLifecycleState.inactive (may be paused at any time)
/// AppLifecycleState.hidden
/// AppLifecycleState.paused (may enter the suspending state at any time)
}