SharedPreferenceStorage class abstract

Utility class to facilitate storing shared preferences

Implemented types

Constructors

SharedPreferenceStorage(SharedPreferences preferences)
Create a new instance of SharedPreferenceStorage
factory

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

containsKey(String key) bool
Returns true if there is a value for key
deleteKey(String key) Future<void>
Deletes the value stored for key
getBoolean(String key) bool?
Retrieves the stored boolean value for key. Returns null if the value is not found
getDouble(String key) double?
Retrieves the stored double value for key. Returns null if the value is not found
getInt(String key) int?
Retrieves the stored integer value for key. Returns null if the value is not found
getString(String key) String?
Retrieves the stored string value for key. Returns null if the value is not found
getValue({required String key}) Future<String?>
Get the value associated with the given key. Returns null if the value does not exist.
inherited
hasValue({required String key}) Future<bool>
Check if there is a value associated with the given key
inherited
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. Use this method to observe modifications that were made in native code (without using the plugin) or by another process while the app is running.
removeValue({required String key}) Future<void>
Removes the value associated with the given key
inherited
saveBoolean({required String key, required bool value}) Future<void>
Saves the given boolean value to the storage with key
saveDouble({required String key, required double value}) Future<void>
Saves the given double value to the storage with key
saveInt({required String key, required int value}) Future<void>
Saves the given integer value to the storage with key
saveString({required String key, required String value}) Future<void>
Saves the given string value to the storage with key
setValue({required String key, required String value}) Future<void>
Sets the value to be associated with the given key
inherited
toString() String
A string representation of this object.
inherited

Operators

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