expandIndexed<R> method Null safety

List<R> expandIndexed<R>(
  1. Iterable<R> mapper(
    1. T item,
    2. int index
    )
)

Implementation

List<R> expandIndexed<R>(Iterable<R> mapper(T item, int index)) {
  int i = 0;
  return [...this.expand((item) => mapper(item, i++))];
}