isBetween method
Returns if a number is between first
and second
100.isBetween(50, 150) // true;
100.isBetween(100, 100) // true;
Implementation
bool isBetween(num first, num second) {
if (first <= second) {
return this.validate() >= first && this.validate() <= second;
} else {
return this.validate() >= second && this.validate() <= first;
}
}