getCached method

V getCached(
  1. K key,
  2. V computer(), {
  3. int? cacheLimit,
})

Returns key value or computes it and caches it. See checkCacheLimit and getCachedAsync.

Implementation

V getCached(K key, V Function() computer, {int? cacheLimit}) {
  _checkCachedEntry(key);
  checkCacheLimit(cacheLimit);

  return putIfAbsent(key, computer);
}