1

I want to change the background color and border radius of DropDownButton,

i have tried it with theme but it changes the color of dropdown list not the button.

 Theme(
    data: Theme.of(context).copyWith(canvasColor: Colors.blue),
          child: DropdownButton(
                     items: [DropdownMenuItem(child: Text('one'))],
                     onChanged: (newvlaue) {}),
                        )

what i want:
enter image description here

what i get:
enter image description here

Saad
  • 539
  • 2
  • 19
  • Does this answer your question? [How should I customize DropdownButtons and DropdownMenuItems in Flutter?](https://stackoverflow.com/questions/46530527/how-should-i-customize-dropdownbuttons-and-dropdownmenuitems-in-flutter) – tomerpacific Apr 30 '23 at 07:40
  • @tomerpacific no, they are changing background color of dropdown list not the button – Saad Apr 30 '23 at 07:46

1 Answers1

1

if you want to change the color of the button and add a radius you can wrap the dropdown button with a container.

dropdown button wrapped with a container