github_login 0.0.1 copy "github_login: ^0.0.1" to clipboard
github_login: ^0.0.1 copied to clipboard

outdated

Plugin for github login

github_login #

Plugin for github login

Getting Started #

Import the plugin

import 'package:github_login/github_login.dart';

Now, just create object and call method

 GithubLogin user = new GithubLogin();
  await user.getToken(context: context,
                        clientId: "ClientId",
                        clientSecret: "Secret",
                        callBackUrl:"https://example.com");                

Example #

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                child: Text('Github Login'),
                style: ElevatedButton.styleFrom(
                  primary: Colors.blue,
                ),
                onPressed: () async {
                  GithubLogin user = new GithubLogin();
                  String token = await user.getToken(context: context,
                      clientId: "ClientId",
                      clientSecret: "Secret",
                      callBackUrl:"https://example.com");
                  print("TOKEN FROM PLUGIN ::: $token");
                },
              )
            ],
          ),
        ),
      ),
    );
  }
}