I’m developing a flashcards app in FlutterFlow using Firestore and the SwipeableStack widget. The SwipeableStack is powered by a Firestore query that returns a list of cards based on filters (e.g., deckID equals a specific value and nextReviewDate is less than or equal to the current timestamp).
The issue I’m encountering is not just an index error—it’s that after I swipe a few cards (typically the first 3 out of an initial 5), I’m no longer able to continue swiping because the total number of cards returned by the query becomes less than the initial count. This happens because, when I swipe a card, its review date gets updated in Firestore, and as a result, it no longer meets the query criteria. Consequently, the query returns a smaller list, which prevents me from swiping through all the cards as intended.