給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為線條寬度