to method

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

Returns a generator from this up to, but not including, the end.

Implementation

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