isFresh method

bool isFresh([
  1. DateTime? now
])

Returns true if the entry is within its fresh TTL window.

Implementation

bool isFresh([DateTime? now]) {
  final current = (now ?? DateTime.now().toUtc());
  return current.difference(createdAt) <= ttl;
}