简体   繁体   中英

How to create background blur effect in flutter like the background in Android notification bar when pulled down?

I want to create the following background effect like in Android. I have used Backdrop filter and created the blur effect, but it's not the desired one

!( https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTVNFDRHU59iqXh9Abest7g9uZ5QE4WFbYGgzpJED5w8pCfQkdn )

It's not a blur effect but color opacity.

 Opacity(
            opacity: animation.value * 0.5,
            child: Container(
              height: MediaQuery.of(context).size.height,
              width: MediaQuery.of(context).size.width,
              color: Colors.black,
            ),
          ), 

If you don't need it dynamic you can just use

Container(
              foregroundDecoration: BoxDecoration(
                color: Colors.black.withOpacity(0.5)
              ),
              child: yourChild,
            ),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM