Skip to content

Instantly share code, notes, and snippets.

@e200
Last active January 2, 2021 14:07
Show Gist options
  • Save e200/1f53babbb11036fa029a37df36471f5f to your computer and use it in GitHub Desktop.
Save e200/1f53babbb11036fa029a37df36471f5f to your computer and use it in GitHub Desktop.
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
double _angle = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: AnimatedRotationButton(
child: Text(
'Clique me!',
style: TextStyle(color: Colors.white),
),
angle: _angle,
onPressed: () {
setState(() {
_angle += 45 * pi / 180;
});
},
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment