I want to use the Flutter google-sign-in (https://pub.dev/packages/google_sign_in) package without firebase. I have successfully implemented it with the following code:
GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: [
'email',
'https://www.googleapis.com/auth/contacts.readonly',
],
);
Future<void> _handleSignIn() async {
try {
await _googleSignIn.signIn();
} catch (error) {
print(error);
}
}
//...
child: FlatButton(
onPressed: () => _handleSignIn(),
//...
However, this launches oauth in browser. How can i stop the browser to launch, and instead show that nice dialog that opens for oauth?
I've seen examples of the google-sign-in flutter package working in conjunction with firebase auth to have in-app authentication. But is this possible to do without firebase auth?
I've also read from here (How is OAuth 2 different from OAuth 1?) that oauth 2.0 is what i need to use for in-app authentication. Does that mean I can't use the google-sign-in package? It seems like this package only uses oauth1. Is this correct?
I've also seen this oauth2.0 flutter package (https://pub.dev/packages/oauth2). Is it possible to use this in conjunction with google-sign-in to get in-app authentication working, instead of launching the browser?
I'm a little confused about how everything relates to each other, any help is appreciated. Thanks!