isBetween method

bool isBetween(
  1. num from,
  2. num to
)

Method to check if the number falls within a specified range. Returns true if the number is between 'from' and 'to', inclusive; false otherwise.

Implementation

bool isBetween(num from, num to) {
  if (this == null) {
    return false;
  }
  return from <= this! && this! <= to;
}