Skip to content

Commit

Permalink
fix: removed rounded from widgetbook
Browse files Browse the repository at this point in the history
fix: removed large thumbs

fix: removed defaults to true on showValues
  • Loading branch information
DE7924 committed Nov 22, 2024
1 parent c38cd28 commit 9b356bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion example/lib/pages/components/range_selector_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class _RangeSelectorExampleState extends State<RangeSelectorExample> {
min: 0,
max: 100,
label: 'Label',
semanticLabel: 'Hello World!',
),
].gap(12),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
13 changes: 3 additions & 10 deletions lib/src/components/range_selector/range_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down Expand Up @@ -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<ZetaRangeSelector> createState() => _ZetaRangeSelectorState();

Expand All @@ -72,8 +66,7 @@ class ZetaRangeSelector extends ZetaStatefulWidget {
..add(IntProperty('divisions', divisions))
..add(StringProperty('semanticLabel', semanticLabel))
..add(DiagnosticsProperty<bool>('showValues', showValues))
..add(DiagnosticsProperty<RangeValues>('initialValues', initialValues))
..add(DiagnosticsProperty<bool>('largeSliderThumbs', largeSliderThumbs));
..add(DiagnosticsProperty<RangeValues>('initialValues', initialValues));
}
}

Expand Down Expand Up @@ -221,12 +214,12 @@ class _ZetaRangeSelectorState extends State<ZetaRangeSelector> {

/// 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,
),
Expand Down

0 comments on commit 9b356bc

Please sign in to comment.