W3cubDocs

/Dart 2

checkValueInInterval method

void checkValueInInterval (int value, int minValue, int maxValue, [ String name, String message ])

Check that a value lies in a specific interval.

Throws if value is not in the interval. The interval is from minValue to maxValue, both inclusive.

Implementation

static void checkValueInInterval(int value, int minValue, int maxValue,
    [String name, String message]) {
  if (value < minValue || value > maxValue) {
    throw RangeError.range(value, minValue, maxValue, name, message);
  }
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-core/RangeError/checkValueInInterval.html