CacheMap<K, T> class Null safety

Abstract class defining a cache containing items of type T and accessible via a unique key of type K

Constructors

CacheMap()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
length Future<int>
Returns the number of items
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

clear() Future<void>
Removes all items
containsKey(K key) Future<bool>
Returns if an item is available in the cache by giving its key
get(K key) Future<T?>
Gets an item by its key Returns null if it doesn't exist
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
put(K key, T item, {bool overrideExistingItem = true}) Future<bool>
Saves an item Returns true if the item was saved
remove(K key) Future<bool>
Removes an item by its key Returns true if the item existed and is now removed
toString() String
A string representation of this object. [...]
inherited

Operators

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