Created
April 28, 2023 13:43
-
-
Save VasuNIPL/ab582e1028f6639d806860fb74bc131b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:http/http.dart' as http; | |
| Future<String> getIdToken({bool? force}) async { | |
| // fetch update token | |
| return "abc*******"; | |
| } | |
| Future<void> main() async { | |
| final client = http.Client(); | |
| final token = await getIdToken(); | |
| try{ | |
| final response = await client.get(Uri.parse("https://api.***.server")); | |
| }catch(e){ | |
| print("token: $token"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment