Skip to content

Instantly share code, notes, and snippets.

@mhmzdev
Created April 9, 2020 07:17
Show Gist options
  • Save mhmzdev/667ac15ef4d21a3620dc1a571e1a8f34 to your computer and use it in GitHub Desktop.
Save mhmzdev/667ac15ef4d21a3620dc1a571e1a8f34 to your computer and use it in GitHub Desktop.
_verifyCode() async {
final AuthCredential credential = PhoneAuthProvider.getCredential(
verificationId: _verificationId, smsCode: _controllerCode.text);
final FirebaseUser user =
(await _auth.signInWithCredential(credential)).user;
final FirebaseUser currentUser = await _auth.currentUser();
assert(user.uid == currentUser.uid);
if (user != null) {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SecondScreen(
user: user,
)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment