hasExpired function

bool hasExpired (
  1. DateTime date,
  2. Duration maxAge
)

Implementation

bool hasExpired(DateTime date, Duration maxAge) {
  return date == null
      ? true
      : (maxAge == null ? false : new DateTime.now().difference(date) > maxAge);
}