How to get Google API key in Flutter Application


I’ve built a Flutter app using for maps and I want to add directions as per, but I need to get the Google API key, which is injected into the app at build time in different ways depending whether it’s Android or IoS.

I’ve spent about an hour googling, but I can’t find a Flutter or native way of getting at the API key in the app. Is there a way?


If I understand rightly that you’re trying to access the Google Maps API key from your native iOS and Android projects from within Flutter, this should work:

Use this: to read the Android manifest and the iOS Info.plist.

On Android the key will already be there as per the Google Maps docs.

You’ll then need to move your API key in iOS to the info.plist then read it in instead of having it hardcoded:

Answered By – Tom Alabaster

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *