Member-only story

Building Location-Based Apps: Google Maps and Flutter

Adil Essannouni
3 min readDec 19, 2023

--

To create a Flutter app that allows users to choose cities and then displays a table with the population of each city using the google_maps_flutter package, you need to do a bit more setup. This includes integrating Google Maps into your app and obtaining an API key from Google Cloud Platform.

Here’s a step-by-step guide to building this app:

Step 1: Set Up Google Maps

  1. Get a Google Maps API Key:
  • Go to the Google Cloud Platform Console.
  • Create a new project or select an existing one.
  • Navigate to the APIs & Services dashboard and enable the Maps SDK for Flutter.
  • Create credentials to get your API key.

2. Add Dependencies: In your pubspec.yaml file, add the google_maps_flutter package:

  • dependencies: flutter: sdk: flutter google_maps_flutter: ^2.0.6

3. Run flutter pub get to install the new dependency.

4. Configure Your App:

  • For Android, add your API key to the AndroidManifest.xml file:
  • <application> <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_API_KEY"/> <!-- ... --> </application>

--

--

Adil Essannouni
Adil Essannouni

Written by Adil Essannouni

I am Adil Essannouni passionate about sport and web development. I would like to share my modest experience with you

No responses yet