Reputation: 208
My parent container widget uses the Expanded widget and my Text Widgets are not wrapping my texts. I am getting this error: Overflowing or RenderFlex error.
I tried wrapping the Text Widgets with Flexible or Expanded widgets but still, it didn't work.
Flexible(child: Text(postContent)),
Upvotes: 0
Views: 56
Reputation: 3327
Just make sure, your text is a multiline, not displayed on a single line using softWrap : true
.
Expanded(
Text(
postContent,
softWrap : true,
overflow: TextOverflow.ellipsis,
)
)
Note: if that text is very long which exceeds the screen height so, it's preferable to be in a scrollable view. i mean your screen is scrollable. and of course that text should expand horizontally not vertically (that Expanded should be within a row).
Upvotes: 1