title: Flutter - How to do an infinite card feed?
body: <p>I want to display one by one each document of a collection from Firestore. A document is a card containing an image and a text with a button to show the next card. Basically, my app should have the same behavior as Tinder: display one card then the next one, and never twice the same.</p>
  <p>At the moment, I made a StreamBuilder that call the last 10 cards in a Stack so each card is on top of each other (hiding the next one).
  But with this solution I have 2 problems :</p>
  <ul>
  <li>I don't know how to display the next item when the user tap on the
  next button. The current card has to disappear to let the next one being visible.</li>
  <li>The StreamBuilder call only 10 cards, I would like to load 10 more
  cards when the user is almost at the end (at the card number 8 for
  example) so the user don't even realize the loading in the background.</li>
  </ul>
  <p>Maybe the StreamBuilder is not the solution at all. But I have no idea what is the best way to do it.</p>
  <pre><code>StreamBuilder(
          stream: firestore.collection('Feed').orderBy('date').limit(10).snapshots(),
          builder: (BuildContext context, AsyncSnapshot&lt;QuerySnapshot&gt; snapshot) {
            if (!snapshot.hasData)
              return Center(child: CircularProgressIndicator());
            var _docs = snapshot.data.docs;
            if (_docs.isEmpty)
              return Center(
                child: Text(&quot;There is no more cards&quot;),
              );
            return Scaffold(
              body: Stack(
                children: _docs.map((document) {
                  return Container(
                    color: Colors.white,
                    child: CardItem(...),
                  );
                }).toList(),
              ),
            );
          });
  </code></pre>