【发布时间】:2021-05-25 08:44:08
【问题描述】:
我有一个 TextSpan(参见下面的代码)。我想计算文本的宽度,以便将文本居中对齐。
我该怎么做?
final textSpan = TextSpan(
text: ' $title ',
style: TextStyle(
color: titleColor,
fontSize: fontSize,
height: 1.0,
backgroundColor: backgroundColor,
),
);
【问题讨论】: