Created
June 27, 2019 10:35
-
-
Save flutter-devs/f0243fffac2d4a5fdc349336090fe01b to your computer and use it in GitHub Desktop.
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
| class HomeScreen extends StatefulWidget { | |
| @override | |
| _HomeScreenState createState() => _HomeScreenState(); | |
| } | |
| class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin { | |
| Animation _arrowAnimation, _heartAnimation; | |
| AnimationController _arrowAnimationController, _heartAnimationController; | |
| @override | |
| void initState() { | |
| super.initState(); | |
| _arrowAnimationController = | |
| AnimationController(vsync: this, duration: Duration(milliseconds: 300)); | |
| _arrowAnimation = | |
| Tween(begin: 0.0, end: pi).animate(_arrowAnimationController); | |
| _heartAnimationController = AnimationController( | |
| vsync: this, duration: Duration(milliseconds: 1200)); | |
| _heartAnimation = Tween(begin: 150.0, end: 170.0).animate(CurvedAnimation( | |
| curve: Curves.bounceOut, parent: _heartAnimationController)); | |
| _heartAnimationController.addStatusListener((AnimationStatus status) { | |
| if (status == AnimationStatus.completed) { | |
| _heartAnimationController.repeat(); | |
| } | |
| }); | |
| } | |
| @override | |
| Widget build(BuildContext context) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment