Created
June 18, 2020 14:20
-
-
Save marcos-bah/9b5a843231a7890e082b3e3de57d8915 to your computer and use it in GitHub Desktop.
GithHubSignIn Completo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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