pub enum AppLifecycleState {
Detached,
Resumed,
Inactive,
Hidden,
Paused,
}Expand description
States that an application can be in once it is running.
States not supported on a platform are synthesized so the state machine stays the same
everywhere. For example, Hidden is synthesized on mobile
before Paused when coming from
Inactive, and before Inactive
when coming from Paused.
The values below are listed in the expected state machine transition order. The initial
state is Detached.
Flutter counterpart: AppLifecycleState (dart:ui platform_dispatcher.dart).
Variants§
Detached
The application is still hosted by a Flutter engine but is detached from any host views.
The application defaults to this state before it initializes, and can be in this state (applicable on Android, iOS, and web) after all views have been detached.
When the application is in this state, the engine is running without a view.
This state is only entered on iOS, Android, and web, although on all platforms it is the default state before the application begins running.
Resumed
On all platforms, this state indicates that the application is in the default running mode for a running application that has input focus and is visible.
On Android, this state corresponds to the Flutter host view having focus while in
Android’s “resumed” state. It is possible for the Flutter app to be in the
Inactive state while still being in Android’s
“onResume” state if the app has lost focus but hasn’t had Activity.onPause called
on it.
On iOS and macOS, this corresponds to the app running in the foreground active state.
Inactive
At least one view of the application is visible, but none have input focus. The application is otherwise running normally.
On non-web desktop platforms, this corresponds to an application that is not in the foreground, but still has visible windows.
On the web, this corresponds to an application that is running in a window or tab that does not have input focus.
On iOS and macOS, this state corresponds to the Flutter host view running in the foreground inactive state. Apps transition to this state when in a phone call, when responding to a TouchID request, when entering the app switcher or the control center, or when the UIViewController hosting the Flutter app is transitioning.
On Android, this corresponds to the Flutter host view running in Android’s paused
state (i.e. Activity.onPause has been called), or in Android’s “resumed” state
(i.e. Activity.onResume has been called) but does not have window focus.
On Android and iOS, apps in this state should assume that they may be
Hidden and Paused at any
time.
Hidden
All views of an application are hidden, either because the application is about to be paused (on iOS and Android), or because it has been minimized or placed on a desktop that is no longer visible (on non-web desktop), or is running in a window or tab that is no longer visible (on the web).
On iOS and Android, in order to keep the state machine the same on all platforms, a
transition to this state is synthesized before the Paused
state is entered when coming from Inactive, and
before the Inactive state is entered when coming
from Paused. This allows cross-platform implementations
that want to know when an app is conceptually “hidden” to only write one handler.
Paused
The application is not currently visible to the user, and not responding to user input.
When the application is in this state, the engine will not call
PlatformDispatcher.onBeginFrame and PlatformDispatcher.onDrawFrame.
This state is only entered on iOS and Android.
Trait Implementations§
Source§impl Clone for AppLifecycleState
impl Clone for AppLifecycleState
impl Copy for AppLifecycleState
Source§impl Debug for AppLifecycleState
impl Debug for AppLifecycleState
impl Eq for AppLifecycleState
Source§impl Hash for AppLifecycleState
impl Hash for AppLifecycleState
Source§impl PartialEq for AppLifecycleState
impl PartialEq for AppLifecycleState
impl StructuralPartialEq for AppLifecycleState
Auto Trait Implementations§
impl Freeze for AppLifecycleState
impl RefUnwindSafe for AppLifecycleState
impl Send for AppLifecycleState
impl Sync for AppLifecycleState
impl Unpin for AppLifecycleState
impl UnsafeUnpin for AppLifecycleState
impl UnwindSafe for AppLifecycleState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.