September 2019
Beginner
512 pages
12h 52m
English
In a very similar way, we use the Transform.translate() constructor by adding a Transform widget as a parent of the widget we want to move around:
Transform.translate( offset: Offset(100, 300), child: RaisedButton( child: Text("translated to bottom"), onPressed: () {}, ),);
The default constructor can also be used with Matrix4 specifying the translation:
Transform( transform: Matrix4.translationValues(100, 300, 0), child: RaisedButton( child: Text("translated to bottom"), onPressed: () {}, ),);
We only need to specify the transform property with the Matrix4 instance describing the translation.
Read now
Unlock full access