Hey, what’s up, guys. In this post, we are going to learn about RotatedBox in flutter. We will see what it is and how you can use it in your flutter project.
What is RotatedBox in flutter?
RotatedBox is a widget in flutter that rotates its child in turns of 90 degrees. We define how many 90-degree turns to take by passing the quarterTurns parameter to the RoatatedBox widget. 1 quarter-turn equals 90 degrees. The rotation is clockwise. Let’s make it more clear with an example.
In the example code, I have set the quarterTurns to 3, but, to give you a clearer understanding, I have shared the screenshot with qurterTurns set to 2 and quarterTurns set to 1 as well.
In the example code above, I have set the qurterTurns to 3. So, the number of clockwise 90 degrees turns will be three i.e; our text will rotate at 270 degrees(90+90+90) clockwise.
Let’s see the output.
Setting the qurterTurns to 2 (90+90=180 degrees) will give the output like this(Screenshot below).
Setting the quraterTurns to 1 (90 degrees) will give the output like this(Screenshot below).
That’s all about the RotatedBox widget in flutter.