TestSharedPreferences class

Constructors

TestSharedPreferences()

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.
override
commit() Future<bool>
Always returns true. On iOS, synchronize is marked deprecated. On Android, we commit every set.
override
containsKey(String key) bool
Returns true if the persistent storage contains the given key.
override
get(String key) Object?
Reads a value of any type from persistent storage.
override
getAs<T>(String key) → T?
getBool(String key) bool?
Reads a value from persistent storage, throwing an exception if it's not a bool.
override
getDouble(String key) double?
Reads a value from persistent storage, throwing an exception if it's not a double.
override
getInt(String key) int?
Reads a value from persistent storage, throwing an exception if it's not an int.
override
getKeys() Set<String>
Returns all keys in the persistent storage.
override
getString(String key) String?
Reads a value from persistent storage, throwing an exception if it's not a String.
override
getStringList(String key) List<String>?
Reads a set of string values from persistent storage, throwing an exception if it's not a string set.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() Future<void>
Fetches the latest values from the host platform.
override
remove(String key) Future<bool>
Removes an entry from persistent storage.
override
setBool(String key, bool value) Future<bool>
Saves a boolean value to persistent storage in the background.
override
setDouble(String key, double value) Future<bool>
Saves a double value to persistent storage in the background.
override
setInt(String key, int value) Future<bool>
Saves an integer value to persistent storage in the background.
override
setString(String key, String value) Future<bool>
Saves a string value to persistent storage in the background.
override
setStringList(String key, List<String> value) Future<bool>
Saves a list of strings value to persistent storage in the background.
override
toString() String
A string representation of this object.
inherited
update(String key, Object? value) Future<bool>

Operators

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