Skip to content

Instantly share code, notes, and snippets.

@marcos-bah
Created June 18, 2020 14:20
Show Gist options
  • Save marcos-bah/9b5a843231a7890e082b3e3de57d8915 to your computer and use it in GitHub Desktop.
Save marcos-bah/9b5a843231a7890e082b3e3de57d8915 to your computer and use it in GitHub Desktop.
GithHubSignIn Completo
final GitHubSignIn gitHubSignIn = GitHubSignIn(
clientId: "",
clientSecret:
"",
redirectUrl:
"");
var result = await gitHubSignIn.signIn(context);
switch (result.status) {
case GitHubSignInResultStatus.ok:
final AuthCredential credential =
GithubAuthProvider.getCredential(
token: result.token,
);
final FirebaseUser user = await FirebaseAuth.instance
.signInWithCredential(credential);
_onSuccess();
model.signUpGoogle(user); //deve enviar para um model, utilizei o mesmo do Login pelo Google
break;
case GitHubSignInResultStatus.cancelled:
case GitHubSignInResultStatus.failed:
_onFail();
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment