linkWithCredential method

void linkWithCredential(
  1. K credential
)

Links a provided AuthCredential with the currently signed in user account.

Implementation

void linkWithCredential(K credential) {
  authListener.onCredentialReceived(credential);

  try {
    final user = auth.currentUser!;
    user
        .linkWithCredential(credential)
        .then((_) => authListener.onCredentialLinked(credential))
        .catchError(authListener.onError);
  } catch (err) {
    authListener.onError(err);
  }
}