Cache class

Storage for arbitrary assets.

A key may be derived from another by joining it to a parameter string with separator. Replacing the value at a key evicts everything derived from it, so live asset changes invalidate the entries built on top of them.

Every mutation notifies listeners exactly once, so consumers holding on to what they retrieved can re-resolve it.

Inheritance

Constructors

Cache()

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
keys Iterable<String>
no setter
length int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add<T>(String key, T value) → void
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
contains(String key) bool
dispose() → void
Discards any resources used by the object.
inherited
evict(String key) bool
evictDerived(String key) int
Evicts every entry derived from key, returning how many were removed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
retrieve<T>(String key) → T
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

derive(String key, String parameters) String
The key for an entry derived from key with the given parameters.

Constants

separator → const String
Separates a base key from the parameters of a key derived from it.