简体   繁体   English

更改 DropdownButton 菜单的阴影颜色

[英]Change the shadow color of the DropdownButton menu

Is it possible to change the shadow color of the DropdownButton menu?是否可以更改 DropdownButton 菜单的阴影颜色?

下拉按钮菜单

Wrap the drop-down button with a container and add shadow to it.用容器包裹下拉按钮并为其添加阴影。 Make the elevation of drop-down button to 0使下拉按钮的高度为0

add decoration for dropdownButton and set color for shadow this the example:为 dropdownButton 添加装饰并为阴影设置颜色,例如:

decoration: BoxDecoration(
    color: Colors.white,
    borderRadius: BorderRadius.only(
      topLeft: Radius.circular(10),
        topRight: Radius.circular(10),
        bottomLeft: Radius.circular(10),
        bottomRight: Radius.circular(10)
    ),
    boxShadow: [
      BoxShadow(
        color: Colors.grey.withOpacity(0.5),
        spreadRadius: 5,
        blurRadius: 7,
        offset: Offset(0, 3), // changes position of shadow
      ),
    ],
  ),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM