0

I have started working with Flutter and my first learning project is implementing cards that can be swiped and fliped as well. Because of the fact that several packages are available online I tried to combine tinder card (https://pub.dev/packages/flutter_tindercard) with flip card effect (https://pub.dev/packages/flip_card).

The result is very promising but only one problem occured that I can not solve. When I flip the card to the back side and after then I swipe it, the next card also flipping for the back side automatically. With pictures: swipe effect second card flipped automatically

Here you can find the code: https://gist.github.com/bbence14/f7eec338b677a2f7d9bdafb7d78cca91

Could you plase help me how I could reach that second card stay in the front state when the previus one was flipped and swiped?

I would really appreciate your help. Thanks in advance! B

Double B
  • 19
  • 6

1 Answers1

0

You just have to set the key attribute of your FlipCard widget like this and you're done :)

FlipCard(
  key: Key('flip$index'),
F Perroch
  • 1,988
  • 2
  • 11
  • 23