简体   繁体   中英

How to apply backdrop filter to the entire screen but less a specific widget in flutter?

I want to make a cool tutorial dialog box. I want to have a black backdrop filter in the entire screen, but less the popup and the part of the screen that I want to highlight. How can I do that?

Wrap the dialog with the BackDropFilter

return new BackdropFilter(
    filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
    child: Dialog(
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)),
      backgroundColor: Color(ColorResources.BLACK_ALPHA_65),
      child: _dialogContent(),
    )
);

Widget _dialogContent() {}//Your dialog view

reference link

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