From 9b356bc6c7a48ae6782d39ba4900b03670cfc605 Mon Sep 17 00:00:00 2001 From: Daniel Eshkeri Date: Fri, 22 Nov 2024 09:49:01 +0000 Subject: [PATCH] fix: removed rounded from widgetbook fix: removed large thumbs fix: removed defaults to true on showValues --- .../pages/components/range_selector_example.dart | 1 - .../pages/components/range_selector_widgetbook.dart | 2 -- .../components/range_selector/range_selector.dart | 13 +++---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/example/lib/pages/components/range_selector_example.dart b/example/lib/pages/components/range_selector_example.dart index f6add6d0..1820dec1 100644 --- a/example/lib/pages/components/range_selector_example.dart +++ b/example/lib/pages/components/range_selector_example.dart @@ -120,7 +120,6 @@ class _RangeSelectorExampleState extends State { min: 0, max: 100, label: 'Label', - semanticLabel: 'Hello World!', ), ].gap(12), ), diff --git a/example/widgetbook/pages/components/range_selector_widgetbook.dart b/example/widgetbook/pages/components/range_selector_widgetbook.dart index fe5d46fd..3c8bd50d 100644 --- a/example/widgetbook/pages/components/range_selector_widgetbook.dart +++ b/example/widgetbook/pages/components/range_selector_widgetbook.dart @@ -24,8 +24,6 @@ class RangeSelectorExample extends StatelessWidget { divisions: context.knobs.intOrNull.input(label: 'Divisions', initialValue: null), showValues: context.knobs.boolean(label: 'Show Values', initialValue: true), onChange: disabledKnob(context) ? null : (value) {}, - largeSliderThumbs: context.knobs.boolean(label: 'Large Slider Thumbs', initialValue: false), - rounded: context.knobs.booleanOrNull(label: 'Rounded', initialValue: true), initialValues: context.knobs.range(label: 'Initial Range', initialValue: RangeValues(20, 80)), min: context.knobs.double.input(label: 'Min', initialValue: 0), max: context.knobs.double.input(label: 'Max', initialValue: 100), diff --git a/lib/src/components/range_selector/range_selector.dart b/lib/src/components/range_selector/range_selector.dart index 7db9526c..de14fe8e 100644 --- a/lib/src/components/range_selector/range_selector.dart +++ b/lib/src/components/range_selector/range_selector.dart @@ -21,7 +21,6 @@ class ZetaRangeSelector extends ZetaStatefulWidget { this.divisions, this.semanticLabel, this.showValues = true, - this.largeSliderThumbs = false, }) : assert( min <= initialValues.start && initialValues.start <= initialValues.end && initialValues.end <= max, 'The start value must be less than or equal to the end value, and both must be within the range of min and max.', @@ -51,13 +50,8 @@ class ZetaRangeSelector extends ZetaStatefulWidget { final String? semanticLabel; /// Whether to show the values of the range selector. - /// Defaults to true. final bool showValues; - /// Whether to use larger slider thumbs. - /// Defaults to false. - final bool largeSliderThumbs; - @override State createState() => _ZetaRangeSelectorState(); @@ -72,8 +66,7 @@ class ZetaRangeSelector extends ZetaStatefulWidget { ..add(IntProperty('divisions', divisions)) ..add(StringProperty('semanticLabel', semanticLabel)) ..add(DiagnosticsProperty('showValues', showValues)) - ..add(DiagnosticsProperty('initialValues', initialValues)) - ..add(DiagnosticsProperty('largeSliderThumbs', largeSliderThumbs)); + ..add(DiagnosticsProperty('initialValues', initialValues)); } } @@ -221,12 +214,12 @@ class _ZetaRangeSelectorState extends State { /// Thumbs overlayShape: _DrawThumbOverlay( - size: widget.largeSliderThumbs ? spacing.xl_3 / 2 : spacing.xl / 2, + size: spacing.xl / 2, rounded: rounded, color: _activeColor, ), rangeThumbShape: _DrawThumb( - size: widget.largeSliderThumbs ? spacing.xl_2 / 2 : spacing.large / 2, + size: spacing.large / 2, rounded: rounded, color: _activeColor, ),