im trying to rotate an image in clockwise (seconds) with smooth animation , this my current code :
Transform.rotate(
angle: _dateTime.second * 6 * pi / 180,
child: Image.asset(
'assets/Clocks/FirstClock/secondhand.png',
),
),
I’ve tried animation builder and rotation transition but I can’t apply the seconds angle to the animation its always inaccurate
2
Answers
I’m Trying to Solve your Problem :
Use Transform.rotate For Rotate image smoothly in clockwise:
Code:
Video
First make a statefulwidget
It takes two parameters the image provider and the duration. Pass the parameterss in the constructor.
In the state class put a animatedController
Then in the initState initialize the controller.
Then inside your build method put
You can finally call the dispose method
To dispose the controller