-
Notifications
You must be signed in to change notification settings - Fork 230
Open
Description
I have a HueRingPicker in which I have enabled alpha. When the hex color is displayed the alpha channel value is shown as the last characters of the TextField, when instead alpha value should be always the first when enabled.
the current code that does it
textEditingController.text = '#' +
widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0') +
widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0') +
widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0') +
(widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : '');
The solution is easy, just move the line up
if (inputColor != widget.color.value) {
// ignore: prefer_interpolation_to_compose_strings
textEditingController.text = '#' +
(widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : '') +
widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0') +
widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0') +
widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0') ;
}
Metadata
Metadata
Assignees
Labels
No labels