【发布时间】:2022-12-01 16:41:24
【问题描述】:
我只想有一个模糊的圆圈,但这是不可能的,圆圈的外部,即 Container 完全模糊。 CustomPoint 也是如此。
代码:
Center(
child: Stack(alignment: Alignment.center, children: [
Image.network(
"https://mojekooh.com/wp-content/uploads/2020/09/1024px-Matterhorn_from_Domh%C3%BCtte_-_2.jpg"),
ClipRRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(
width: 200,
height: 100,
decoration: const BoxDecoration(
color: Color.fromARGB(33, 255, 0, 0),
shape: BoxShape.circle),
),
),
)
]),
),
我搜索了互联网但没有找到任何东西
更新:
我的朋友们,我解决了这个问题:
Stack(alignment: Alignment.center, children: [
Image.network(
"https://mojekooh.com/wp-content/uploads/2020/09/1024px-Matterhorn_from_Domh%C3%BCtte_-_2.jpg"),
ClipOval(
clipper: CoustomCircle(),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(
width: 200,
height: 200,
decoration: const BoxDecoration(
color: Color.fromARGB(57, 255, 0, 0),
shape: BoxShape.circle),
),
),
)
]),
class CoustomCircle extends CustomClipper<Rect> {
@override
Rect getClip(size){
return const Rect.fromLTWH(0, 0, 200, 200);
}
@override
bool shouldReclip(oldClipper){
return true;
}
}
【问题讨论】:
-
你能包括你想要的图像吗?