JsonCacheFake class final

In-memory cache without synchronization.

It is intended for unit testing and prototyping.

Warning: do not use it in production code. It is not thread-safe.

Implemented types

Constructors

JsonCacheFake()
Shares a static memory with other instances.
JsonCacheFake.init(Map<String, Map<String, dynamic>?> init)
Initializes the cache with init by performing a deep copy.
JsonCacheFake.mem(Map<String, Map<String, dynamic>?> _memory)
Cache with custom memory.
const

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() Future<void>
Clears its internal in-memory storage.
override
contains(String key) Future<bool>
Checks for cached data at key.
override
keys() Future<UnmodifiableListView<String>>
The cache keys.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh(String key, Map<String, dynamic> data) Future<void>
Updates data located at key.
override
remove(String key) Future<void>
Removes data located at key.
override
toString() String
A string representation of this object.
inherited
value(String key) Future<Map<String, dynamic>?>
Retrieves a copy of the data at key or null if there is no data.
override

Operators

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