BrunoJurkovic / tcard

Flutter tinder like cards
https://pub.dev/packages/tcard
MIT License
146 stars 54 forks source link

Fix controller swipe #40

Closed f3d0ss closed 2 years ago

f3d0ss commented 2 years ago

When you call controller.forward(direction: SwipeDirection.Right) (or Left) while the animation of an older call is still ongoing the controller store a SwipeInfo with SwipeDirection.Right. https://github.com/BrunoJurkovic/tcard/blob/10b7d7fa4c4643dc436282428530df266c277fc9/lib/src/controller.dart#L22 When the controller then call state!.runChangeOrderAnimation() the state find an older animation is still ongoing and the it return without doing nothing. This way at the next controller.forward(direction: SwipeDirection.Left) (or Right) the card will swipe in the wrong direction.

A easy fix is to remove the last SwipeInfo if the animation is still ongoing.

f3d0ss commented 2 years ago

Is there a reason why my PR is ignored? I ask because I'm not an expert and I would like to know if it's because I have done something wrong.