Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 如何在flatter代码中访问GitHub机密_Flutter_Dart_Github_Environment Variables_Api Key - Fatal编程技术网

Flutter 如何在flatter代码中访问GitHub机密

Flutter 如何在flatter代码中访问GitHub机密,flutter,dart,github,environment-variables,api-key,Flutter,Dart,Github,Environment Variables,Api Key,我正在从newsapi.org请求一个API 最终响应=等待http.get(Uri.parse(“https://newsapi.org/v2/top-headlines?country=in&apiKey=${API_KEY}”); 它需要API密钥才能访问内容,因此我将API密钥存储在GitHub中,现在我想知道,我如何访问存储在GitHub存储库机密中的API_密钥以发出get请求?还有没有其他方法可以在不公开API_密钥的情况下实现此目的?请参阅:

我正在从newsapi.org请求一个API


最终响应=等待http.get(Uri.parse(“https://newsapi.org/v2/top-headlines?country=in&apiKey=${API_KEY}”);
它需要API密钥才能访问内容,因此我将API密钥存储在GitHub中,现在我想知道,我如何访问存储在GitHub存储库机密中的API_密钥以发出get请求?还有没有其他方法可以在不公开API_密钥的情况下实现此目的?

请参阅: