Flutter 获取同时带有下划线和删除线的文本
对于文本小部件,我们可以将文本装饰用于Flutter 获取同时带有下划线和删除线的文本,flutter,flutter-text,Flutter,Flutter Text,对于文本小部件,我们可以将文本装饰用于删除或下划线 style: TextStyle(decoration: TextDecoration.lineThrough), style: TextStyle(decoration: TextDecoration.underline), 有什么办法可以在文字装饰中同时获得两者?或者有什么办法可以解决盒子的装饰问题?我尝试过,但没有成功。一个可能的解决方案是像这样使用容器: Container( child: Text(
删除
或下划线
style: TextStyle(decoration: TextDecoration.lineThrough),
style: TextStyle(decoration: TextDecoration.underline),
有什么办法可以在文字装饰中同时获得两者?或者有什么办法可以解决盒子的装饰问题?我尝试过,但没有成功。一个可能的解决方案是像这样使用
容器:
Container(
child: Text(
'This text has underline as well as linethrough',
style: TextStyle(decoration: TextDecoration.lineThrough),
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: const Color(0xFF000000),
),
),
),
),
输出:
Container(
child: Text(
'This text has underline as well as linethrough',
style: TextStyle(decoration: TextDecoration.lineThrough),
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: const Color(0xFF000000),
),
),
),
),
使用联合收割机instade
Text(
"Hello world!",
style: TextStyle(
decoration: TextDecoration.combine(
[TextDecoration.underline, TextDecoration.lineThrough]),
),
)
您需要添加
装饰
在文本小部件中执行此操作:
以下是一个例子:
decoration: TextDecoration.combine(
[TextDecoration.underline, TextDecoration.lineThrough]),