September 2019
Beginner
512 pages
12h 52m
English
As previously pointed out, we have two ways to add multiple transformations to widgets. The first is by adding multiple Transform widgets above the desired widget:
Transform.translate( offset: Offset(70, 200), child: Transform.rotate( angle: -45 * (math.pi / 180.0), child: Transform.scale( scale: 2.0, child: RaisedButton( child: Text("multiple transformations"), onPressed: () {}, ), ), ),);
As you can see, we add a Transform widget as a child to another Transform widget, composing the transformation. Although simpler to read, this method has a drawback: we add more widgets than needed to the widget tree.
Read now
Unlock full access