-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TinderSwapCard empty when rebuilding after last swipe #49
Comments
@fgarciaDev Please have you been able to resolve this issue, if you have can you paste the solution here thanks. |
@fgarciaDev @Loisgenesis |
I've got the same problem. I'm quite confused about the question how the cardBuilder is dealing with the index. Let's say I've got a list of only two items: items[0] and items[1]. When swiping through this list I want to start with a certain index and then, if the end or the beginning of the list is reached 'switch' over to the beginning or the end respectively. Such as (if index > 1 then index = 0 or if index < 0 then index = 1. I can't get this working :-( But why not? Let me explain... Reason1: I can not set a starting index. The stack of cards always starts with 0. That's why I can not use buildCard(index) in the cardBuilder. If I want to start with items[myCurrentIndex] this fails. So I start with buildCard(myCurrentIndex) and that works! The correct card is shown. Reason2: Let's say, when I swipe left, the index should increase and when I swipe right the index should decrease. OK! I can detect the direction of swiping :-) so simply increase / decrease myCurrentIndex dependent on the swipe direction! And when I reach the upper end (2 in the example) I set it to 0 and when I reach the lower end (-1 in the example) I set it to 1. Sounds easy.. BUT: Surprise... Surprise... This only works once :-O After buildCard(myCurrentIndex) the second time the card is empty :-O This is a really good package. And I took the time to explain a failing simple but everyday usecase to make it possible to enhance it. If I overlooked a feature, please let me know. |
hello I also have the same problem when I append list with the set state that time it will start with first card |
I am using this to present items and don't distinguish between L/R swipes. After swiping thru all items, I rebuild the view, however, the TinderSwapCard widget remains empty. Is there a way to tell the TinderSwapCard to rebuild after last item is swiped? Don't know if this is a bug or enhancement request.
Below is what I am trying to do, but even though I rebuild, TinderSwapCard never updates after the last card is dismissed.
The text was updated successfully, but these errors were encountered: