Last active
July 14, 2018 19:07
-
-
Save salihgueler/89c771f155eb5021c871fb766793d873 to your computer and use it in GitHub Desktop.
Easing Animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void handler(status) { | |
if (status == AnimationStatus.completed) { | |
_animation.removeStatusListener(handler); | |
_controller.reset(); | |
_animation = Tween(begin: 0.0, end: 1.0).animate(CurvedAnimation( | |
parent: _controller, | |
curve: Curves.fastOutSlowIn, | |
))..addStatusListener((status){ | |
if (status == AnimationStatus.completed) { | |
Navigator.pop(context); | |
} | |
}); | |
_controller.forward(); | |
} | |
} | |
_animation = Tween(begin: -1.0, end: 0.0).animate(CurvedAnimation( | |
parent: _controller, | |
curve: Curves.fastOutSlowIn, | |
))..addStatusListener(handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment