Transform.translate constructor Null safety

Transform.translate(
  1. {Key? key,
  2. required Offset offset,
  3. bool transformHitTests = true,
  4. FilterQuality? filterQuality,
  5. Widget? child}
)

Creates a widget that transforms its child using a translation.

The offset argument must not be null. It specifies the translation.

This example shifts the silver-colored child down by fifteen pixels.
Transform.translate(
  offset: const Offset(0.0, 15.0),
  child: Container(
    padding: const EdgeInsets.all(8.0),
    color: const Color(0xFF7F7F7F),
    child: const Text('Quarter'),
  ),
)

Implementation

Transform.translate({
  super.key,
  required Offset offset,
  this.transformHitTests = true,
  this.filterQuality,
  super.child,
}) : transform = Matrix4.translationValues(offset.dx, offset.dy, 0.0),
     origin = null,
     alignment = null;