map<T, R> static method
Maps each element of list through callback, passing the index too.
Implementation
static List<R> map<T, R>(
Iterable<T> list,
R Function(T value, int index) callback,
) {
var i = 0;
return [for (final v in list) callback(v, i++)];
}