isExpired method Null safety

bool isExpired(
  1. [DateTime? now]
)

Checks if the cache entry is expired

  • now: An optional value for the current time

Return true if expired, false if not

Implementation

bool isExpired([DateTime? now]) {
  return expiryTime.isBefore(now ?? DateTime.now());
}