While searching for overflow detection I came across this post with the first comment very helpful but I would like more detail.
First the case of the text size overflow is stated as a complexe case but is also the more common. And case where Flex
with text overflow is very common too.
Both cases can be resolve using CustomMultiChildLayout
or TextPainter
but these solutions seems very low level for such a common problem.
Here is an example in the following I want the Rate the content
text to disappear:
In this example other possible I might want would be:
- Reduce the size of the text of either the left tabs or the
Rate the content
when overflow - Disappear the
Rate the content
text when overflow but also while the screen reduce even more remove completely thumbs up and thumbs down icons
Maybe I found the source of needing specific behavior when overflow. I know the general web based approach for responsiveness is to have breakpoints based on screen size like in this package. I think flutter is flexible enough to have a per page or even per widget layout base on available space.
I know I can use LayoutBuilder
to make conditional display but it is base on incoming constraints (and thus size in pixels) which is not suitable if there is text involved.
The question is what is a robust way to have conditional display based on overflow or am I trying an anti pattern here ?
Thank you