Transform.rotate constructor

Transform.rotate({Key key, @required double angle, Offset origin, AlignmentGeometry alignment:, bool transformHitTests: true, Widget child })

Creates a widget that transforms its child using a rotation around the center.

The angle argument must not be null. It gives the rotation in clockwise radians.

Sample code

This example rotates an orange box containing text around its center by fifteen degrees.

new Transform.rotate(
  angle: -math.PI / 12.0,
  child: new Container(
    padding: const EdgeInsets.all(8.0),
    color: const Color(0xFFE8581C),
    child: const Text('Apartment for rent!'),


  Key key,
  @required double angle,
  this.transformHitTests: true,
  Widget child,
}) : transform = new Matrix4.rotationZ(angle),
     super(key: key, child: child);