isExpiredWith method

bool isExpiredWith({
  1. Duration grace = Duration.zero,
})

Returns true if the date plus a grace duration occurs before the current moment.

Useful when adding tolerance for expiration logic.

Implementation

bool isExpiredWith({Duration grace = Duration.zero}) {
  if (this == null) return true;
  return this!.add(grace).isBefore(DateTime.now());
}