Created
April 9, 2020 07:17
-
-
Save mhmzdev/667ac15ef4d21a3620dc1a571e1a8f34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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