AnupKumarPanwar / swipe_cards

Tinder like swipe cards for flutter.
https://pub.dev/packages/swipe_cards
BSD 3-Clause "New" or "Revised" License
52 stars 47 forks source link

Card disappearing during swiping #38

Open PetrKubes97 opened 2 months ago

PetrKubes97 commented 2 months ago

I've found a bug that occurs when you change cards in the match engine, sometime the front card would not render.

The fix:

in swipe_cards build method:

DraggableCard(
            key: ValueKey(widget.matchEngine.currentItem!.content), // Add a key --> you'll also need to add the key param to the draggable card widget

I won't do a PR because I have a lot of custom changes in my fork, but this could save someone a few hours of debugging.