Skip to content

devsig/github_sign_in_plus

Repository files navigation

github_sign_in_plus

Sign In With GitHub

Getting Started

Add package dependency

github_sign_in_plus: ^0.0.1

Perform Sign In With GitHub

final GitHubSignIn gitHubSignIn = GitHubSignIn(
        clientId: clientId,
        clientSecret: clientSecret,
        redirectUrl: redirectUrl);
    var result = await gitHubSignIn.signIn(context);
    switch (result.status) {
      case GitHubSignInResultStatus.ok:
        print(result.token)
        break;

      case GitHubSignInResultStatus.cancelled:
      case GitHubSignInResultStatus.failed:
        print(result.errorMessage);
        break;
    }