start method

void start()

Starts reading from the source.

Implementation

void start() {
  if (_subscription != null) return;

  _subscription = _source.listen(
    (data) {
      if (!_isCanceled) {
        _controller.add(data);
      }
    },
    onError: (err) {
      if (!_isCanceled) {
        _controller.addError(err);
      }
    },
    onDone: () {
      if (!_isCanceled) {
        _controller.close();
      }
    },
  );
}