filter method
Filters the iterable using the given filter.
If filter is null, returns the original iterable.
Implementation
Iterable<T> filter(Filter<T>? filter) {
if (filter == null) return this;
return where((item) => filter.matches(item));
}