US Office

1176 Shadeville Rd, Crawfordville Florida 32327, USA

 +1 (850) 780-1313

India Office

Office No 405, Kabir Shilp, Opp. Kansar Hotel, Opp. Landmark, Kudasan, Gandhinagar, Gujarat 382421

[email protected]

RotatedBox Widget – Flutter Widget Guide By Flutter Agency

RoatedBox-widget

RotatedBox Widget – Flutter Widget Guide By Flutter Agency

What is RotatedBox Widget in Flutter?

RotatedBox Widget in Flutter rotated image, text, button other widgets. quarter turns is used to the rotated position.

RotatedBox Widget will only as much as required space by the rotated child.

The constructor of RotatedBox will look like below :

 RoatedBox({
    Key key,
    @required int quarterTurns,
    Widget child,
  });

In the above Constructor, the quarter turns argument must not be null.

Properties:

  • Key key: The widget key, used to control if it’s should be replaced.
  • int quarterTurns: The number of clockwise quarter turns the child should be rotated.
  • Widget Child: The widget below this widget in the tree. Child Property will have only one child. To allocate multiple users needs to make use of Row Widget or Column Widget and wrap the child in it.

Code Snippet for it will look like below :

RotatedBox(
        quarterTurns: 3,
        child:// To do
)

How to use RotatedBox Widget in Flutter?

The following code snippet tells us how to implement RotatedBox  in Flutter.

import 'package:flutter/material.dart';

class RoatedBoxWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: RotatedBox(
        quarterTurns: 3,
        child: Text(
          'RoatedBox Example ',
          style: TextStyle(
            fontSize: 55,
            fontWeight: FontWeight.bold,
            letterSpacing: 0,
          ),
        ),
      ),
    );
  }
}

We will get Output like below:

roated-Box

RotatedBox

Conclusion:

In this article, we have been through What is RotatedBox Widget in Flutter along with how to implement it in a Flutter.

Thanks for reading !!!

Do let us know your feedback/suggestion to serve you better.

FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget GuideFlutter ProjectsCode libs and etc.

FlutterAgency.com is one of the most popular online portal dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge on Flutter.

Post a Comment