forEachIndexed method

void forEachIndexed(
  1. IndexedAction<E> f
)

Applies the action f on each element, providing sequential index of the element.

Implementation

void forEachIndexed(IndexedAction<E> f) {
  var i = 0;
  this?.forEach((e) => f(i++, e));
}