Adding Google Maps to a Flutter app looks simple until the map stays blank, the markers never appear, or the blue dot refuses to show up. The google_maps_flutter plugin handles the rendering, but the setup around it β API keys, platform configuration, location permission, and the asynchronous map controller β is where most developers lose an afternoon. This guide walks through the full setup: API key, Android and iOS configuration, markers, polylines, and the user's current location, with working code at every step.
How do I add Google Maps to a Flutter app?
Add the google_maps_flutter package, put a Google Maps API key in the Android manifest and the iOS app delegate, enable the Maps SDK for Android and Maps SDK for iOS in Google Cloud Console, and render a GoogleMap widget with an initialCameraPosition . The map itself is one widget; the setup is the work. The plugin renders a native map view inside your Flutter widget tree, so the map behaves like a platform view, not a Flutter-drawn canvas.β¦