between method

bool between(
  1. Duration start,
  2. Duration end, [
  3. bool endInclusive = true
])

Implementation

bool between(Duration start, Duration end, [bool endInclusive = true]) {
  if (this == null) return false;

  if (endInclusive) {
    return this! >= start && this! <= end;
  } else {
    return this! >= start && this! < end;
  }
}