flatMapToListIndexed<T> method

List<T> flatMapToListIndexed<T>(
  1. List<T> destination,
  2. IndexedTransform<E, Iterable<T>> f
)

Appends to the give destination with the elements yielded from results of transform f function being invoked on each element of original collection, providing sequential index of each element.

Implementation

List<T> flatMapToListIndexed<T>(
    List<T> destination, IndexedTransform<E, Iterable<T>> f) {
  flatMapIndexed(f).forEach((e) => destination.add(e));
  return destination;
}