signInWithEmailAndPassword static method
Initates a Mail & Password SignIn and the AuthManager changes the screen to the destinationFragment
Please enable Email and Password Authentication in your Firebase Authentication Console for this to work
context is necessary
email is required and is self-explanatory
password is also required and is self-explanatory
onError is a callback to handle any errors during the process
onIncorrectCredentials is a callback to handle incorrect credentials
onSignInSuccessful a Callback to perform any action after a successful SignIn
Implementation
static Future<User?> signInWithEmailAndPassword(
BuildContext context, {
required String email,
required String password,
Function(String)? onError,
Function? onIncorrectCredentials,
Function(User?)? onSignInSuccessful,
}) async {
return await Provider.of<FireAuthProvider>(context, listen: false)
.signInWithEmailAndPassword(
email: email,
password: password,
onError: onError,
onIncorrectCredentials: onIncorrectCredentials,
onSignInSuccessful: onSignInSuccessful,
);
}