call method

T call({
  1. bool updateCache = false,
})

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;
  }
}