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.

Sign up to request clarification or add additional context in comments.

1 Comment

This did it! Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.