flutter_tindercard icon indicating copy to clipboard operation
flutter_tindercard copied to clipboard

How Do I create infinite loading cards ?

Open yskhs07 opened this issue 4 years ago • 3 comments

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 ?

yskhs07 avatar Mar 31 '20 15:03 yskhs07

Hi, I have the same problem, did you solve it?

p02diada avatar Jun 12 '20 06:06 p02diada

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]

  1. 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

yskhs07 avatar Jun 23 '20 13:06 yskhs07

@joekendal I'll check it and let you know about it.

yskhs07 avatar Jul 19 '20 17:07 yskhs07