Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 获取同时带有下划线和删除线的文本_Flutter_Flutter Text - Fatal编程技术网

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]),