decrement method

void decrement()

Implementation

void decrement() {
  num currentValue = num.tryParse(widget.controller.text) ?? 0;
  currentValue -= widget.interval;

  // Automatically floor at min if specified.

  if (widget.min != null) {
    currentValue = max(currentValue, widget.min!);
  }

  // Update state provider directly.

  ref.read(widget.stateProvider.notifier).state = currentValue;
}