April 2020
Intermediate to advanced
380 pages
9h 24m
English
In this section, we will add Firebase authentication inside SignupSigninScreen.
We define a _signinSignup() method in the signup_signin_screen.dart file. The method is called when the sign-in button is pressed. The body of the method appears as follows:
void _signinSignup() async { setState(() { _loading = true; }); String userId = ""; if (_formMode == FormMode.SIGNIN) { userId = await widget.auth.signIn(_usermail, _userpassword); } else { userId = await widget.auth.signUp(_usermail, _userpassword); } setState(() { _loading = false; }); if (userId.length > 0 && userId != null && _formMode == FormMode.SIGNIN) { widget.onSignedIn(); }}
In the preceding method, we begin by setting the value of
Read now
Unlock full access