isFresh method

bool isFresh({
  1. DateTime? now,
  2. Duration maxAge = const Duration(hours: 8),
})

Implementation

bool isFresh({DateTime? now, Duration maxAge = const Duration(hours: 8)}) {
  now ??= DateTime.now();
  return now.difference(this) < maxAge;
}