flutter_tindercard
flutter_tindercard copied to clipboard
How Do I create infinite loading cards ?
Whenever I'm fetching the data after the stack end it doesn't update the stack and dont create new stack of items anyone has any idea how to implement this ?
Hi, I have the same problem, did you solve it?
Used swipe_stack package instead and https://pub.dev/packages/swipe_stack
Note: I used streams to fetch card data from firebase, indexes may differ as I reversed the generatedintList.Any questions you can ask me at [email protected]
- In that you have to first create a list of int items matching with you card items to do that
List
generateIntList = List .generate(_cardUsers.length, (index) => index);
Use this generatedList here, SwipeStack( key: //Swipe key, children: generatedList .map((int index) { return SwiperItem(builder: (SwiperPosition position, double progress) { .....})) 2. What I did was take 10 items in a list and show it ... and check if index is at 9 then I call my stream listener to get 10 more items(1 same as last list item and 9 new) like this if (index == 9) { listenToCardUserRT(); } 3. so that when the last one changes user cannot see if the card is changed or not (it is changed by overlapped as the first item of the list is the same as last item) 4. why I do this because when you are swiping the last card there will be no card behind and it'll also take fraction of seconds to load cards, that won't look to good as a user
@joekendal I'll check it and let you know about it.