duration static method

Duration duration(
  1. Duration a, [
  2. Duration b = Duration.zero
])

Time/Duration

a/b parameters defines the limits, the order doesn't matter

Implementation

/// [a]/[b] parameters defines the limits, the order doesn't matter
static Duration duration(Duration a, [Duration b = Duration.zero]) {
  return Duration(
    microseconds: _lerp(
      a.inMicroseconds,
      b.inMicroseconds,
      _r.nextDouble(),
    ).toInt(),
  );
}