How to do an infinit Swipe ?

Database & APIs

Hello,

I would like to know how I can do an infinit swipe in the "SwipeableStack" ?

For the ListView there is the option "Infinit scroll" and that add a pagination, I believe we can do the same thing for the swipe, just don't know how.

What have you tried so far?

Trying to play with the index of swipe (number of documents from my firebase collection).

We can set the "Unique Key" in the swipeableStack but don't know how to use it in fact.

In the debug mode I have the "document" (which is the "Generating children from variable" of the swipestack) It's null (I guess because my document is a JSON and it needs an integer)

So even if I add an "index" to know which card is display, I wanted to add an action and call the api again to get a new set of document BUT I don't think i can update the swipestack in live, like this the user don't see anything about that.

So maybe with the Update Page on Changes, I add a page state and on every type of swipe I update this state, but after that want do I do ?

Let's say I want to load only the 5 first card to swipe, so I update the pagestate and with a custom function maybe ? I call the api again but there is no way to update the swipestack in live, right ?

Thank you for your help !

Did you check FlutterFlow's Documentation for this topic?
Yes
4
5 replies