Skip to content

Instantly share code, notes, and snippets.

@flutter-devs
Created June 27, 2019 10:35
Show Gist options
  • Select an option

  • Save flutter-devs/f0243fffac2d4a5fdc349336090fe01b to your computer and use it in GitHub Desktop.

Select an option

Save flutter-devs/f0243fffac2d4a5fdc349336090fe01b to your computer and use it in GitHub Desktop.
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