![](/img/trans.png)
[英]How to refresh the states of ParentStatefulWidget from ModalBottomSheet in flutter
[英]How to change the drop shadow (or shade) from a ModalBottomSheet in Flutter
ModalBottomSheet 自動在底層 Screen 上呈現陰影或陰影。
在showModalBottomSheet方法中將背景顏色設置為透明只會影響包含子窗口小部件的區域。
它不會刪除模態下的陰影。
我可以刪除或更改陰影的不透明度嗎?
showModalBottomSheet(
barrierColor: Colors.white.withOpacity(0),
...
請注意,我正在使用屬性“barrierColor”
如果你想增加或減少陰影,你可以改變elevation:
showModalBottomSheet<void>(
elevation: 2.0,
context: context,
builder: (BuildContext context) {
0 表示沒有陰影,使用 2.0 的倍數
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.