mapToList<E> method
Converts each element in the list to another type using the convert
function.
Returns a new list containing the converted elements.
Implementation
List<E> mapToList<E>(E Function(T) convert) {
return map(convert).toList();
}