SharedPrefsStorage<E> class abstract

Storage implementation that uses SharedPreferences to store items.

Constructors

SharedPrefsStorage({required ToMap<E> toMap, required FromMap<E> fromMap, required String itemKey, SharedPreferences? sharedPreferences})
Makes a new instance using the provided fromMap and toMap item converters, itemKey as key in the sharedPreferences instance.
factory
SharedPrefsStorage.base(String itemKey, [SharedPreferences? sharedPreferences])
SharedPrefsStorage.primitive({required String itemKey, SharedPreferences? sharedPreferences})
Storage implementation that uses SharedPreferences to store primitive items that don't need a converter.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
itemKey String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sharedPreferences ↔ SharedPreferences?
getter/setter pair

Methods

delete() Future<void>
Deletes any written item. If no item is found completes without error.
override
ensurePreferencesSet() Future<SharedPreferences>
get() Future<E?>
Retrieves the saved item or returns null if no item is found.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(E item) Future<E>
Saves the given item, overriding any previous entries.
inherited
toString() String
A string representation of this object.
inherited

Operators

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