extension IndexedMap on Iterable { Iterable indexedMap(O Function(int, T) toElement) { int index = 0; return map((e) => toElement(index++, e)); } }