call method
Returns the cached object.
- The object is initialized when first accessed.
- To re-initialize the cached object use the
optional parameter
updateCache
.
Implementation
T call({
bool updateCache = false,
}) {
if (updateCache || !_isUpToDate) {
_isUpToDate = true;
return _cache = objectFactory();
} else {
return _cache;
}
}