Home > Software design >  Change the shadow color of the DropdownButton menu
Change the shadow color of the DropdownButton menu

Time:06-13

Is it possible to change the shadow color of the DropdownButton menu?

DropdownButton menu

CodePudding user response:

Wrap the drop-down button with a container and add shadow to it. Make the elevation of drop-down button to 0

CodePudding user response:

add decoration for dropdownButton and set color for shadow this the example:

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
      ),
    ],
  ),
  • Related