inRange method Null safety

bool inRange(
  1. int from,
  2. int to
)

Is the current number in the range from to to, mutually inclusive

Implementation

bool inRange(int from, int to) {
  return from <= this && this <= to;
}