twitter_login 0.0.3 copy "twitter_login: ^0.0.3" to clipboard
twitter_login: ^0.0.3 copied to clipboard

outdated

Flutter Twitter Login Plugin

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

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

// TODO: sample code
class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: FlatButton(
            child: Text('login'),
            onPressed: () async {
              final twitterLogin = TwitterLogin(
                apiKey: 'xxxxx',
                apiSecretKey: 'xxxxx',
                redirectURI: 'URLScheme://',
              );
              final authResult = await twitterLogin.login();
              switch (authResult.status) {
                case TwitterLoginStatus.loggedIn:
                // success
                case TwitterLoginStatus.cancelledByUser:
                // cancel
                case TwitterLoginStatus.error:
                // error
              }
            },
          ),
        ),
      ),
    );
  }
}
109
likes
0
pub points
97%
popularity

Publisher

unverified uploader

Flutter Twitter Login Plugin

Homepage

License

unknown (LICENSE)

Dependencies

crypto, flutter, flutter_inappwebview, http

More

Packages that depend on twitter_login