Filter<T> extension

Extension on Stream of Lists to provide functional-style filtering.

This extension adds a filter method that allows you to apply a where clause to each emitted list in the stream.

Example:

final stream = Stream.value([1, 2, 3, 4, 5]);

stream.filter((n) => n.isEven).listen(print); // prints: [2, 4]
on

Methods

filter(bool where(T)) Stream<List<T>>

Available on Stream<List<T>>, provided by the Filter extension

Filters each emitted list in the stream based on the provided where predicate.