我正在使用 Modal Bottom 工作表,想要给出模糊的背景,但参数Barriercolor的类型是 Color,所以我不能使用 BackdropFiter()。有谁知道如何为模态底板实现模糊背景?
iwp*_*wpz 15
更新:
抱歉我的粗心。
您可以在 中设置backgroundColor:Colors.transparent并expand:true制作自己的。barrierbuilder
它可能看起来像这样:
showMaterialModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
expand: true,
builder: (context) => BackdropFilter(
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
height: 200,
width: MediaQuery.of(context).size.width,
color: Colors.white,
child: Text('Im child'),
)
],
),
),
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7462 次 |
| 最近记录: |