Transform.flip constructor
Creates a widget that mirrors its child about the widget's center point.
If flipX
is true, the child widget will be flipped horizontally. Defaults to false.
If flipY
is true, the child widget will be flipped vertically. Defaults to false.
If both are true, the child widget will be flipped both vertically and horizontally, equivalent to a 180 degree rotation.
This example flips the text horizontally.
link
Transform.flip(
flipX: true,
child: const Text('Horizontal Flip'),
)
Implementation
Transform.flip({
super.key,
bool flipX = false,
bool flipY = false,
this.origin,
this.transformHitTests = true,
this.filterQuality,
super.child,
}) : alignment = Alignment.center,
transform = Matrix4.diagonal3Values(flipX ? -1.0 : 1.0, flipY ? -1.0 : 1.0, 1.0);