verificationCodeChanged method Null safety

  1. @override
dynamic verificationCodeChanged(
  1. String code
)
override

Implementation

@override
verificationCodeChanged(String code) {
  if (code.length == 6) {
    _phoneVerification.phoneNumber = phoneNumber.phoneNumber!;
    _phoneVerification.verificationCode = code;
    update(state: PhoneVerificationState.readyToVerify);
    requestVerify();
  } else if (_prevCode?.length == 6 && code.length != 6) {
    _phoneVerification.verificationCode = code;
    update(state: PhoneVerificationState.inputCode);
  }
  _prevCode = code;
}