'TextOverflow.ellipsis but on the y-axis of the Text Widget
I am building a constrained maximum height column widget that contains two separate text paragraphs as its children.
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child:
Text(
text1,
style: style1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
maxLines: 2,
),
),
Expanded(
child: Text(
text2,
overflow: TextOverflow.ellipsis,
style: bodyText,
textAlign: TextAlign.justify,
softWrap: false,
maxLines: 10,
)
)
],)
When the content in one of the Text widgets becomes too large to fit into the content area, the widget clips the text along its bottom border:
I would want to see the text clipped at the leading (i.e. interline spacing) instead, with an extra ellipsis indicating the omission of the content that did not fit into that widget.
Are there any simple solutions or should I build a custom widget that compares a text area with font sizes?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|