InMemoryStorageAdapter class

In-memory storage adapter for testing and rapid prototyping.

Stores all data in a transient in-memory map without filesystem or native I/O.

Example:

final memoryStorage = InMemoryStorageAdapter();
await memoryStorage.write('theme', 'dark');
print(await memoryStorage.read('theme')); // 'dark'
Implemented types

Constructors

InMemoryStorageAdapter()
Creates an InMemoryStorageAdapter instance.

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

clear() → void
Clears all entries in this storage adapter.
override
containsKey(String key) bool
Checks whether key exists in storage.
override
delete(String key) → void
Deletes stored value associated with key.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String key) String?
Reads raw string value associated with key, or null if absent.
override
toString() String
A string representation of this object.
inherited
write(String key, String value) → void
Writes value string associated with key.
override

Operators

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