didChangeAppLifecycleState method
Handles app lifecycle state changes.
state - The new AppLifecycleState.
Implementation
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.resumed) {
_listenShake();
} else {
_cancelShake();
}
}