forEach3<Y> method

void forEach3<Y>(
  1. void transformer(
    1. T value,
    2. int index,
    3. Iterable<T> list
    )
)

foreach with the iterable being looped given to you in the transformer.

forEach3 is the same as forEach but with the index given to you in the transformer

Implementation

void forEach3<Y>(
  final void Function(T value, int index, Iterable<T> list) transformer,
) {
  int index = 0;
  forEach((final T item) {
    transformer(item, index, take(length));
    index = index + 1;
  });
}