Skip to content

Instantly share code, notes, and snippets.

@e200
Last active January 2, 2021 14:07
Show Gist options
  • Save e200/33eb0fc220a9c14e3fc7ee8fde820e4c to your computer and use it in GitHub Desktop.
Save e200/33eb0fc220a9c14e3fc7ee8fde820e4c to your computer and use it in GitHub Desktop.
class AnimatedRotationButton extends StatefulWidget {
final Widget child;
final double angle;
final Function onPressed;
const AnimatedRotationButton({
Key key,
this.child,
this.angle,
this.onPressed,
}) : super(key: key);
@override
State createState() => _AnimatedRotationButtonState();
}
class _AnimatedRotationButtonState extends State<AnimatedRotationButton> {
@override
Widget build(BuildContext context) {
return Transform.rotate(
angle: widget.angle,
child: RaisedButton(
color: Colors.blue,
child: widget.child,
onPressed: widget.onPressed,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment