I’m having a problem making a portion of a widget to be blurred (I’m using a stack).
return Scaffold(
body: Stack(
children: [
Padding(
//sth very nice
),
Positioned(
top: 0,
bottom: height*0.85,
right: 0,
left: 0,
child: BackdropFilter(
filter: ui.ImageFilter.blur(
sigmaX: 5, sigmaY: 5,
),
child: Container(color: Colors.transparent,)
),
)
],
),
);
What I want is a little blurred area at the top of my page, that covers the below widget (in this case, the content of the padding).
Actually, what I have is that the blurring effect covers all the screen and this is very interesting because in my stack I have a Positioned
widget with a precise dimension. It seems like the blurring effect goes over the limits …
2
Answers
wrap the stack widget with ClipRect widget
As you said
I try to implement what you try to achieve, i don’t think it’s exactly correct, but may this can give you an idea of how this blur works.
The output