Furkan Sarihan
Furkan Sarihan

Reputation: 166

Flutter switch rotated but only visually

I got a Cupertino Switch in my Flutter app. I wanted to use this Switch Widget vertically.

When I use "Transform.rotate()" It rotates but when it comes to work; It logically stayes the same layout, horizontally.

So rotation just works visually. Is there any way to change the logical orientation of any flutter object?

child: Transform.rotate(
              angle: -3.14 / 2, // -90 degree, vertical
              child: new CupertinoSwitch(
                value: activity,
                onChanged: (bool value) {
                  setState(() {
                    ...
                  });
                },
              ),
            ),

Upvotes: 1

Views: 1038

Answers (1)

user17182544
user17182544

Reputation:

A RotatedBox() widget should do the trick.

Upvotes: 1

Related Questions