square static method
Widget
square({
- required Color currentColour,
- required ValueChanged<
Color> onColorChanged, - HSVColour? pickerHsvColor,
- ValueChanged<
HSVColor> ? onHsvColorChanged, - PaletteType paletteType = PaletteType.hueWheel,
- bool enableAlpha = true,
- bool showLabel = true,
- List<
ColorLabelType> labelTypes = const [ColorLabelType.rgb, ColorLabelType.hex], - bool displayThumbColor = true,
- bool portraitOnly = false,
- double colorPickerWidth = 300,
- double pickerAreaHeightPercent = 1.0,
- bool hexInputBar = false,
- TextEditingController? hexInputController,
- BorderRadius? pickerAreaBorderRadius,
- List<
Color> ? colorHistory, - ValueChanged<
List< ? onHistoryChanged,Color> >
Creates a square palette colour picker.
The square renders a 2D gradient based on the chosen paletteType. For
instance, PaletteType.hsvWithHue shows saturation on the X-axis and
value on the Y-axis, with a separate hue slider alongside.
paletteTypeselects which two components are shown on the square axes and which one gets its own slider.colorPickerWidthsets the width (and, viapickerAreaHeightPercent, the height) of the palette area.colorHistoryandonHistoryChangedenable a tappable history strip of previously selected colours.
Implementation
static Widget square({
required Color currentColour,
required ValueChanged<Color> onColorChanged,
HSVColour? pickerHsvColor,
ValueChanged<HSVColor>? onHsvColorChanged,
PaletteType paletteType = PaletteType.hueWheel,
bool enableAlpha = true,
bool showLabel = true,
List<ColorLabelType> labelTypes = const [
ColorLabelType.rgb,
ColorLabelType.hex,
],
bool displayThumbColor = true,
bool portraitOnly = false,
double colorPickerWidth = 300,
double pickerAreaHeightPercent = 1.0,
bool hexInputBar = false,
TextEditingController? hexInputController,
BorderRadius? pickerAreaBorderRadius,
List<Color>? colorHistory,
ValueChanged<List<Color>>? onHistoryChanged,
}) {
return SquarePicker(
currentColour: currentColour,
onColorChanged: onColorChanged,
pickerHsvColor: pickerHsvColor,
onHsvColorChanged: onHsvColorChanged,
paletteType: paletteType,
enableAlpha: enableAlpha,
showLabel: showLabel,
labelTypes: labelTypes,
displayThumbColor: displayThumbColor,
portraitOnly: portraitOnly,
colorPickerWidth: colorPickerWidth,
pickerAreaHeightPercent: pickerAreaHeightPercent,
colorHistory: colorHistory,
onHistoryChanged: onHistoryChanged,
);
}