September 2019
Beginner
512 pages
12h 52m
English
The second step is to verify the user has retrieved the correct code, and by doing so, should log in to the application. This is done in the signInWithCredential method as shown here:
// _executeLogin method (LoginPageState) login_page.dart void _executeLogin() async { setState(() { _showProgress = true; }); await FirebaseAuth.instance.signInWithCredential( PhoneAuthProvider.getCredential( verificationId: _verificationId, smsCode: _smsCode, )); FirebaseAuth.instance.currentUser().then((user) { if (user != null) { goToProfileStep(); } }); }
As you can see, this is a simple call to the signInWithCredential method from the Firebase auth plugin that expects the following two arguments:
Read now
Unlock full access