FirebaseRemoteConfigService class
A wrapper around FirebaseRemoteConfig that handles initialisation, fetch failures, and exposes typed accessors.
Must be created via FirebaseRemoteConfigService.create, which runs the full initialisation sequence before returning. The instance is then registered as an async singleton in the DI container so it is ready before any feature code runs.
Remote Config is pre-seeded with local defaults (including translation files) so the app functions correctly even when the remote fetch fails due to network issues. A failed fetch is logged but never throws.
Fetch interval differs by environment:
- Production: 12-hour minimum interval, 10-second timeout.
- Staging: no minimum interval (always fetches fresh), 5-second timeout.
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
-
fetchAndActivate(
) → Future< void> - Fetches the latest values from Firebase and activates them.
-
getBool(
String key) → bool -
The boolean value for
key, or the default configured in Remote Config. -
getDouble(
String key) → double -
The double value for
key, or the default configured in Remote Config. -
getInt(
String key) → int -
The integer value for
key, or the default configured in Remote Config. -
getString(
String key) → String -
The string value for
key, or the default configured in Remote Config. -
getTranslation(
String localeTag) → Map< String, dynamic> -
Returns the translation map for the given
localeTag(e.g.en-UK). -
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 Methods
-
create(
{required FirebaseRemoteConfig firebaseRemoteConfig, required AppLogger logger, required AppEnvironment environment, required Map< String, dynamic> defaults}) → Future<FirebaseRemoteConfigService> - Creates and fully initialises a FirebaseRemoteConfigService.