Progression constructor Null safety

const Progression(
  1. int first,
  2. int last,
  3. {int step = 1}
)

Creates an arithmetic progression from first to last inclusively, with common difference of step.

Implementation

const Progression(int first, int last, {int step = 1})
    : _first = first,
      _last = last,
      step = step != 0 ? step : 1;