get method

V? get(
  1. K key
)

Retrieves the value associated with key, or null if the key is not present.

Accessing a key moves it to the end of the list (most recently used).

Implementation

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