September 2019
Beginner
512 pages
12h 52m
English
As pointed out before, we can use the Transform.rotate() constructor to add a Transform widget to the widget tree responsible for rotating its child. We can use something like this:
Transform.rotate( angle: -45 * (math.pi / 180.0), child: RaisedButton( child: Text("Rotated button"), onPressed: () {}, ),);
We add a widget that is rotated 315º clockwise (the same as -45º counter-clockwise). The exact same result is achieved using the Transform widget's default constructor and a Matrix4 transformation instead:
Transform( transform: Matrix4.rotationZ(-45 * (math.pi / 180.0)), alignment: Alignment.center, child: RaisedButton( child: Text("Rotated button"), onPressed: () {}, ),);
The arguments we need to provide in order to ...
Read now
Unlock full access