flatMapWithIndex<B> method
Same as flatMap (extend) but provides also the index of each mapped
element in the mapping function (toElements).
Implementation
Iterable<B> flatMapWithIndex<B>(
Iterable<B> Function(T t, int index) toElements,
) sync* {
var index = 0;
for (final value in this) {
yield* toElements(value, index);
index += 1;
}
}