I am trying to sign in to google by google_sign_in package that I added to dependencies and this error comes when I sign in to an account after I sign in successfully but it doesn't show anything. error : I/flutter ( 7069): PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException: 10: , null) here is my code :
GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: <String>[
'email',
'https://www.googleapis.com/auth/contacts.readonly',
],
);
void main() {
runApp(
MaterialApp(
title: 'Google Sign In',
home: SignIn(),
),
);
}
class SignIn extends StatefulWidget {
@override
State createState() => SignInState();
}
class SignInState extends State<SignIn> {
GoogleSignInAccount _currentUser;
String _contactText;
bool checkBoxValue = false;
double _height;
double _width;
double _pixelRatio;
bool _large;
bool _medium;
@override
void initState() {
super.initState();
_googleSignIn.onCurrentUserChanged.listen((GoogleSignInAccount account) {
setState(() {
_currentUser = account;
});
if (_currentUser != null) {
_handleGetContact();
}
});
_googleSignIn.signInSilently();
}
Future<void> _handleSignIn() async {
try {
await _googleSignIn.signIn();
} catch (error) {
print(error);
}
}
any ideas??