mapList<E> method

List<E> mapList<E>(
  1. E f(
    1. T e
    )
)

Maps Iterable and casts it to a List.

Returns a new lazy List with elements that are created by calling f on each element of this List in iteration order.

This method returns a view of the mapped elements. As long as the returned List is not iterated over, the supplied function f will not be invoked. The transformed elements will not be cached. Iterating multiple times over the returned List will invoke the supplied function f multiple times on the same element.

Methods on the returned iterable are allowed to omit calling f on any element where the result isn't needed. For example, elementAt may call f only once.

Implementation

List<E> mapList<E>(E f(T e)) => this.map(f).toList();