Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ Map<String, dynamic>
-
The current value of the object. When the value changes, the callbacks
registered with addListener will be invoked.
no setterinherited
Methods
-
add(String key, dynamic value, {bool autoRemove = true, Duration expiration = const Duration(seconds: 60), bool listen = true})
→ void
-
Add a key/value pair to the cache, if the key is not already in the cache.
Specify the duration of the cache entry (default 30 seconds).
-
addListener(VoidCallback listener)
→ void
-
Register a closure to be called when the object notifies its listeners.
inherited
-
clear()
→ void
-
Remove all keys from the cache and notify listeners.
-
contains(String key)
→ bool
-
Verify if a key exists in the cache.
-
get<T>(String key)
→ T?
-
Get a value from the cache by key.
-
getByType<T>()
→ T?
-
Get a first (if there is more than one) value from the cache by type.
-
getOrAdd<T>(String key, {required Future<T> addValue(), bool autoRemove = true, Duration expiration = const Duration(seconds: 60), bool listen = true})
→ Future<T>
-
Try to get a value from the cache by key.
if the key is not in the cache, will be created.
-
getOrAddSync<T>(String key, {required T addValue, bool autoRemove = true, Duration expiration = const Duration(seconds: 60), bool listen = true})
→ T
-
Try to get a value from the cache by key.
if the key is not in the cache, will be created sync.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(String key)
→ void
-
Remove a key from the cache.
-
removeListener(VoidCallback listener)
→ void
-
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited