Google Map

Google map was use to allow Customer/user picker different location on map for their delivery address.

For this to work, you would need to obtain a google map key api from google console. Here is a link to google console where you can get api key https://cloud.google.com/maps-platform/.

And don't forget to enable the following APIs in https://console.cloud.google.com/google/maps-apis/

  • Maps SDK for Android

  • Maps SDK for iOS

  • Places API

  • Geolocation API

  • Geocoding API

  • And ensure to enable billing for the project.

App Setup

Please follow the instructions below to add google map api key to the flutter project

Android

Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml:

<manifest ...
  <application ...
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/>

iOS

Specify your API key in the application delegate ios/Runner/AppDelegate.swift:

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR KEY HERE")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Last updated