我正在尝试实现与 flutter 频道上一周视频小部件中显示的效果非常相似的效果:https : //www.youtube.com/watch?v= dYRs7Q1vfYI#t =1m20s
在右侧,您会看到所需的结果,在左侧,您会看到我的应用程序中当前正在发生的事情。

我一直在使用的代码与示例视频中的代码非常相似,使用堆栈将背景滤镜放置在我的图像上。圆形图像及其上的模糊位于一个小部件中,该小部件将放置在另一个堆栈中(与底部的文本一起)。由于我只应用了图像的一小部分过滤器,我不明白为什么整个应用程序都是模糊的。这是图像小部件的代码:
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size.width - 75;
return Container(
height: size,
width: size,
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Image(imageUri: "...", size: size - 30), // this is just a container with the image
Positioned(
top: 100,
left: 100,
bottom: 100,
right: 100,
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 5,
sigmaY: 5,
),
child: Container(
color: Color(0x66FF0000),
),
),
)
],
),
);
}
}
Run Code Online (Sandbox Code Playgroud) ImageFiltered和之间有什么区别BackdropFilter,它们似乎都做同样的工作。我应该选择哪一个?