rangeTo method Null safety
Creates a range from this value to the specified toInclusive
value, inclusively.
Example:
1.rangeTo(3) // => 1, 2, 3
1.rangeTo(5, step: 2) // => 1, 3, 5
Implementation
IntRange rangeTo(int toInclusive, {int step = 1}) =>
IntRange(this, toInclusive, step: step);