mapToListWhere<R> method
Creates a List with all elements of this Iterable that satisfy
the predicate test
and modified by toElement
.
The List is fixed-length if growable
is false.
Implementation
List<R> mapToListWhere<R>(
R Function(T e) toElement,
bool Function(T e) test, {
bool growable = false,
}) {
final list = <R>[];
for (final element in this) {
if (test(element)) list.add(toElement(element));
}
return growable ? list : list.toFixedList();
}