upTo method

IntRange upTo(
  1. int toInclusive, {
  2. int step = 1,
})

Alias for rangeTo(), creates a range from this value to the specified toInclusive value, inclusively.

Example:

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

Implementation

IntRange upTo(int toInclusive, {int step = 1}) =>
    IntRange(this, toInclusive, step: step);