https://github.com/roughike/flutter_twitter_login
A Flutter plugin for authenticating users by using the native TwitterKit SDKs on Android & iOS.
https://github.com/roughike/flutter_twitter_login
Last synced: 9 months ago
JSON representation
A Flutter plugin for authenticating users by using the native TwitterKit SDKs on Android & iOS.
- Host: GitHub
- URL: https://github.com/roughike/flutter_twitter_login
- Owner: roughike
- License: bsd-2-clause
- Created: 2018-02-06T20:26:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-04T17:21:22.000Z (over 4 years ago)
- Last Synced: 2025-04-02T19:05:56.088Z (10 months ago)
- Language: Dart
- Size: 122 KB
- Stars: 83
- Watchers: 4
- Forks: 135
- Open Issues: 39
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_twitter_login
[](https://pub.dartlang.org/packages/flutter_twitter_login)
[](https://travis-ci.org/roughike/flutter_twitter_login)
[](https://coveralls.io/github/roughike/flutter_twitter_login)
A Flutter plugin for using the native TwitterKit SDKs on Android and iOS.
This plugin uses [the new Gradle 4.1 and Android Studio 3.0 project setup](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1).
## Dart support
* Dart 1: 1.0.x.
* Dart 2: 1.1.0 and up.
## Installation
See the [installation instructions on pub](https://pub.dartlang.org/packages/flutter_twitter_login#-installing-tab-). No platform-specific configuration is needed!
## How do I use it?
Here's some sample code that should cover most of the cases. For full API reference, just [see the source code](https://github.com/roughike/flutter_twitter_login/blob/master/lib/flutter_twitter_login.dart). Everything is documented there.
```dart
var twitterLogin = new TwitterLogin(
consumerKey: '',
consumerSecret: '',
);
final TwitterLoginResult result = await twitterLogin.authorize();
switch (result.status) {
case TwitterLoginStatus.loggedIn:
var session = result.session;
_sendTokenAndSecretToServer(session.token, session.secret);
break;
case TwitterLoginStatus.cancelledByUser:
_showCancelMessage();
break;
case TwitterLoginStatus.error:
_showErrorMessage(result.error);
break;
}
```