isBetween method

bool isBetween(
  1. DateTime? start,
  2. DateTime? end
)

Check if this DateTime is between two other DateTimes (inclusive) Returns false if any of the DateTimes is null

Implementation

bool isBetween(DateTime? start, DateTime? end) {
  if (this == null || start == null || end == null) return false;
  return this! >= start && this! <= end;
}