isInInterval method
Checks if this number is within the interval a, b.
Use excludeA or excludeB to make the interval open at either end.
Implementation
bool isInInterval(
num a,
num b, {
bool excludeA = false,
bool excludeB = false,
}) {
if (excludeA && this == a) return false;
if (excludeB && this == b) return false;
return this >= a && this <= b;
}