inRange static method

void inRange(
  1. num value,
  2. num min,
  3. num max, [
  4. String? message,
])

Asserts that the value is within the specified range

Implementation

static void inRange(num value, num min, num max, [String? message]) {
  if (value < min || value > max) {
    throw AssertionError(
      message ?? 'Value must be between $min and $max',
    );
  }
}