forEachIndexed method
For each method with provides not only the element but the index as well.
See forEach.
Implementation
void forEachIndexed(void Function(int index, T element) f) {
if (isNullOrEmpty) return;
for (var i = 0; i < this!.length; i++) {
f(i, this![i]);
}
}