between method

double between(
  1. num low,
  2. num upper
)

Implementation

double between(num low, num upper) {
  return min(upper.toDouble(), max(low.toDouble(), this.toDouble()));
}