requestVerify method Null safety

  1. @override
dynamic requestVerify()
override

Implementation

@override
requestVerify() async {
  update(state: PhoneVerificationState.verifyingCode);

  PhoneAuthCredential credential = await PhoneAuthProvider.credential(
    verificationId: _phoneVerification.verificationId!,
    smsCode: _phoneVerification.verificationCode!,
  );

  try {
    await FirebaseAuth.instance.signInWithCredential(credential);
    await FirebaseAuth.instance.signOut();
    update(state: PhoneVerificationState.verifiedCode);
  } catch (e) {
    _handleError(e as FirebaseAuthException);
  }
}