How do I rotate something 15 degrees in Flutter?

In mobile apps, I think it’s kind of rare to have things start out rotated 15 degrees and just stay there forever. So that may be why Flutter’s support for rotation is better if you’re planning to adjust the rotation over time.

It feels like overkill, but a RotationTransition with an AlwaysStoppedAnimation would accomplish exactly what you want.


new RotationTransition(
  turns: new AlwaysStoppedAnimation(15 / 360),
  child: new Text("Lorem ipsum"),

If you want to rotate something 90, 180, or 270 degrees, you can use a RotatedBox.


new RotatedBox(
  quarterTurns: 1,
  child: new Text("Lorem ipsum")

Leave a Comment