我正在尝试在一个容器小部件上实现模糊效果,就像这样:
期望效果:
我尝试使用BackdropFilter
和ImageFilter.blur
滤镜来实现它,但没有任何帮助。
代码:
child: Container(
child: Stack(
children: <Widget>[
BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color
),
height: 60,
width: 60,
),
),
Positioned(
left: 15,
top: 15,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.lightBlue
),
height: 30,
width: 30,
),
),
]
),
)
输出: