dart - 如何将 showModalBottomSheet 设置为全高?

标签 dart flutter

我使用 showRoundedModalBottomSheet,如何调整此模态高度直到 appbar?

enter image description here

最佳答案

[更新]

showModalBottomSheet(...)中设置属性isScrollControlled:true

它将使bottomSheet达到全高。


[原答案]

您可以改为实现 FullScreenDialog。

Flutter Gallery 应用有一个 FullScreenDialog 的示例

您可以使用以下代码打开对话框:

Navigator.of(context).push(new MaterialPageRoute<Null>(
      builder: (BuildContext context) {
        return Dialog();
      },
    fullscreenDialog: true
  ));

查看此博客 post还有更多:

希望对你有所帮助。

关于dart - 如何将 showModalBottomSheet 设置为全高?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53311553/

相关文章:

android - 如何在flutter中使用firebase登录谷歌时检查用户是新用户还是现有用户?

google-maps - 如何将HeatMaps添加到Flutter Mobile应用程序

flutter - 当按钮的highlightColor更改时,是否可以更改FlatButton内部的文本颜色?

dart - Flutter Positioned Transitioned to below other Stack child - 如何获得高度?

dart - 在 Dart 中将类静态工厂作为方法参数传递

flutter - 如何在 Flutter/Dart 中创建异步回调?

flutter - 定义通过在外部单击关闭 AlertDialog 时的操作

flutter - 如何根据给定的行号从0开始删除dart中的特定行

flutter - 数据未显示在 ListView flutter 中

android - 在构建Home()时引发了以下NoSuchMethodError:在null上调用了 '>'方法。接收方:null尝试调用:>(1)