Dart PI (radians) and Rotation in Flutter

Created At: 2024-03-05 16:00:01 Updated At: 2024-03-05 16:06:01

Dart PI (π) and Rotation in Flutter given with example. We should start with the question, what's pi (π)? . 

This π refers to rotation of a cirlce. One π refers 180 rotation which half of a circle. So refers to 360 rotation or angle. 

π (pi) is actually radian. So here we see 90 degree is 1.57 (radian). Now we will how to use this radian in Flutter Transform.rotate() widget.

Within Transform.rotate() we see angle property. Here we put angle 90 is equal 1.57 radian which is derived from is 360 angle.

So if we want to rotate an object, icon or image, using Transform.rotate() is the way to go and just change angle based on 2π equal 360 .

Comment

Add Reviews