title: How can I filter a stream in Flutter?
body: <p>I am new to flutter/dart and within this page, I have a list of &quot;information resources&quot; populating the screen with a widget I've created called InformationResourceCard. I want to use a dropdown menu where users can select the information resource type and then the stream is filtered based on their selection.</p>
  <p>I can't seem to figure out how to do this. My current understanding is that the page must be a stateful widget and that the dropdown menu selection will call setState to rebuild the list based on that selection. However, I don't know how to filter the stream. Below is the method I am using to build the list.</p>
  <pre><code>Widget _buildList(BuildContext context) {
      final database = Provider.of&lt;Database&gt;(context);
      return StreamBuilder&lt;List&lt;InformationResource&gt;&gt;(
        stream: database.informationResourceStream(widget.category.id),
        builder: (context, snapshot) {
          if (snapshot.hasData){
            final informationResources = snapshot.data;
            return ListView.builder(
              padding: const EdgeInsets.all(10.0),
              itemCount: informationResources.length,
              itemBuilder: (context, i) =&gt; InformationResourceCard(informationResource: informationResources[i])
            );
          }
          return //something else
        },
      );
    }
  </code></pre>
  <p>Any help would be greatly appreciated. Thanks!</p>