linkedin_login

  • A Flutter library for LinkedIn OAuth 2.0 APIs .

  • This library is using new way of authorization on LinkedIn

Installation

Important

You should replace this values

final String redirectUrl = 'YOUR-REDIRECT-URL';
final String clientId = 'YOUR-CLIENT-ID';
final String clientSecret = 'YOUR-CLIENT-SECRET';

To get these values you need to create App on the LinkedIn.

Samples

You can see full example under this project.

Call LinkedIn authorization and get user object:

LinkedInUserWidget(
   redirectUrl: redirectUrl,
   clientId: clientId,
   clientSecret: clientSecret,
   onGetUserProfile:
       (LinkedInUserModel linkedInUser) {
     
     print(
         'Access token ${linkedInUser.token.accessToken}');
     
     print('First name: ${linkedInUser
         .firstName.localized.label}');
     print('Last name: ${linkedInUser
         .lastName.localized.label}');

   },
   catchError: (LinkedInErrorObject error) {
     print(
         'Error description: ${error.description},'
         ' Error code: ${error.statusCode.toString()}');
                                  },
)

Properties that are available after call

  String firstName;
  String lastName;
  String accessToken;
  int expiresIn;
  String profilePicture;
  String email;

Widgets

Standard LinkedIn button for login. This widget is modifiable.

LinkedInButtonStandardWidget(onTap: () {});

Libraries

linkedin_login