getIfPresent method

V? getIfPresent(
  1. K key
)

Implementation

V? getIfPresent(K key) {
  final element = cachedElements[key];
  if (element == null || DateTime.now().compareTo(element.creationDateTime.add(Duration(milliseconds: expirationInMillis))) > 0) {
    cachedElements.remove(key);
    return null;
  } else {
    return element.value;
  }
}