我想在我的文本小部件中设置最多 2 行,还需要在行尾设置“...”(椭圆)
Container(
height: 100,
alignment: Alignment.topLeft,
child: Text("${news.newsDetails}"),
)
最佳答案
使用maxLines
和overflow
Text(
'${model.title}',
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
关于 flutter : How to set maxLine in Text widget,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59233349/