I am trying to fetch the server auth token this way but I am getting null as output everytime, I have setup the client ID with google developers console but still things are not working fine. How can I retrieve the token which I have to send to backend?
void connectWithGoogleFit() async {
final GoogleSignIn googleSignIn = GoogleSignIn(
scopes: <String>[
'email',
'https://www.googleapis.com/auth/fitness.activity.read',
]);
final GoogleSignInAccount googleUser = await googleSignIn.signIn();
final GoogleSignInAuthentication googleSignInAuthentication =
await googleUser.authentication;
String serverAuthToken = googleSignInAuthentication.serverAuthCode;
print('token');
print(serverAuthToken);
}