forEachIndexed method

void forEachIndexed(
  1. void action(
    1. int index,
    2. dynamic element
    )
)

Implementation

void forEachIndexed(void Function(int index, dynamic element) action) {
  int index = 0;
  for (var element in this) action(index++, element);
}