linkWithProvider method

Future<void> linkWithProvider(
  1. SocialProvider provider
)

Link provider to user

Implementation

Future<void> linkWithProvider(SocialProvider provider) async {
  try {
    if (kIsWeb) {
      await _linkWithPopup(provider);
    } else if (provider == SocialProvider.google) {
      await _linkWithGoogle();
    } else if (provider == SocialProvider.facebook) {
      await _linkWithFacebook();
    } else {
      throw const LogInWithEmailAndPasswordFailure();
    }
  } on FirebaseAuthException catch (e) {
    throw LogInWithEmailAndPasswordFailure.fromCode(e.code);
  } catch (e) {
    throw const LogInWithEmailAndPasswordFailure();
  }
}