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?
Steps to change icon color in FlutterStep 1: Locate the file where you have placed the Icon widget. Step 2: Inside the Icon , add color parameter and set the color of your choice. Step 3: Run your app.
How do I change the icon color on my floating action button flutter? To change floating action button background color in Flutter, add a backgroundColor property to the FloatingActionButton widget. To change floating action button icon color, you can add a foregroundColor property and add the required color.
Use DropdownButtonFormField as it has decoration property. You can use prefixIcon attribute to set icon on left side. Save this answer.
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
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With