mapWithIndex<E> method

List<E> mapWithIndex <E>(
  1. E f(
    1. T,
    2. int index
    )
)

Implementation

List<E> mapWithIndex<E>(E Function(T, int index) f) => asMap()
    .entries
    .map((entry) => f(
          entry.value,
          entry.key,
        ))
    .toList();