How to rotate material icon in flutter without animation?
Another solution is:
RotatedBox(
quarterTurns: 2,
child: IconButton(
icon: Icon(
Icons.details,
color: Colors.white,
),
onPressed: null,
),
),
Transform.rotate(
angle: 180 * pi / 180,
child: IconButton(
icon: Icon(
Icons.details,
color: Colors.white,
),
onPressed: null,
),
),
You can wrap your IconButton
in a Transform
widget using the rotate constructor:
import 'dart:math' as math;
Transform.rotate(
angle: 180 * math.pi / 180,
child: IconButton(
icon: Icon(
Icons.details,
color: Colors.white,
),
onPressed: null,
),
),
If you want to rotate icons like arrow_forward_ios, could help following code.
icon: Transform.rotate(
angle: 90 *math.pi /180,
child: Icon(Icons.arrow_forward_ios,
color: Colors.white,size: 18,),,