SafeAreaPlugin.state
- Plugin
The state object of the system safe area; The property value is an object implementing the StateObserver interface;
Properties
state.currentState
The current state object; The value is an object implementing partial State interface; currentState can be used to get and set states; [Do not manually set the value of currentState, it will be automatically updated] The value is undefined before the initial update completes; Valid currentState properties include: ["overlay", "insets", "cutoutInsets", "outerInsets"]
Methods
A Generator function; Implements reading and listening to plugin states; Listeners set via StateObserver.onChange() will be triggered when corresponding plugin state changes;
Stop observing state
Add listener; multiple listeners can be added via multiple calls;
state.getState([force_update])
Get current state value
Events
- None
Platform Compatibility
Properties/Methods/Events | Android | iOS | Desktop-Dev | Desktop |
---|---|---|---|---|
currentState | ✅ | ✅ | ✅ | X |
jsonlines | ✅ | ✅ | ✅ | X |
stopObserve | ✅ | ✅ | ✅ | X |
onChange | ✅ | ✅ | ✅ | X |
getState | ✅ | ✅ | ✅ | X |