image.png
给TextStyle里的foreground属性传一个Paint即可:
Text(
'Hello Datou',
style: TextStyle(
fontSize: 45.sp,
fontWeight: FontWeight.w700,
foreground: Paint()
..style = PaintingStyle.stroke
..strokeWidth = 1
..color = Colors.white,
),
)
foreground属性与color互斥,文字颜色要在Paint()中设置
Paint().style要设为PaintingStyle.stroke才有空芯效果
strokeWidth为线条宽度











网友评论