has method

bool has(
  1. String key
)

Check whether a valid (non-expired) entry exists for key.

Implementation

bool has(String key) {
  final raw = _store.get(key);
  if (raw == null) return false;
  if (raw is CacheEntry && raw.isExpired) {
    _store.remove(key);
    return false;
  }
  return true;
}