'Flutter: How to flip an icon to get mirror effect?
Solution 1:[1]
Before:
After:
import 'dart:math' as math; // import this
Transform(
alignment: Alignment.center,
transform: Matrix4.rotationY(math.pi),
child: Icon(Icons.rotate_left, size: 100,),
)
Solution 2:[2]
The accepted answer works, but to add my two cents, you can use the following:
Transform.scale(
scaleX: -1,
child: Icon(
Icons.rotate_left,
size: 100,
),
)
Same effect, but without an import
statement or any explicit matrices specification
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | CopsOnRoad |
Solution 2 |