get method

Future<V?> get(
  1. K key
)

Returns the cached value, loading and caching it on a miss. A backing store that returns null is treated as "absent" and is not cached. Audited: 2026-06-12 11:26 EDT

Implementation

Future<V?> get(K key) async {
  if (_cache.containsKey(key)) return _cache[key];
  final V? loaded = await _load(key);
  if (loaded != null) _cache[key] = loaded;
  return loaded;
}