Created
June 10, 2020 13:04
-
-
Save SahanAmarsha/e95a6d000a9e1866b4be7d3aaebf8891 to your computer and use it in GitHub Desktop.
Defining a Hinge Animation
This file contains hidden or 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
AnimationController _controller; | |
Animation _rotateAnimation; | |
Animation<double> _slideAnimation; | |
Animation<double> _opacityAnimation; | |
@override | |
void initState() { | |
// TODO: implement initState | |
super.initState(); | |
_controller = AnimationController( | |
vsync: this, | |
duration: Duration(milliseconds: 3000), | |
); | |
_rotateAnimation = Tween(end: 0.15, begin: 0.0) | |
.animate( | |
CurvedAnimation( | |
parent: _controller, | |
curve: Interval(0.0, 0.5, curve: Curves.bounceInOut), | |
), | |
); | |
_slideAnimation = Tween(begin: 100.0, end: 600.0).animate( | |
CurvedAnimation( | |
parent: _controller, | |
curve: Interval(0.5, 1.0, curve: Curves.fastOutSlowIn), | |
), | |
); | |
_opacityAnimation = Tween(begin: 1.0, end: 0.0).animate( | |
CurvedAnimation( | |
parent: _controller, | |
curve: Interval(0.5, 1.0, curve: Curves.fastOutSlowIn), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment