iterate abstract method

  1. @useResult
  2. @lazy
Iterable<T> iterate({
  1. required T by(
    1. T current
    ),
})

Returns a lazy Iterable by stepping through this range using by.

The returned Iterable is lazy and potentially infinite.

final range = Interval.closedOpen(0, 5);
range.iterate(by: (e) => e + 1).toList(); // [0, 1, 2, 3, 4]

Implementation

@useResult @lazy Iterable<T> iterate({required T Function(T current) by});