rangeInt function
Returns integers from start (inclusive) toward end (exclusive) in
increments of step. A negative step counts down; the result is empty
when the range cannot advance toward end.
Example:
rangeInt(0, 5); // [0, 1, 2, 3, 4]
rangeInt(5, 0, step: -2); // [5, 3, 1]
Implementation
List<int> rangeInt(int start, int end, {int step = 1}) {
final List<int> out = <int>[];
for (int i = start; step > 0 ? i < end : i > end; i += step) {
out.add(i);
}
return out;
}