within method

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

Checks if this value is within the range: [from, to].

Implementation

bool within(num from, num to) =>
    (from <= to && this >= from && this <= to) ||
    (from > to && this >= to && this <= from);