sendSignInLinkToEmail method Null safety

Future<void> sendSignInLinkToEmail(
  1. {required String email,
  2. required ActionCodeSettings actionCodeSettings}
)

Sends a sign in with email link to provided email address.

To complete the password reset, call confirmPasswordReset with the code supplied in the email sent to the user, along with the new password specified by the user.

The handleCodeInApp of actionCodeSettings must be set to true otherwise an ArgumentError will be thrown.

A FirebaseAuthException maybe thrown with the following error code:

  • invalid-email:
  • Thrown if the email address is not valid.
  • user-not-found:
  • Thrown if there is no user corresponding to the email address.

Implementation

Future<void> sendSignInLinkToEmail({
  required String email,
  required ActionCodeSettings actionCodeSettings,
}) async {
  if (actionCodeSettings.handleCodeInApp != true) {
    throw ArgumentError(
      'The [handleCodeInApp] value of [ActionCodeSettings] must be `true`.',
    );
  }

  await _delegate.sendSignInLinkToEmail(email, actionCodeSettings);
}