mapIndex<T, R> static method

List<R> Function(Iterable<T>) mapIndex<T, R>(
  1. R mapper(
    1. int,
    2. T
    )
)

Implementation

static List<R> Function(Iterable<T>) mapIndex<T, R>(
  R Function(int, T) mapper,
) {
  return (Iterable<T> items) {
    return items.indexed.map((e) => mapper(e.$1, e.$2)).toList();
  };
}