CachedStorage<E> class Null safety

Storage implementation wrapper that adds in-memory cache functionality.

Use it to wrap time consuming or performance heavy storage implementations.

Implemented types

Constructors

CachedStorage(Storage<E> _inner)

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

clearCache() → void
Clears only the cached value.
delete() Future<void>
Deletes both actual and cached value. On error throws.
override
get() Future<E?>
Gets the item, uses the cached version if present. Otherwise, fetches a fresh value, caches, and returns it. On error throws.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
save(E item) Future<E>
Saves and caches the item. On error throws.
override
toString() String
A string representation of this object.
inherited

Operators

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