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

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]