forEachIndexed<R> method Null safety

void forEachIndexed<R>(
  1. R mapper(
    1. T item,
    2. int index
    )
)

Implementation

void forEachIndexed<R>(R mapper(T item, int index)) {
  int i = 0;

  for (final x in this) {
    mapper(x, i++);
  }
}