How to Use Cloud Functions with MethodChannel to Set Google API Key at Runtime in Flutter? - Stack Overflow

admin2025-04-16  4

I’m trying to use Cloud Functions in combination with MethodChannel to set the Google API key at runtime in my Flutter app. However, I’m facing an issue because the flutter_google_maps package does not support setting the API key dynamically.

1 - I attempted to use MethodChannel to retrieve the API key from Firebase Cloud Functions. 2 - I tried setting the API key dynamically in Flutter before initializing GoogleMapController, but flutter_google_maps does not support this approach.

Is there any alternative way to set the Google Maps API key dynamically at runtime?

转载请注明原文地址:http://anycun.com/QandA/1744795262a87728.html