Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save flutter-devs/89e362502fef09502479896e3f006268 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Example Animations'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
firstChild(),
SizedBox(
height: 50.0,
),
secondChild(),
],
),
);
}
Widget secondChild() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Expanded(
child: AnimatedBuilder(
animation: _heartAnimationController,
builder: (context, child) {
return Center(
child: Container(
child: Center(
child: Icon(
Icons.favorite,
color: Colors.red,
size: _heartAnimation.value,
),
),
),
);
},
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 12.0),
child: OutlineButton(
padding: const EdgeInsets.all(12.0),
color: Colors.white,
textColor: Colors.black,
child: Text('Start Beating Heart Animation'),
onPressed: () {
_heartAnimationController.forward();
},
splashColor: Colors.red,
),
),
)
],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment