ManualMobileLifecycleAdapter class

A controllable, stream-backed MobileLifecycleAdapter useful for testing, CLI simulations, or custom platform integrations.

Implemented types

Constructors

ManualMobileLifecycleAdapter({NodeLifecycleState initialState = NodeLifecycleState.resumed, bool initialLowBattery = false})
Creates a new ManualMobileLifecycleAdapter.

Properties

currentState → NodeLifecycleState
Returns the latest emitted lifecycle state.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isLowBattery → bool
Returns whether the adapter is currently reporting a low-battery state.
no setter
lifecycleStream → Stream<NodeLifecycleState>
Stream emitting changes to the application's lifecycle state.
no setteroverride
lowBatteryStream → Stream<bool>
Stream emitting boolean flags indicating whether the device is in a low-battery state.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → Future<void>
Disposes of any resources, controllers, or native channels held by this adapter.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestBackgroundExtension({Duration duration = const Duration(seconds: 30)}) → Future<bool>
Requests a temporary execution extension from the mobile OS (e.g. beginBackgroundTask on iOS).
override
setLifecycleState(NodeLifecycleState state) → void
Programmatically emits a new NodeLifecycleState.
setLowBattery(bool isLow) → void
Programmatically emits a new low-battery flag.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited