gpt4 book ai didi

flutter - 如何在Flutter中渲染HTML标签并限制行数

转载 作者:行者123 更新时间:2023-12-03 04:44:50 27 4
gpt4 key购买 nike

我现在想限制行数并在 flutter 中渲染 html 标签 我正在使用文本小部件和限制行数。问题是我在我的 rest full api 中获取 html 标签,所以我想呈现这些标签。我尝试了 flutter html 包,但没有限制行数的选项。谢谢

 Container(
padding: EdgeInsets.symmetric(horizontal:10.0),
margin: EdgeInsets.only(bottom:10.0),
child: Text(
widget.description,
style:plpDescriptionTextstyle,
maxLines: 4,
),
),

最佳答案

您可以在这个库中使用样式:

Html(
data: 'Your text with html tag',
style: {
'#': Style(
fontSize: FontSize(18),
maxLines: 10,
textOverflow: TextOverflow.ellipsis,
),
},
),

关于flutter - 如何在Flutter中渲染HTML标签并限制行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62505075/

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