route method

Stream<T> route(
  1. bool predicate(
    1. T event
    )
)

Events that match predicate are sent to the stream created by this method, and not sent to any other router streams.

Implementation

Stream<T> route(bool Function(T event) predicate) {
  var controller = StreamController<T>.broadcast();
  _routes.add(_Route(predicate, controller));
  return controller.stream;
}