twitter_login 4.4.2 icon indicating copy to clipboard operation
twitter_login: ^4.4.2 copied to clipboard

Flutter Twitter Login Plugin. Library for login with Twitter APIs OAuth service

twitter_login #

Pub Version

Flutter Twitter Login Plugin

Requirements #

  • Dart sdk: ">=2.12.0-0 <3.0.0"
  • flutter: ">=1.25.0-8.1.pre"
  • Android: minSdkVersion 17 and add support for androidx
  • iOS: --ios-language swift, Xcode version >= 11

Twitter Configuration #

Twitter Developer

required to create TwitterApp.
this plugin is need Callback URLs.

please register a different callback URL on Twitter Developers.


If the API is not set to get email, email may be null. If you want to use email, turn on Request email address from users.

Android Configuration #


You need to replace the scheme with a Callback URLs.

  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <!-- Accepts URIs that begin with "example://gizmos” -->
  <!-- Registered Callback URLs in TwitterApp -->
  <data android:scheme="example"
        android:host="gizmos" /> <!-- host is option -->

Supporting the new Android plugins APIs #

If you flutter created your project prior to version 1.12, you need to make sure to update your project in order to use the new Java Embedding API.
Make use you have flutter_embedding v2 enabled. Add the following code on the manifest file inside

    android:value="2" />

iOS Configuration #

Add URLScheme #


You need to replace the example with a Callback URLs.

      <!-- Registered Callback URLs in TwitterApp -->

Example code #

See the example directory for a complete sample app using twitter_login.


Usage #

To use this plugin, add twitter_login as a dependency in your pubspec.yaml file.

Example #

import 'package:flutter/material.dart';
import 'package:twitter_login/twitter_login.dart';

void main() {

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Twitter Login App'),
        body: Center(
          child: FlatButton(
            child: Text('Login With Twitter'),
            onPressed: () async {
              final twitterLogin = TwitterLogin(
                // Consumer API keys
                apiKey: 'xxxx',
                // Consumer API Secret keys
                apiSecretKey: 'xxxx',
                // Registered Callback URLs in TwitterApp
                // Android is a deeplink
                // iOS is a URLScheme
                redirectURI: 'example://',
              final authResult = twitterLogin.login();
              switch (authResult.status) {
                case TwitterLoginStatus.loggedIn:
                  // success
                case TwitterLoginStatus.cancelledByUser:
                  // cancel
                case TwitterLoginStatus.error:
                  // error
pub points


unverified uploader

Flutter Twitter Login Plugin. Library for login with Twitter APIs OAuth service

Repository (GitHub)
View/report issues


API reference


Icon for licenses.MIT (LICENSE)


crypto, flutter, http


Packages that depend on twitter_login