MemoryStorageAdapter class final
A simple in-memory implementation of KeyValueStoreInterface
.
Stores key-value pairs in a local Map. Useful for testing, prototyping, or scenarios where persistence is not required.
⚠️ Values are lost when the app is restarted.
- Annotations
Constructors
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 entry for the given
key
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → Future< String?> -
Reads the value associated with the given
key
. -
readAll(
) → Future< Map< String, String> > - Reads and returns all key-value pairs from memory.
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, String value) → Future< void> -
Writes the provided
value
for the givenkey
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited