downUntil method

IntRange downUntil(
  1. int toExclusive, {
  2. int step = 1,
})

Returns a progression from this value down to but excluding the specified toInclusive value with the step -step.

Example:

3.downUntil(1) // => 3, 2
5.downUntil(1, step: 2) // => 5, 3

Implementation

IntRange downUntil(int toExclusive, {int step = 1}) => this == toExclusive
    ? EmptyIntRange() // it's emtpy when all values are excluded
    : IntRange(this, toExclusive + step, step: -step);