如何将 showModalBottomSheet 设置为全高?
问题描述:
我使用showRoundedModalBottomSheet
,我该如何调整这个模态高度直到appbar?
I use showRoundedModalBottomSheet
, how can I adjust this modal height till the appbar?
答
[更新]
在 showModalBottomSheet(...)
中设置属性 isScrollControlled:true
.
它将使bottomSheet 达到全高.
It will make bottomSheet to full height.
[原答案]
您可以改为实现 FullScreenDialog.
You can Implement the FullScreenDialog instead.
Flutter Gallery 应用有一个 FullDialog 的示例一个>
Flutter Gallery app has an example of FullScreenDialog
您可以使用以下代码打开对话框:
You can open your Dialog using below code:
Navigator.of(context).push(new MaterialPageRoute<Null>(
builder: (BuildContext context) {
return Dialog();
},
fullscreenDialog: true
));
查看此博客 post 了解更多信息:
Check this blog post too for more:
希望能帮到你.