gpt4 book ai didi

flutter : How to set maxLine in Text widget

转载 作者:行者123 更新时间:2023-12-04 10:55:28 26 4
gpt4 key购买 nike

我想在我的文本小部件中设置最多 2 行,还需要在行尾设置“...”(椭圆)

Container(
height: 100,
alignment: Alignment.topLeft,
child: Text("${news.newsDetails}"),
)

最佳答案

使用maxLinesoverflow

    Text(
'${model.title}',
maxLines: 2,
overflow: TextOverflow.ellipsis,
),

关于 flutter : How to set maxLine in Text widget,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59233349/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com