MockRemoteConfig class
A RemoteConfig that can be used for testing. This class is not intended to be used in production. This RemoteConfig also implements WritableConfig and therefore can be used to set values for testing.
- Inheritance
-
- Object
- ChangeNotifier
- Config
- RemoteConfig
- MockRemoteConfig
- Implemented types
Constructors
-
MockRemoteConfig.new(Map<
String, Object> store) - Creates a MockRemoteConfig that can be used for testing.
Properties
- disposed → bool
-
Indicates whether the configuration has been disposed.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialized → bool
-
Indicates whether the configuration has been initialized.
no setterinherited
-
methodCallLogs
→ List<
MethodCall> -
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Disposes the configuration.
inherited
-
fetch(
{Duration expiration = const Duration(hours: 5), bool force = false}) → Future< void> -
Fetches configuration data from a remote server.
override
-
getBool(
String key, {bool defaultValue = Config.defaultValueForBool}) → bool -
Returns the value corresponding to the given
key
as a Boolean.override -
getDouble(
String key, {double defaultValue = Config.defaultValueForDouble}) → double -
Returns the value corresponding to the given
key
as a Double.override -
getInt(
String key, {int defaultValue = Config.defaultValueForInt}) → int -
Returns the value corresponding to the given
key
as an Integer.override -
getString(
String key, {String defaultValue = Config.defaultValueForString}) → String -
Returns the value corresponding to the given
key
as a String.override -
hasKey(
String key) → bool -
Checks if the given
key
exists in the configuration.override -
init(
) → Future< void> -
Initializes the configuration.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onChange(
) → void -
The value of Config has been changed.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
String key) → Future< void> -
Resets the configuration item corresponding to the given
key
to its default value.override -
resetAll(
) → Future< void> -
Resets all configuration items to their default values.
override
-
resetMany(
List< String> keys) → Future<void> -
Resets the configuration items corresponding to the given list of
keys
to their default values.override -
setBool(
String key, bool value) → Future< void> -
Sets the value of the given
key
to the specified Booleanvalue
.override -
setDefaults(
Map< String, Object> defaults) → Future<void> -
Sets the default values for the configuration.
override
-
setDouble(
String key, double value) → Future< void> -
Sets the value of the given
key
to the specified Doublevalue
.override -
setInt(
String key, int value) → Future< void> -
Sets the value of the given
key
to the specified Integervalue
.override -
setMany(
Map< String, Object> objects) → Future<void> -
Sets the values of multiple keys at once.
override
-
setMockMethodCallHandler(
) → void -
A function for mocking a MethodChannel.
inherited
-
setMockStreamHandler(
) → void -
A function for mocking a MockStreamHandler.
inherited
-
setString(
String key, String value) → Future< void> -
Sets the value of the given
key
to the specified Stringvalue
.override -
testSetMockFetchValues(
Map< String, Object> values) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited