Cliff Odebala Clarke
Cliff Odebala Clarke

Reputation: 208

Flexible or Expanded Couldn't Fix A RenderFlex overflowed by 2519 pixels on the right Error

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

Answers (1)

A-E
A-E

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

Related Questions