third_party_login 1.0.4 copy "third_party_login: ^1.0.4" to clipboard
third_party_login: ^1.0.4 copied to clipboard

Third Party Login is simple way to sign-in with different types of third party login systems.

Third Party Login #

Third Party Login is simple way to sign-in with different types of third party login systems.

Features #

  • Login With Google SignIn
  • Login With Facebook SignIn

Getting started #

Usage #

1. Add the package to pubspec.yaml dependency:

dependencies:
  third_party_login: ^1.0.4

2. Import package:

import 'package:third_party_login/third_party_login.dart';

3. Initialize ThirdPartyLoginMethods

 ThirdPartyLoginMethods thirdPartyLoginMethods = ThirdPartyLoginMethods();

4. call socialMediaLogin and pass AuthType

final userCredential = await thirdPartyLoginMethods.socialMediaLogin(
        authType: AuthType.google);

Usage For Phone Number Verification #

  • follow step number 1 and 2
  1. extend ThirdPartyLoginWithPhoneNumber class
class PhoneNumberAuth extends ThirdPartyLoginWithPhoneNumber{}
  1. Initialize PhoneNumberAuth class and call init to start phone number verification
PhoneNumberAuth _auth = PhoneNumberAuth();
_auth.init(phoneNumber:contactNumber)

After calling init firebase will try to verify phone number you provided and if the verification complete codeSent will be called at that point you'll get sms code to the phone number you provided. after that you can call verifyCode and pass the sms code you just got.

class PhoneNumberAuth extends ThirdPartyLoginWithPhoneNumber{
String? verificationId;
String resendToken;

@override
codeSent(String verificationId, int? forceResendingToken) {
  this.verificationId = verificationId;
  resendToken = forceResendingToken;
}
....
}

Next call verifyCode and pass the sms code value to verify the sms code you just got. this method will try to verify your code and if it's successful it will sign-in with the credential and return UserCredential. ...

final UserCredential? userCredential =
          await thirdPartyLoginWithPhoneNumber.verifyCode(smsCode: sms);

AuthTypes #

  • google
  • facebook
10
likes
0
pub points
68%
popularity

Publisher

unverified uploader

Third Party Login is simple way to sign-in with different types of third party login systems.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

firebase_auth, firebase_core, flutter, flutter_facebook_auth, google_sign_in

More

Packages that depend on third_party_login