until method

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

Creates a range from this value up to but excluding the specified toExclusive value.

Example:

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

Implementation

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