didChangeAppLifecycleState method
Override from WidgetsBindingObserver to handle app lifecycle
Implementation
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (_disposed) return;
switch (state) {
case AppLifecycleState.resumed:
onResume();
break;
case AppLifecycleState.paused:
onPause();
break;
case AppLifecycleState.inactive:
onInactive();
break;
case AppLifecycleState.detached:
onDetached();
break;
case AppLifecycleState.hidden:
onHidden();
break;
}
}