through method

Iterable<int> through(
  1. int end, {
  2. int step = 1,
})

Returns a generator from this through the end.

Implementation

Iterable<int> through(int end, {int step = 1}) sync* {
  for (var i = this; step < 0 ? i >= end : i <= end; i += step) {
    yield i;
  }
}