&gt;.broadcast(
        onListen: onListen,
        onCancel: () {
          subscription.cancel();
        },
        sync: true);
  } else {
    controller = new StreamController&lt;E&gt;(
        onListen: onListen,
        onPause: () {
          subscription.pause();
        },
        onResume: () {
          subscription.resume();
        },
        onCancel: () =&gt; subscription.cancel(),
        sync: true);
  }
  return controller.stream;
}</code></pre>
    </section>

  </div> <!-- /.main-conten