between method

bool between(
  1. num min,
  2. num max
)

Returns true if this is between the given min (inclusive) and max (exclusive).

Implementation

bool between(num min, num max) {
  assert(min <= max,
      'Invalid bounds: $min and $max, min cannot be greater than max');
  return min <= this && this < max;
}