List Filters
suggest changeIntroduction
Iterable.where and List.retainWhere both take a function that returns true or false for each element.
where returns a new lazy Iterable of the elements for which the function returns true. It does not modify the original list. retainWhere removes every element for which the function returns false, updating the list in place.
theList.retainWhere(test) is similar to theList = theList.where(test).toList(), except retainWhere changes the existing list instead of assigning a new one.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents