Skip to content

Instantly share code, notes, and snippets.

@duytq94
Last active June 25, 2019 03:45
Show Gist options
  • Save duytq94/23cfa44d68ec0180195a0c0439f9e6fd to your computer and use it in GitHub Desktop.
Save duytq94/23cfa44d68ec0180195a0c0439f9e6fd to your computer and use it in GitHub Desktop.
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