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

问题描述

我想在 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

Just wrap your Dialog inside 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

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

07-16 18:37
查看更多