When an Animation controller is set forward(), I want the Animation attached to it to have a  CurvedAnimation of Curves.elasticIn
When an Animation controller is set reverse(), I want the Animation attached to it to have a  CurvedAnimation of Curves.elasticOut
I thought of changing the Curve just before the animation but it does not change it.
This is my attempt:
   if (!pinDropAnimationController.isAnimating) {
          if (mapController.isCameraMoving) {
            pinDropAnimationTween.animate(
                new CurvedAnimation(
                    parent: pinDropAnimationController, curve: Curves.linear));
            pinDropAnimationController.forward();
          } else {
            pinDropAnimationTween.animate(
                new CurvedAnimation(
                    parent: pinDropAnimationController, curve: Curves.elasticIn));
            pinDropAnimationController.reverse();
          }
         }
   }
On the CurvedAnimation constructor you have an argument named reverseCurve !
It does the job really well :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With