RotatedBox Widget in Flutter

The RotatedBox widget is used to rotate its child by a integral number of quarter turns. It is used to orient it’s child widgets into either horizontal or vertical orientation. Furthermore, it is very lightweight and can be used for designing various UI as it gives flexibility to the user over the Design of the app.


Syntax: RotatedBox({Key key, @required int quarterTurns, Widget child})


  • child: The widget below this widget in the tree.
  • hashCode: The hash code for this object.
  • key: Controls how one widget replaces another widget in the tree.
  • runtimeType: A representation of the runtime type of the object.
  • quarterTurn: This property takes an int value as the object. It controls the number of quarter-turn the object should be rotated.


  • createRenderObject (BuildContext context): This method takes in RenderRotatedBox class (override) as the object. It creates an instance of the RenderObject class.
  • updateRenderObject (BuildContext context, covariant RenderRotatedBox renderObject): This method takes void as the object. This assign the configuration set by RenderObjectWidget to RenderObject.







import 'package:flutter/material.dart';
void main() {
class MyApp extends StatelessWidget {
  // This widget is
  //the root of your application.
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ClipOval',
      theme: ThemeData(
      home: MyHomePAGE(),
      debugShowCheckedModeBanner: false,
class MyHomePAGE extends StatefulWidget {
  _MyHomePAGEState createState() => _MyHomePAGEState();
class _MyHomePAGEState extends State<MyHomePAGE> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('GeeksforGeeks'),
      body: Center(
          child: RotatedBox(
            quarterTurns: 3,
            child: const Text('Hello Geeks!'),
      backgroundColor: Colors.lightBlue[50],
class MyClip extends CustomClipper<Rect> {
  Rect getClip(Size size) {
    return Rect.fromLTWH(0, 0, 100, 100);
  bool shouldReclip(oldClipper) {
    return false;




  1. First initialize the main app as a stateless widget.
  2. Second design the main widget as you desire.
  3. Build the Appbar with the scaffold widget.
  4. Now use the RoatedBox widget inside the body of the scaffold widget and place it inside a center widget.

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Improved By : ankit_kumar_

Article Tags :


Please write to us at to report any issue with the above content.