registerWithEmailAndPassword static method
Future<User?>
registerWithEmailAndPassword(
- BuildContext context, {
- required String email,
- required String password,
- dynamic onError()?,
- dynamic onRegisterSuccessful(
- User?
Registers the Email and Password Combination on Firebase initiates a login and the AuthManager changes the screen to the destinationFragment Call this to create a new User and instantly log them in
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
onRegisterSuccessful
a Callback to perform any action after a successful SignIn
Implementation
static Future<User?> registerWithEmailAndPassword(
BuildContext context, {
required String email,
required String password,
Function(String)? onError,
Function(User?)? onRegisterSuccessful,
}) async {
return await Provider.of<FireAuthProvider>(context, listen: false)
.registerWithEmailAndPassword(
email: email,
password: password,
onError: onError,
onRegisterSuccessful: onRegisterSuccessful,
);
}