title: how to get multiple streams based on the same stream controller in flutter?
body: <p>I have a Bloc class that needs three streams based on the same stream controller.</p>
  
  <pre><code>class TodoBloc {
  
    final _todoController = StreamController&lt;List&lt;TodoModel&gt;&gt;();
  
    get allTodoStream =&gt; _todoController.stream;
  
    get activeTodoStream =&gt; _todoController.stream
            .map&lt;List&lt;TodoModel&gt;&gt;(
                (list) =&gt; list.where((item) =&gt; item.state == 0));
  
    get completedTodoStream =&gt; _todoController.stream
            .map&lt;List&lt;TodoModel&gt;&gt;(
                (list) =&gt; list.where((item) =&gt; item.state == 1));}
  </code></pre>
  
  <p>it's a list of to-dos which have states. I'd like to retrieve the to-dos with an active state in a stream separate from the one that retrieves the other states.</p>
  
  <p>I have a method that's responsible for the filtering and returns a stream depending on the filter value. here's the method: </p>
  
  <pre><code>Stream&lt;List&lt;TodoModel&gt;&gt; filterTodoLs(String filter) {
      if (filter == 'all') {
        return todoStream;
      } else if (filter == 'completed') {
        return completedStream;
      } else if (filter == 'active') {
        return activeStream;
      }
      return todoStream;
  }
  </code></pre>
  
  <p>later to be used in a widget like the following: </p>
  
  <pre><code> return StreamBuilder&lt;List&lt;TodoModel&gt;&gt;(
        stream: bloc.filterTodoLs(filter),
        builder:(BuildContext context, AsyncSnapshot&lt;List&lt;TodoModel&gt;&gt; todoSnapShot) {}
  </code></pre>
  
  <p>the snapshot is empty so far. how can i filter my original stream and return different ones depending on the filter applied to that stream?</p>