Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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_Textfield_Blur - Fatal编程技术网

Flutter 文本字段中的模糊文本

Flutter 文本字段中的模糊文本,flutter,textfield,blur,Flutter,Textfield,Blur,有没有一种简单的方法来模糊文本字段?容器上通常的模糊效果与立面结合使用时会产生不必要的副作用 这根本不起作用: Stack( children: [ Container( child: Text("Text to hide") ), BackdropFilter( filter: ImageFilter.blur( sigmaX: 5, sigmaY: 5, ), ch

有没有一种简单的方法来模糊文本字段?容器上通常的模糊效果与立面结合使用时会产生不必要的副作用

这根本不起作用:

Stack(
  children: [
    Container(
      child: Text("Text to hide")
    ),
    BackdropFilter(
      filter: ImageFilter.blur(
        sigmaX: 5,
        sigmaY: 5,
      ),
      child: Container(
        color: Colors.black.withOpacity(0.8),
      ),
    ),
  ],
),

您可以对
文本样式的
前景
使用
绘画

Text(
          'text to hide',
          style: TextStyle(
              fontSize: 36,
              foreground: Paint()
                ..style = PaintingStyle.fill
                ..color = Colors.grey
                ..maskFilter = MaskFilter.blur(BlurStyle.normal, 6)),
        ),
结果:

试试这个

            Stack(
              children: [
                Container(
                    child: Text("Text to hide")
                ),
                BackdropFilter(
                  filter: ImageFilter.blur(
                    sigmaX: 2,
                    sigmaY: 2,
                  ),
                  child: Container(
                    color: Colors.transparent,
                    height: 25,
                  ),
                ),
              ],
            ),


谢谢你的例子。由于backdropfilter的工作方式,这似乎不能在完整的UI中正常工作。或者我就是不能正确地使用它。