LazyMap<K, V> class

A lazy variable that caches a map of type Map<K, V>.

  • An unmodifiable map view is returned to prevent modification of the cache.
  • The same object is returned until an update of the cache is requested by calling the method updateCache() or using the optional parameter updateCache: true to access the cached variable.
Inheritance

Constructors

LazyMap(ObjectFactory<Map<K, V>> objectFactory)
Constructs an object of type LazyMap<T>.

Properties

hashCode int
The hash code for this object.
no setterinherited
isUpToDate bool
Returns true if the cached object has been initialized and is up-to-date.
no setterinherited
objectFactory ObjectFactory<Map<K, V>>
Callback used to create the cached object.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call({bool updateCache = false}) Map<K, V>
Returns the cached object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
updateCache() → void
After calling this function the cached object will be (lazily) re-initialized when it is next accessed.
inherited

Operators

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