对话框抖动后的背景模糊吗? [英] Blur background behind dialog flutter?

查看:63
本文介绍了对话框抖动后的背景模糊吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在SimpleDialog类上的对话框后面实现模糊背景.我正在寻找的与此类似的东西,只是扑朔迷离.

I want to achieve blur background behind dialog on SimpleDialog class. What I'm looking for is something similar to this, but for flutter.

Github Android项目

我已经检查了这个问题,但这是关于对话框的,我想在SimpleDialog上实现它.

I already checked this question, but this is about the Dialog, I want to implement it on SimpleDialog.

推荐答案

只需将Dialog包装在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

这篇关于对话框抖动后的背景模糊吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆