如何从 Flutter 中的 ModalBottomSheet 更改投影(或阴影)

How to change the drop shadow (or shade) from a ModalBottomSheet in Flutter

ModalBottomSheet 会自动在底层屏幕上呈现阴影。

showModalBottomSheet 方法中将背景颜色设置为透明仅影响包含子部件的区域。
它不会删除模态下的阴影。

我可以删除或更改阴影的不透明度吗?

如果你想增加或减少阴影,你可以改变 elevation:

showModalBottomSheet<void>(
    elevation: 2.0,
      context: context,
      builder: (BuildContext context) {

0表示没有阴影,使用2.0的倍数

showModalBottomSheet(
        barrierColor: Colors.white.withOpacity(0),
...

请注意,我使用的是 属性 'barrierColor'