Skip to content

Instantly share code, notes, and snippets.

@flutter-devs
Created June 27, 2019 10:38
Show Gist options
  • Save flutter-devs/1e3fe5e5b266e7870c688c58dd4d7037 to your computer and use it in GitHub Desktop.
Save flutter-devs/1e3fe5e5b266e7870c688c58dd4d7037 to your computer and use it in GitHub Desktop.
class AnimatedScreen extends StatefulWidget {
@override
_AnimatedScreenState createState() => _AnimatedScreenState();
}
class _AnimatedScreenState extends State<AnimatedScreen>
with TickerProviderStateMixin {
Animation _containerRadiusAnimation,
_containerSizeAnimation,
_containerColorAnimation;
AnimationController _containerAnimationController;
@override
void initState() {
super.initState();
_containerAnimationController = AnimationController(
vsync: this, duration: Duration(milliseconds: 5000));
_containerRadiusAnimation = BorderRadiusTween(
begin: BorderRadius.circular(100.0),
end: BorderRadius.circular(0.0))
.animate(CurvedAnimation(
curve: Curves.ease, parent: _containerAnimationController));
_containerSizeAnimation = Tween(begin: 0.0, end: 2.0).animate(
CurvedAnimation(
curve: Curves.ease, parent: _containerAnimationController));
_containerColorAnimation =
ColorTween(begin: Colors.black, end: Colors.white).animate(
CurvedAnimation(
curve: Curves.ease, parent: _containerAnimationController));
_containerAnimationController.forward();
}
@override
Widget build(BuildContext context) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment