get method

V? get(
  1. K key
)

Gets a value from the cache, or null if not present.

Accessing an item moves it to the end (most recently used).

Implementation

V? get(K key) {
  final value = _cache.remove(key);
  if (value != null) {
    _cache[key] = value;
  }
  return value;
}