Storage<KeyT extends Object?, EncodedT extends Object?> class
abstract
An interface to enable Riverpod to interact with a database.
This is used in conjunction with Persistable to enable persistence for a notifier.
Storages are generally implemented by third-party packages.
Riverpod provides an official implementation of Storage that stores data
using SQLite, in the riverpod_sqflite
package.
Constructors
- Storage.inMemory()
-
A storage that stores data in-memory.
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
-
delete(
KeyT key) → FutureOr< void> -
Deletes the data associated with
key
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
KeyT key) → FutureOr< PersistedData< EncodedT> ?> -
Reads the data associated with
key
. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
KeyT key, EncodedT value, StorageOptions options) → FutureOr< void> -
Writes
value
associated withkey
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited