LegacyJsonSharedPreferencesStorage class final

a Storage that stores data in a SharedPreferences using JSON.

This is generally used in combination riverpod_annotation's JsonPersist.

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

delete(String key) Future<void>
Deletes the data associated with key.
deleteOutOfDate() Future<void>
Deletes all data that is out of date.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String key) Future<PersistedData<String>?>
Reads the data associated with key.
toString() String
A string representation of this object.
inherited
write(String key, String value, StorageOptions options) Future<void>
Writes value associated with key.

Operators

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

Static Methods

open() Future<LegacyJsonSharedPreferencesStorage>
opens shared_preferences and initializes the storage; also deletes expired keys before returning