whereStates<T extends Object?> method

Stream<T> whereStates<T extends Object?>(
  1. bool filter(
    1. State state
    )
)
inherited

This transformer leaves only the necessary states with downcast to T

State's that do not match T are filtered out, the resulting Stream will be of Type T.

Implementation

Stream<T> whereStates<T extends Object?>(bool Function(State state) filter) =>
    where(filter).where((state) => state is T).cast<T>();