where method

ValueStream<T> where(
  1. Predicate<T?> predicate
)

Filters the entire stream, including the current element

Implementation

ValueStream<T> where(Predicate<T?> predicate) {
  final first = this.get().thenOrNull((T? resolved) {
        return predicate(resolved) == true ? resolved : null;
      } as T Function(T?));
  return ValueStream.of(first, this.after.where(predicate));
}