Subject<T> constructor

Subject<T>(
  1. StreamController<T> controller,
  2. Stream<T> stream
)

Constructs a Subject which wraps the provided controller. This constructor is applicable only for classes that extend Subject.

To guarantee the contract of a Subject, the controller must be a broadcast StreamController and the stream must also be a broadcast Stream.

Implementation

Subject(StreamController<T> controller, Stream<T> stream)
    : _controller = controller,
      assert(stream.isBroadcast, 'Subject requires a broadcast stream'),
      super(stream);