Last active
June 25, 2019 03:45
-
-
Save duytq94/23cfa44d68ec0180195a0c0439f9e6fd to your computer and use it in GitHub Desktop.
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
Color gradientStartFrom = Colors.deepPurple; | |
Color gradientStartTo = Colors.purple; | |
Color gradientEndFrom = new Color(0xff483475); | |
Color gradientEndTo = new Color(0xff070B34); | |
animControlStar = new AnimationController(vsync: this, duration: new Duration(milliseconds: 2000)); | |
fadeAnimStar1 = new Tween(begin: 0.0, end: 1.0) | |
.animate(new CurvedAnimation(parent: animControlStar, curve: new Interval(0.0, 0.5))); | |
fadeAnimStar1.addListener(() { | |
setState(() {}); | |
}); | |
colorAnimBgStart = new ColorTween(begin: gradientStartFrom, end: gradientStartTo).animate(animControlBg); | |
colorAnimBgEnd = new ColorTween(begin: gradientEndFrom, end: gradientEndTo).animate(animControlBg); | |
animControlStar.addStatusListener((status) { | |
if (status == AnimationStatus.completed) { | |
animControlStar.reverse(); | |
} else if (status == AnimationStatus.dismissed) { | |
animControlStar.forward(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment