whereList method
Filters Iterable and casts it to a List.
Returns a new lazy List with all elements that satisfy the
predicate test
.
The matching elements have the same order in the returned iterable as they have in iterator.
This method returns a view of the mapped elements.
As long as the returned List is not iterated over,
the supplied function test
will not be invoked.
Iterating will not cache results, and thus iterating multiple times over
the returned List may invoke the supplied
Implementation
List<T> whereList(bool test(T element)) => this.where(test).toList();