origin property

Offset? origin
final

The origin of the coordinate system in which to apply the matrix, described relative to the point given by alignment.

Setting an origin is equivalent to conjugating the transform matrix by a translation. This property is provided just for convenience.

This offset is applied in addition to any alignment transformation, so in this example, the child is rotated about its center, since alignment in Transform.rotate defaults to Alignment.center:

Transform.rotate(
  angle: math.pi,
  child: Container(
   width: 150.0,
   height: 150.0,
   color: Colors.blue,
 ),
)

However, in this example the origin offset is applied after the alignment, so the child rotates about its bottom-right corner:

Transform.rotate(
  angle: math.pi,
  origin: const Offset(75.0, 75.0),
  child: Container(
   width: 150.0,
   height: 150.0,
   color: Colors.blue,
 ),
)

Implementation

final Offset? origin;