只需在 flutter 文档中查找 TextStyle 类即可。我相信在《边界与中风》中你会找到答案。
没有边框属性,但是您可以使用两个重叠的文本来完成这项工作。这是代码
Stack(
children: <Widget>[
// Stroked text as border.
Text(
'WHO',
style: TextStyle(
fontSize: 40,
foreground: Paint()
..style = PaintingStyle.stroke
..strokeWidth = 6
..color = Colors.grey,
),
),
// Solid text as fill.
Text(
'WHO',
style: TextStyle(
fontSize: 40,
color: Colors.red,
),
),
],
)