title: How to limit results count of a stream in flutter
body: <p>I am looking for a way I can limit the number of results from such a stream:</p>
  
  <pre><code>return StreamBuilder(
          stream: Global.updatesRef.streamData(),
          builder: (BuildContext context, AsyncSnapshot snap) {
            if (snap.hasError) {
              print(snap.error);
            }
            if (snap.hasData) {
              List&lt;Update&gt; updates = (snap.data)
                  .where((item) =&gt;
                      item.status == 'online' &amp;&amp;
                      item.type == 'market' &amp;&amp;
                      item.id != widget.productId)
                  .toList();
              if (updates.length &gt; 0) {..
  </code></pre>
  
  <p>This gives me all the results of the query, but I want to limit the count here within the stream to let say just <strong>5</strong> items.</p>
  
  <p>I am using provider to get firestore data. So the provider store is shared with other screens that don't need any limitation of the result count at least for now.</p>
  
  <p>So if I can do that depending on the screen or the widget, it will be nice.</p>