isBetween method
Returns true if this number is between min and max.
Implementation
bool isBetween(
num min,
num max, {
bool includeMin = true,
bool includeMax = true,
}) {
if (min > max) {
throw ArgumentError.value(
min, 'min', 'must be less than or equal to max');
}
final lower = includeMin ? this >= min : this > min;
final upper = includeMax ? this <= max : this < max;
return lower && upper;
}