isBetween method
Returns a bool if this value is between (including) the two
numeric values first
and second
.
Example:
100.0.isBetween(50, 150) // true;
100.0.isBetween(50.0, 150.0) // true;
100.0.isBetween(100.0, 100.0) // true;
Implementation
bool isBetween(num first, num second) {
final lower = min(first, second);
final upper = max(first, second);
return this >= lower && this <= upper;
}