I am reading some Json files from my firebase database and I am trying to obtain an ID token for the current user to be used in the header as follows:
var respo
I think that there is a bug in Flutter.
Now to call the method getIdToken() you need to do this:
getIdToken()
FirebaseUser user = await FirebaseAuth.instance.currentUser(); String token; user.getIdToken().then((result) { token = result.token; });
You can't call FirebaseAuth.instance.currentUser().getIdToken()
FirebaseAuth.instance.currentUser().getIdToken()