inRange method Null safety

bool inRange(
  1. num from,
  2. num to,
  3. {bool startInclusive = true,
  4. dynamic endInclusive = true}
)

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

Implementation

bool inRange(num from, num to,
    {bool startInclusive = true, endInclusive = true}) {
  return (from < this || (startInclusive && from == this)) &&
      (this < to || (endInclusive && this == to));
}