← Back to Documentation Home

Google Maps Setup

Configure Google Maps for address selection, nearby restaurant discovery, and real-time order tracking.

Google Maps Setup

Configure Google Maps for address selection, nearby restaurant discovery, and real-time order tracking.

Table of Contents
  1. Overview
  2. Enable the required APIs
  3. Create an API key
  4. Android configuration
  5. iOS configuration
  6. Backend configuration
  7. Test & troubleshoot
Important — Buyer's Own Account & Billing Required

Google Maps is a third-party service. You must create your own Google Cloud account and enable billing. This is not included in your CodeCanyon purchase.

Google provides a $200/month free credit for Maps Platform usage, which covers most small-to-medium apps. If your usage exceeds this credit, Google will charge you based on their published pricing.

The author of FoodFeast has no control over Google Maps pricing and is not responsible for any costs incurred.
1 Google Maps

Overview#

FoodFeast uses Google Maps for three core features: address selection when placing orders, nearby restaurant discovery on the home screen, and live order tracking during delivery.

The app integrates Google Maps through google_maps_flutter ^2.10.1 in pubspec.yaml.

APIs you need to enable#

APIWhat it does in FoodFeast
Maps SDK for AndroidRenders interactive maps in the Android app
Maps SDK for iOSRenders interactive maps in the iOS app
Geocoding APIConverts GPS coordinates to human-readable addresses
Geolocation APIDetermines the user's current location
Places APIPowers address autocomplete / search

2 Google Maps

Enable the required APIs#

1

Open Google Cloud Console

Go to console.cloud.google.com and sign in. Create a new project or select an existing one.

2

Navigate to APIs & Services → Library

Search for and enable each of these 5 APIs:

  • Maps SDK for Android
  • Maps SDK for iOS
  • Geocoding API
  • Geolocation API
  • Places API
3

Enable billing

Go to Billing in the sidebar and link a billing account. Google requires a billing account to be active even though $200/month in free usage is provided.


3 Google Maps

Create an API key#

1

Go to APIs & Services → Credentials

Click Create Credentials → API key. A new key is generated.

2

Restrict the key (recommended)

Click on the new key → Restrict key. Under "API restrictions", select Restrict key and check only the 5 APIs listed above. This prevents unauthorized usage.

For production, you can create separate keys for Android, iOS, and the backend — each restricted to its platform. For development, a single unrestricted key works fine.

4 Google Maps

Android configuration#

1

Locate the Android Manifest in your IDE

In your project's file explorer, navigate down to:

android/app/src/main/AndroidManifest.xml
Navigating the project explorer toward the android folder
2

Open the android folder

android folder expanded showing build.gradle and gradle.properties
3

Check the project-level build.gradle

Confirm the Google Maps and Google Services Gradle plugins are present at the project level.

Project-level build.gradle file
4

Open the app module

Navigating into the android/app folder
5

Drill into src/main

Continue navigating: app → src → main to reach the manifest file.

Navigating into android/app/src/main
6

Add the API key meta-data tag

Inside the <application> tag, add:

android/app/src/main/AndroidManifest.xml
<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="YOUR_ANDROID_MAPS_KEY"/>

Replace YOUR_ANDROID_MAPS_KEY with your actual Google Maps API key.

AndroidManifest.xml showing the Google Maps API_KEY meta-data tag
7

Verify permissions

The manifest should already include these permissions (they come with the project):

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

5 Google Maps

iOS configuration#

1

Open AppDelegate.swift

ios/Runner/AppDelegate.swift
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: ...
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR_IOS_MAPS_KEY")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, ...)
  }
}

Replace YOUR_IOS_MAPS_KEY with your actual Google Maps API key.

2

Add location usage description

In ios/Runner/Info.plist, ensure these keys exist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>FoodFeast needs your location to find nearby restaurants and deliver to you.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>FoodFeast uses your location for live order tracking.</string>

6 Google Maps

Backend configuration#

The Laravel backend uses a Google Maps API key server-side for distance calculation and delivery fee computation.

1

Add the key to your .env file

backend/.env
GOOGLE_MAPS_API_KEY="YOUR_SERVER_MAPS_KEY"

This key should ideally be a separate server-restricted key (restrict by IP address of your hosting server).


7 Google Maps

Test & troubleshoot#

1

Run the app and open the location/map screen

If you see the interactive map with markers, your setup is correct.

Common issues#

ProblemSolution
Grey grid instead of mapAPI key is missing or invalid. Verify the key in AndroidManifest.xml / AppDelegate.swift. Also check that Maps SDK for Android/iOS is enabled in Google Cloud Console.
Map loads but no autocompleteEnable the Places API in Google Cloud Console.
Map works but address shows as coordinatesEnable the Geocoding API in Google Cloud Console.
"This API project is not authorized"You restricted the key to specific APIs — make sure all 5 required APIs are included in the restriction.
Emulator shows no mapSome emulators lack Google Play Services. Test on a physical device or use an emulator with Google APIs system image.
FoodFeast · Google Maps Setup Guide v1.1 · © FoodFeast