forEachIndexed method

void forEachIndexed(
  1. void f(
    1. int index,
    2. T element
    )
)

Calls f for each element with its index.

Implementation

void forEachIndexed(void Function(int index, T element) f) {
  var i = 0;
  for (final e in this) {
    f(i++, e);
  }
}