[Flutter] AppLifecycleState
The observable lifecycle events are:
inactive
— The application is in an inactive state and is not receiving user input. This event only works on iOS, as there is no equivalent event to map to on Androidpaused
— The application is not currently visible to the user, not responding to user input, and running in the background. This is equivalent toonPause()
in Androidresumed
— The application is visible and responding to user input. This is equivalent toonPostResume()
in Androidsuspending
— The application is suspended momentarily. This is equivalent toonStop
in Android; it is not triggered on iOS as there is no equivalent event to map to on iOS
如果我們想監聽App級別的生命週期需要使用WidgetsBinding來監聽WidgetsBindingObserver.
Example:
Last updated