In Flutter, I am trying to change the color of the DropdownButton's icon (the down arrow icon) to white color.
I tried using the style property with no help. The text color became white but the icon is still the default grey.
DropdownButton(
style: TextStyle(color: Colors.white, decorationColor:
Colors.white),
items: this.items,
value: null,
hint: Text(SaveOptions[_saveOption], style: TextStyle(color:
Colors.white)),
onChanged: (selectedOption) {
setState(() {
_saveOption = selectedOption;
});
})
How do I change the color of the arrow icon to white?
You can use the fields iconEnabledColor
and iconDisabledColor
in the following manner:
final myDropDownMenu = DropdownButton<String>(
iconEnabledColor: Colors.white,
iconDisabledColor: Colors.white,
value: myInitialValue,
// The rest of your code
);