Skip to content
Discussion options

You must be logged in to vote

Your question is related to how Flutter calculates layout and applies transforms.

At first glance, it feels logical to expect that when you rotate the text, it should fit into the container. However, there is an important nuance here: layout and transform are two separate stages.

Flutter first performs the layout phase, where widget sizes are calculated, and only after that applies the transform (such as rotation). Because of this, rotation does not affect how width and height are calculated.

In your example, the text is rotated by 90 degrees, but its width is still calculated in its original orientation and is constrained by the parent container. That’s why it gets clipped.

If you rotate…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@nelson-python
Comment options

@7576457
Comment options

Answer selected by nelson-python
@nelson-python
Comment options

@ndonkoHenri
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
3 participants