Skip to content

Instantly share code, notes, and snippets.

@flutter-devs
Created July 15, 2019 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flutter-devs/e585ff4ae3f76881345795b25c7cc53c to your computer and use it in GitHub Desktop.
Save flutter-devs/e585ff4ae3f76881345795b25c7cc53c to your computer and use it in GitHub Desktop.
Animation _circleAnimation;
AnimationController _animationController;
@override
void initState() {
super.initState();
_animationController =
AnimationController(vsync: this, duration: Duration(milliseconds: 60));
_circleAnimation = AlignmentTween(
begin: widget.value ? Alignment.centerRight : Alignment.centerLeft,
end: widget.value ? Alignment.centerLeft : Alignment.centerRight)
.animate(CurvedAnimation(
parent: _animationController, curve: Curves.linear));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment