progression method Null safety

IntRange progression(
  1. int first,
  2. int last,
  3. {int step = 1}
)

Create an arithmetic progression from first to last inclusively, with common difference of step which defaults to 1.

Example:

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

Implementation

static IntRange progression(int first, int last, {int step = 1}) =>
    IntRange(first, last, step: step);