Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Last active July 14, 2018 19:07
Show Gist options
  • Save salihgueler/89c771f155eb5021c871fb766793d873 to your computer and use it in GitHub Desktop.
Save salihgueler/89c771f155eb5021c871fb766793d873 to your computer and use it in GitHub Desktop.
Easing Animation
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