SharedPreferencesMock class

Constructors

SharedPreferencesMock()

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

clear() Future<bool>
Completes with true once the user preferences for the app has been cleared.
inherited
commit() Future<bool>
Always returns true. On iOS, synchronize is marked deprecated. On Android, we commit every set.
inherited
containsKey(String key) bool
Returns true if the persistent storage contains the given key.
inherited
get(String? key) Object?
Reads a value of any type from persistent storage.
getBool(String? key) bool?
Reads a value from persistent storage, throwing an exception if it's not a bool.
getDouble(String? key) double?
Reads a value from persistent storage, throwing an exception if it's not a double.
getInt(String? key) int?
Reads a value from persistent storage, throwing an exception if it's not an int.
getKeys() Set<String>
Returns all keys in the persistent storage.
getString(String? key) String?
Reads a value from persistent storage, throwing an exception if it's not a String.
getStringList(String key) List<String>?
Reads a set of string values from persistent storage, throwing an exception if it's not a string list.
inherited
noSuchMethod(Invocation invocation, {Object? returnValue, Object? returnValueForMissingStub = deferToDefaultResponse}) → dynamic
Handles method stubbing, method call verification, and real method calls.
inherited
reload() Future<void>
Fetches the latest values from the host platform.
inherited
remove(String? key) Future<bool>
Removes an entry from persistent storage.
setBool(String? key, bool? value) Future<bool>
Saves a boolean value to persistent storage in the background.
setDouble(String key, double value) Future<bool>
Saves a double value to persistent storage in the background.
inherited
setInt(String? key, int? value) Future<bool>
Saves an integer value to persistent storage in the background.
setString(String? key, String? value) Future<bool>
Saves a string value to persistent storage in the background.
setStringList(String key, List<String> value) Future<bool>
Saves a list of strings value to persistent storage in the background.
inherited
stubbedgetBoolSuccess({String? key, bool? customResponse}) → dynamic
stubbedsetIntSuccess([bool? customResponse]) → dynamic
toString() String
A string representation of this object.
inherited

Operators

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