From f02a3230d59ce19954c7dd91efdec99bc7971252 Mon Sep 17 00:00:00 2001 From: Henri Sauer Date: Sun, 7 Jul 2024 18:17:15 +0200 Subject: [PATCH] Bugfix for an inconsistency in the HueRingPicker: the ColorPickerInput was disabled in landscape mode, but enabled in portrait mode. This commit introduces an extra arg "disableTextInput" in HueRingPicker to disable or enable the ColorPickerInput for both modes. disableTextInput defaults to false, enabling the ColorPickerInput by default. --- lib/src/colorpicker.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/colorpicker.dart b/lib/src/colorpicker.dart index 631ea1c..c3c5a93 100644 --- a/lib/src/colorpicker.dart +++ b/lib/src/colorpicker.dart @@ -653,6 +653,7 @@ class HueRingPicker extends StatefulWidget { this.hueRingStrokeWidth = 20.0, this.enableAlpha = false, this.displayThumbColor = true, + this.disableTextInput = false, this.pickerAreaBorderRadius = const BorderRadius.all(Radius.zero), }) : super(key: key); @@ -663,6 +664,8 @@ class HueRingPicker extends StatefulWidget { final double hueRingStrokeWidth; final bool enableAlpha; final bool displayThumbColor; + /// Disables the ability to manually edit the ColorPicker TextInput Field + final bool disableTextInput; final BorderRadius pickerAreaBorderRadius; @override @@ -746,6 +749,7 @@ class _HueRingPickerState extends State { }, enableAlpha: widget.enableAlpha, embeddedText: true, + disable: widget.disableTextInput, ), ), ), @@ -790,7 +794,7 @@ class _HueRingPickerState extends State { }, enableAlpha: widget.enableAlpha, embeddedText: true, - disable: true, + disable: widget.disableTextInput, ), if (widget.enableAlpha) const SizedBox(height: 5), if (widget.enableAlpha)