Transform.scale constructor

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

Creates a widget that scales its child uniformly.

The scale argument must not be null. It gives the scalar by which to multiply the x and y axes.

The alignment controls the origin of the scale; by default, this is the center of the box.

This example shrinks an orange box containing text such that each dimension is half the size it would otherwise be.
Transform.scale(
  scale: 0.5,
  child: Container(
    padding: const EdgeInsets.all(8.0),
    color: const Color(0xFFE8581C),
    child: const Text('Bad Ideas'),
  ),
)

Implementation

Transform.scale({
  Key key,
  @required double scale,
  this.origin,
  this.alignment = Alignment.center,
  this.transformHitTests = true,
  Widget child,
}) : transform = Matrix4.diagonal3Values(scale, scale, 1.0),
     super(key: key, child: child);