dart 更改DropdownButton菜单的阴影颜色

7gyucuyw  于 2023-07-31  发布在  其他
关注(0)|答案(3)|浏览(126)

是否可以更改下拉按钮菜单的阴影颜色?


的数据

aiqt4smr

aiqt4smr1#

用容器将下拉按钮包裹起来,并为其添加阴影。将下拉按钮的高程设置为0

whlutmcx

whlutmcx2#

为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
      ),
    ],
  ),

字符串

相关问题