isWithin method

bool isWithin(
  1. Duration range,
  2. Duration other
)

Returns true if this duration is within range difference from other.

Implementation

bool isWithin(Duration range, Duration other) =>
    (this - other).abs() <= range;