How to limit text length in flutter?

Posted by Jennifer | Updated on

How to limit text length in flutter?

If you want to use your RichText Widget inside a Row and prevent the overflow with an ellipsis, you first have to wrap it inside a Flexible. The Flexible shows the Row that the RichText can be shrinked.

After wrapping the RichText inside a Flexible, simply add overflow: TextOverflow.ellipsis to your RichText. Here a minimal example with a RichText inside an Flexible inside a Row.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers