This was trickier to get right than I originally thought. Some issues I ran into:
In the original version the color chooser button background had the theme.baseColor, but I decided to remove this because it did not work well with the focused border of the button. Therefore the color input had to be made invisible inside a label so that it is invoked when the button is pressed. The button's padding also needed to be set to 0 explicitly.
The Input value binding did not work because it made an internal copy of the value in a state variable (inputValue) but it never updated the bound value. I fixed it by simply using the value.
There is a line that takes theme.mode and stores it in a derived value which is not used, but if that line is removed then the dropdown does not appear. It would be good to understand why and how to fix this.
This was trickier to get right than I originally thought. Some issues I ran into:
theme.baseColor
, but I decided to remove this because it did not work well with the focused border of the button. Therefore the color input had to be made invisible inside a label so that it is invoked when the button is pressed. The button's padding also needed to be set to 0 explicitly.Input
value binding did not work because it made an internal copy of the value in a state variable (inputValue
) but it never updated the bound value. I fixed it by simply using thevalue
.theme.mode
and stores it in a derived value which is not used, but if that line is removed then the dropdown does not appear. It would be good to understand why and how to fix this.