【发布时间】:2018-06-07 09:34:37
【问题描述】:
我想创建一个圆形小部件,它会模糊其背后的背景,如下所示:
new BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
child: new Container(
decoration: new BoxDecoration(shape: BoxShape.circle, color: Colors.lightBlue.withOpacity(0.5)),
child: Text("Something")
)
)
这可行,但在蓝色区域之外的 BoxDecoration 周围的整个矩形显示模糊。所以,我想我会用 ClipOval 把它包起来,像这样:
ClipOval ( child: new BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
child: new Container(
decoration: new BoxDecoration(shape: BoxShape.circle, color: Colors.lightBlue.withOpacity(0.5)),
child: Text("Something")
)
))
不幸的是,这导致没有渲染模糊效果。我错过了什么,还是这是一个颤振的错误?
【问题讨论】:
-
看起来像一个错误,在问题跟踪器上询问这个问题可能是个好主意
标签: flutter imagefilter flutter-layout