HeavenOSK / flutter_swipable_stack

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations like Tinder UI.
https://pub.dev/packages/swipable_stack
MIT License
117 stars 48 forks source link

adds dragstart animation #50

Closed maeddin closed 2 years ago

maeddin commented 2 years ago

Normally it doesn't make much difference if you choose Dragstartbehavior.down or Dragstartbehavior.start with this package. This changes if you use e.g. a list in the cards. Then the swipe gesture must first win in the gesture arena, making Dragstartbehavior.down more reactive. However, the animation is not so smooth in this case, which is why I added an animation for these cases. I can also add an example if desired. This animation is not executed if the default value (Dragstartbehavior.start) is chosen.

HeavenOSK commented 2 years ago

@MaddinMade Thanks for making this PR!

I think I'm imagining the situation you describe, but it would be helpful you could provide an example because there may be a discrepancy.

maeddin commented 2 years ago

@HeavenOSK I have created a small example to demonstrate the use case. For this I have simply built a list into the cards, which here consists only of the same sample images as in the other examples. It's not easy to see, but makes a difference in practice, in my opinion. The GIFs are in slow motion.

Here you can see the swipe start with animation:
swipable_stack_animation_on

And here once without:
swipable_stack_animation_off

HeavenOSK commented 2 years ago

@MaddinMade Thanks for providing the example! I understand your intent 🙏

Nice approach! This PR should be merged before upgrading to Flutter V3.

maeddin commented 2 years ago

@HeavenOSK There is only line of code that generates a warning in Flutter 3. This is not a big deal. Should I include that with this pull request?

maeddin commented 2 years ago

@HeavenOSK I've added two comments as explanation 😁

maeddin commented 2 years ago

@HeavenOSK Should I add the Flutter 3 upgrade as well? Is only one line.

HeavenOSK commented 2 years ago

@MaddinMade Thanks adding ! 🙏 I'll merge this PR.

Sorry for the very late response.

HeavenOSK commented 2 years ago

Should I add the Flutter 3 upgrade as well? Is only one line.

No you shouldn't! I'll do it. Thank you!