How to access GitHub Secrets in Flutter Code

Viewed 157

I am requesting an API from newsapi.org


final response = await http.get(Uri.parse("https://newsapi.org/v2/top-headlines?country=in&apiKey=${API_KEY}"));

which requires an API key to access the contents so I store the API key in GitHub secrets, and now I want to know that how can I access this API_KEY stored in GitHub repository secrets to make a get request also is there any alternative way to achieve this without exposing the API_KEY?

0 Answers
Related