Want to get the ID token from FirebaseAuth in Flutter? Use getIdToken() returns a Future – you have to await it to actually get the token string:
1 2 3 | var token = await FirebaseAuth.instance.currentUser().getIdToken(); var response = await httpClient.get(url,headers: {'Authorization':"Bearer $token"}); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.