A Flutter app using Google Maps SDK & Directions API

A Flutter app using Google Maps SDK & Directions API

Flutter-Maps A Flutter app using Google Maps SDK & Directions API

Flutter Maps

A Flutter app using Google Maps SDK & Directions API

Plugins

The plugins used in this project are:

Features

  • Detect the current location of the user
  • Use Geocoding for converting addresses to coordinates and vice versa
  • Add Markers to the Map View
  • Draw the route between two places using Polylines and Directions API
  • Calculate the actual distance of the route

Usage

  • Clone the repository.

    git clone https://github.com/sbis04/flutter_maps.git
  • Open the project using your favorite IDE. For opening with VS Code:

    code flutter_maps
  • For the Android part, go to android/app/src/main/AndroidManifest.xml file and add your API key here.

    <!-- Add your Google Maps API Key here -->
    <meta-data android:name="com.google.android.geo.API_KEY"
                   android:value="YOUR KEY HERE"/>
  • For the iOS part, go to ios/Runner/AppDelegate.swift file and add your API key here.

    GMSServices.provideAPIKey("YOUR KEY HERE")
  • Go to the lib/secrets.dart file and add your API key here.

Full configuration (already done in this project)

You do not require to complete these configurations if you are cloning this project, as they are already done in it. But these may be helpful if you are setting up a new Flutter project for using Google Maps and location services.

Android setup

  • Navigate to the file android/app/src/main/AndroidManifest.xml and add the following code snippet inside the application tag:

    <!-- Add your Google Maps API Key here -->
    <meta-data android:name="com.google.android.geo.API_KEY"
                   android:value="YOUR KEY HERE"/>
  • Also, you will need location access in the app. So, add the following permission in the same file inside the manifest tag:

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

iOS setup

  • Navigate to the file ios/Runner/AppDelegate.swift and replace the whole code with the following:

    import UIKit
    import Flutter
    import GoogleMaps
    
    @UIApplicationMain
    @objc class AppDelegate: FlutterAppDelegate {
      override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
      ) -> Bool {
        //Add your Google Maps API Key here
        GMSServices.provideAPIKey("YOUR KEY HERE")
        GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
      }
    }
  • Also, add the following to ios/Runner/Info.plist file:

    <key>io.flutter.embedded_views_preview</key>
    <string>YES</string>
    
  • For getting location permission, add the following to the same file:

    <key>NSLocationWhenInUseUsageDescription</key>
    <string>This app needs access to location when open.</string>
    

This completes the setup for both the platforms in Flutter.

Download Details:

Author: Jahnavi-Jonnalagadda

Source Code: https://github.com/Jahnavi-Jonnalagadda/Flutter-Maps

flutter dart mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

Top 25 Flutter Mobile App Templates in 2020

Flutter has been booming worldwide from the past few years. While there are many popular mobile app development technologies out there, Flutter has managed to leave its mark in the mobile application development world. In this article, we’ve curated the best Flutter app templates available on the market as of July 2020.

Flutter App Development Trends 2020

As the new decade dawns upon us, a slew of technologies has been making a lot of noise to grab the developers’ attention. While native app development is going strong, the trade winds are now blowing towards going cross-platform.

How To Succeed In Mobile App Wireframe Design?

This article covers everything about mobile app wireframe design: what to do and what not, tools used in designing a mobile or web app wireframe, and more.

What is Flutter and why you should learn it?

Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking Android and iOS applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).