isBetweenRange method
Returns true if this DateTime is within the specified range,
false if range is null.
If isInclusive is true (default), the start and end dates of the range
are included in the check (closed interval). If false, only dates
strictly between start and end are considered in range (open interval).
Implementation
@useResult
bool isBetweenRange(DateTimeRange? range, {bool isInclusive = true}) {
if (range == null) {
return false;
}
return isBetween(range.start, range.end, isInclusive: isInclusive);
}