Swipeable Stack issue

Database & APIs

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.

What have you tried so far?

I’m looking for a solution that allows the user to swipe through all the initially loaded cards (all 5) without the query dynamically reducing the card count mid-swipe. Any suggestions on how to decouple the swipe UI from real-time Firestore updates or otherwise maintain the initial card count during the swipe session would be greatly appreciated.

Did you check FlutterFlow's Documentation for this topic?
Yes
1