expandIndexed<R> method
Expands each element and index to a number of elements in a new iterable.
Like Iterable.expand except that the callback function is supplied with both the index and the element.
Implementation
Iterable<R> expandIndexed<R>(
Iterable<R> Function(int index, E element) expand) sync* {
for (var index = 0; index < length; index++) {
yield* expand(index, this[index]);
}
}