onColorChanged property
Required ValueChanged callback, called when user selects a new color with new color value.
Called every time the color value changes when operating thumbs on the color wheel or color or transparency sliders
Changing which picker type is viewed does not trigger this callback, it is not triggered until a color in the viewed picker is selected.
The picker passes the new value to the callback but does not actually change state until the parent widget rebuilds the color picker with the new value.
The callback provided to onColorChanged should update the state of the parent StatefulWidget using the State.setState method, so that the parent gets rebuilt; for example:
ColorPicker(
color: _pickerColor,
onChanged: (Color color) {
setState(() {
_pickerColor = color;
});
},
)
Implementation
final ValueChanged<Color> onColorChanged;