如何将 showModalBottomSheet 设置为全高? [英] how to set showModalBottomSheet to full height?

查看:25
本文介绍了如何将 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:

希望能帮到你.

这篇关于如何将 showModalBottomSheet 设置为全高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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