presswink / flutter_touch_ripple_effect

A ripple effect package for Flutter widget
Apache License 2.0
3 stars 4 forks source link

Request: Sync ripple animation #16

Closed matejhocevar closed 1 year ago

matejhocevar commented 1 year ago

First, Aditya, thank you for this plugin. It's super simple and easy to use.

My only problem is that the ripple effect waits till the animation completes that perform the onTap action. For some, this might be the preferred choice, but in my app, it looks kinda weird/unresponsive.

Is there a possibility to add the isSyncAnimation (or something similar) property that would allow ripple animation to be synchronous with the onTap call?

    return GestureDetector(
      onTap: () {
        // delayed onTap till ripple effect
        Future.delayed(
            widget.rippleDuration == null
                ? _defaultDuration
                : widget.rippleDuration!, () {
          widget.onTap!();
        });
        ...

https://github.com/Adityapanther/flutter_touch_ripple_effect/blob/1634c95789cb3c8e64ff6be23cdf9b8927197bb4/lib/src/touch_ripple_effect.dart#L143C8-L149

I can also prepare a PR if you don't have time.

Adityapanther commented 1 year ago

Thanks @matejhocevar for suggestion. it's open-source library so you can contribute on it. please prepare a pull for this. I will take it forward.

thank you !

Adityapanther commented 1 year ago

@matejhocevar would you like to be maintainer of this project with me ? if yes then please let me know on raj68518@gmail.com