Home > Software design >  How to change the background color in DropDownButton?
How to change the background color in DropDownButton?

Time:08-04

I watched the enter image description here

CodePudding user response:

When the DropdownButton is on focused, it uses focusColor. For the long press it uses the splashColor. Yo can wrap with Theme and provide splashColor.

Theme(
  data: ThemeData(
    splashColor: Colors.green,
  ),
  child: DropdownButton<String>(
    dropdownColor: Colors.pink, // main bg 
    focusColor: Colors.amber,// when focused
    value: dropdownValue,
  • Related