I am trying to blur only a certain portion of my background in Flutter but my entire background gets blurred. I have a SizedBox in the center of my screen and i would like the background portion of where the SizedBox is laid out to be blurred out.
Here is my code:
return new Container(
decoration: new BoxDecoration(
image: new DecorationImage(
image: new ExactAssetImage("images/barber.jpeg"),
fit: BoxFit.cover
)
),
child: new SizedBox(
height: 200.0,
width: 200.0,
child: new BackdropFilter(
filter: new ui.ImageFilter.blur(
sigmaX: 5.0,
sigmaY: 5.0,
),
child: new Center(
child: new Text("Hi"),
),
),
),
);
}
Here is what happens instead:
I am not even sure why my text is red and has a yellow underlining. What I want is the area of the sizedBox to be blurred only.