put method

dynamic put(
  1. K key,
  2. V value
)

Implementation

put(K key, V value) {
  if (cachedElements.length == maxSize) {
    _invalidateOldestValue();
  }

  cachedElements.update(key, (v) => CachedElement(value, DateTime.now()), ifAbsent: () => CachedElement(value, DateTime.now()));
}