Skip to content

Commit

Permalink
Reduce diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi committed Jul 27, 2022
1 parent 524c17e commit c78b5ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/src/base_spin_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ mixin SpinBoxMixin<T extends BaseSpinBox> on State<T> {
decimals: widget.decimals, digits: widget.digits);
}

void _stepUp() => controller.value += widget.step;
void _stepDown() => controller.value += -widget.step;
void _pageStepUp() => controller.value += widget.pageStep;
void _pageStepDown() => controller.value -= widget.pageStep;

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -106,6 +101,12 @@ mixin SpinBoxMixin<T extends BaseSpinBox> on State<T> {
super.dispose();
}

void _stepUp() => controller.value += widget.step;
void _stepDown() => controller.value -= widget.step;

void _pageStepUp() => controller.value += widget.pageStep;
void _pageStepDown() => controller.value -= widget.pageStep;

void _handleValueChange() {
widget.onChanged?.call(_controller.value);
setState(() => _updateText(_controller.value));
Expand Down

0 comments on commit c78b5ce

Please sign in to comment.