buttonDown method Null safety

  1. @override
void buttonDown(
  1. Operation key
)
override

Implementation

@override
void buttonDown(Operation key) {
  int? digit = key.numericValue;
  if (digit == null || digit > 9) {
    changeState(last); // But eat the digit
    return;
  }
  _value *= 10;
  _value += digit;
  _digits++;
  if (_digits >= 3) {
    changeState(last).handleGotoDot(_value);
  }
}