Skip to content

Instantly share code, notes, and snippets.

@VasuNIPL
Created April 28, 2023 13:43
Show Gist options
  • Select an option

  • Save VasuNIPL/ab582e1028f6639d806860fb74bc131b to your computer and use it in GitHub Desktop.

Select an option

Save VasuNIPL/ab582e1028f6639d806860fb74bc131b to your computer and use it in GitHub Desktop.
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