flutter - Move showModalBottomSheet to the top
问题描述
Is there a way to move showModalBottomSheet 75pixels to the top so it doesnt block my bottom menu? I tried to give my Container padding but it doesn't work.
解决方案
我编辑了 bottom_sheet.dart 文件并在这部分代码中添加了 -75.0
@override
Offset getPositionForChild(Size size, Size childSize) {
return Offset(0.0, size.height - childSize.height * progress - 75.0);
}
这成功了,但是,动画仍然从底部开始。不确定我是否喜欢。
推荐阅读
- algorithm - 时间复杂度:对 log 和 floor 函数的概念感到困惑
- repository - Sonatype Nexus OSS 3 - 启用上传快照
- python - ModuleNotFoundError:即使在安装之后,Docker 容器中也没有名为“flask_login”的模块
- python - 带有 `yield` 的外部函数的 PEP 342 代码片段。不再支持了吗?
- python - Does a dictionary of numpy arrays really use less memory than an ndarray?
- vue.js - 当我将道具值传递给组件时,道具值变为“app” - VueJS
- prometheus - 如何在普罗米修斯 go_client 中公开示例
- arrays - 数组 vs 记录,动态下标 vs 静态字段
- go - Fyne List 小部件无法正确显示项目
- react-native - 设置状态后未调用函数