I want to invert "icon: Icon(Icons.xxx)"
in Flutter.
TopRight and bottmoLeft.
//TopLeft
Transform.rotate(
angle: 180 * pi / 180,
child: IconButton(
onPressed: () {
setState(() {});
},
icon: Icon(Icons.branding_watermark)),
),
//TopRight
IconButton(
onPressed: () {
setState(() {});
},
icon: Icon(Icons.branding_watermark)),
//bottomLeft
IconButton(
onPressed: () {
setState(() {});
},
icon: Icon(Icons.branding_watermark)),
//bottomRight
IconButton(
onPressed: () {
setState(() {});
},
icon: Icon(Icons.branding_watermark)),
5
Answers
That should be what you ask:
This is the result when I execute on dartpad:
You could use scale instead of rotate:
By making scaleX negative, you can flip it over horizontally, and by making scaleY negative, you can flip it over vertically.
This can be done by using two transforms:
Use the transform widget instead because it has more advanced property like matrix rotation.
Top right : –
Output : –
Bottom left : –
Output : –
The 2 remaining button: