The translate transformation is more likely to appear in animations (see Chapter 15, Animations). By using the Transform.translate() constructor, we move the widget around the screen:
And this is what the Transform.translate() factory constructor looks like:
Transform.translate({
Key key,
@required Offset offset,
bool transformHitTests: true,
Widget child
})
Here, we have even fewer properties compared to previous transformations. The differences are as follows:
- The absence of the transform and alignment properties: The transformation will be applied by the offset value, so we do not need the transform matrix.
- Offset: This time, offset simply specifies the translation to be applied on the child widget; this is different from the previous transformations, where it affects the origin point of the applied transformation.