mapIndexed<E> method
map() that also gives the index. items.mapIndexed((i, e) => "$i: $e")
Implementation
Iterable<E> mapIndexed<E>(E Function(int index, T item) f) sync* {
int index = 0;
for (final T item in this) {
yield f(index++, item);
}
}