Transform.rotate constructor

Transform.rotate({
  1. Key? key,
  2. required double angle,
  3. Offset? origin,
  4. AlignmentGeometry? alignment = Alignment.center,
  5. bool transformHitTests = true,
  6. FilterQuality? filterQuality,
  7. Widget? child,
})

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

The angle argument gives the rotation in clockwise radians.

This example rotates an orange box containing text around its center by fifteen degrees.
link
Transform.rotate(
  angle: -math.pi / 12.0,
  child: Container(
    padding: const EdgeInsets.all(8.0),
    color: const Color(0xFFE8581C),
    child: const Text('Apartment for rent!'),
  ),
)

See also:

Implementation

Transform.rotate({
  super.key,
  required double angle,
  this.origin,
  this.alignment = Alignment.center,
  this.transformHitTests = true,
  this.filterQuality,
  super.child,
}) : transform = _computeRotation(angle);