hasCacheExpired method

bool hasCacheExpired(
  1. ResponseCacheItem cachedValue,
  2. Duration cacheDuration
)
inherited

Implementation

bool hasCacheExpired(ResponseCacheItem cachedValue, Duration cacheDuration) {
  final nowMilliseconds = DateTime.now().millisecondsSinceEpoch;
  final cacheExpiryMilliseconds =
      nowMilliseconds - cacheDuration.inMilliseconds;
  final hasCacheExpired =
      cachedValue.cachedMilliseconds < cacheExpiryMilliseconds;

  return hasCacheExpired;
}