3

I have a Text widget where I put some text in (title of games), but some game titles hit the max width of the screen (A RenderFlex overflowed by 77 pixels on the right. for example). How can I put that the text just continues underneath?

Issue:

enter image description here

I want to have it like this:

|Im a very long title |
|that does not fit.   |

EDIT:

The Text widget is in a Row Widget which exists in a Column Widget.

1 Answer 1

8
Row(
  children: <Widget>[
    SomeOtherWidget(),
    Expanded( // add this
      child: Text(
        "This is a long text",
        maxLines: 2, // you can change it accordingly
        overflow: TextOverflow.ellipsis, // and this
      ),
    ),
  ],
)

Wrap your Text in Expanded and set overflow property.

1
  • This did it! Thanks.
    – rafbanaan
    Commented Aug 31, 2019 at 20:46

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.