AppContext class Services

App Context

The world state of the app for information that is useful for the entire application. Also, this is a good place to put config that user cannot and should not change. For example, if the app is running as an integration test.

Constructors

AppContext({AppRunningState appRunningStateOverride })

Properties

appRunningState AppRunningState
The state the app is running with like development, integration test or production which should never change while the app is running. TODO(#54): change it to final and required.
read / write
loadingState LoadingState
The state of the app context
read / write
platformState PlatformState
The platform the app is running on.
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
hasListeners → bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

configContext() → void
Initializes AppContext in ctor with the input arguments.
configProdContext() → void
Initializes AppContext with production config
configUnittestContext() → void
Initializes AppContext with unit test config
getAppRunningState() AppRunningState
initializeContext() → Future<void>
Initializes the entire AppContext with all async initializers.
initializeDeviceType() → Future<void>
Initializes the platform the app is running on at the start of the app. This method is normally called within initializeContext and usually not called directly.
isIos() → bool
Checks if the current app is running on the iOS ecosystem.
isIpad() → bool
Checks if the current app is running on iPad to implement iPad specific UI code.
isReady() → bool
Checks if AppContext is fully initialized and ready to use.
shouInitialize() → bool
Returns true if AppContext has not been initialized [...]
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes. [...]
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener and removeListener will throw after the object is disposed). [...]
@mustCallSuper, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
@protected, @visibleForTesting, inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited