Reputation: 2043
I know how to use ellipsis with the Text widget. overflow: TextOverflow.ellipsis
does the job very well. But my problem is it actually displays only one line. I am trying to make a layout something similar to the below image:
How to do this in Flutter?
It is a common layout and it is sad that it isn't documented anywhere :(
Upvotes: 1
Views: 7432
Reputation: 3232
use overflow
in addition to maxlines
. if you need to adhere to a really tight fixed height then you can easily calculate what maxlines should be based upon your font size.
Text(
'my super long string',
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 3,
),
Upvotes: 5