AppStateEventNotifier class

Notifies changes in app foreground/background.

Subscribe to appStateStream to get notified of changes in AppState. Use this when implementing app open ads instead of WidgetsBindingObserver, because the latter also notifies when the state of the Flutter activity/view controller changes. This makes an interstitial taking control of the screen indistinguishable from the app background/foreground.

Constructors

AppStateEventNotifier()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

appStateStream Stream<AppState>
Subscribe to this to get notified of changes in AppState.
no setter

Static Methods

startListening() Future<void>
Start listening to background/foreground events.
stopListening() Future<void>
Stop listening to background/foreground events.