【发布时间】:2020-11-11 03:15:51
【问题描述】:
我在 LimitedBox 中使用来自 flutter_markdown 的 MarkdownBody。当按下“显示更多”按钮时,maxHeight 设置为 double.infinity 并显示全文:
LimitedBox(
maxHeight:
showMoreCommentsIds
.contains(
commentId)
? double.infinity
: 100,
child: Wrap(
direction:
Axis.horizontal,
children: <Widget>[
MarkdownBody(
data: showList[index]
.comment
.comment,
)
],
),
),
但是如果有必要,我怎样才能找出文本的高度并只显示“显示更多”按钮?
【问题讨论】:
标签: flutter