isExpired method

bool isExpired()

Returns true if the date is null or occurs before the current moment.

Example:

myDate.isExpired();

Implementation

bool isExpired() {
  if (this == null) return true;
  return this!.isBefore(DateTime.now());
}