Config class
Config is a config service that seeks to allow app developers to have configuration services over their app.
For example, a developer could bake in a green theme for the day of the Saint Patrick's Holiday. Further, a developer could roll out, into production, the ability for the developers to test real-world changes while only exposing those changes to the developers.
-
The Config service is designed to provide the least disruptive experience to users possible. In light of this goal, fetched configs will only be applied when the app leaves memory and relaunches. This will guarantee a continuity of the user experience that is not jarring if a new config gets rolled out mid-session.
-
In this basic usage all that is necessary is to call fetch on the shared instance. The code may then check feature flags with the assurance that the UI experience will be consistent.
-
However, it is often the case that a developer would like to be more aggressive with the application of a config. To satisfy that need the FConfig service supplies an observer that an object may subscribe to.
-
As events happen, such as successful fetching or the activation of a config, the object that is observing may take action. This allows the developer to have more control over the configuration service if it is necessary.
Constructors
- Config()
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
-
activateConfig(
) → void - Aggressively activates the latest config if it has not been activated.
-
fetchConfig(
) → void - Fetches the most recent config from the server for this client.
-
getConfigString(
String key, String defaultValue) → Future< String> -
Gets the string value for the given
key
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerListener(
ConfigListener listener) → void - Registers an observer.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterListener(
ConfigListener listener) → void - Unregisters an observer.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- configAgent ↔ ConfigAgent?
-
getter/setter pair