Skip to content

ethioclicks/map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

         Flutter map documentation

Chapter 1 Getting Started

  1. Open terminal and create a flutter project with command: • flutter create project_name
  2. Open working environment ( eg. vscode).
  3. Open the project we just created.  This application utilizing Google Maps, Places Autocomplete, and Geolocator.  For this application to work we need to: a. Have a Google project, enable the Android SDK, IOS SDK, and Places API in your GCloud Console. b. Obtain an API key and replace the YOUR_KEY placeholders in
    • ios/Runner/AppDelegate.swift
    • android/app/src/main/AndroidManifest.xml
    • lib/services/places_service.dart

Chapter 2 Adding dependencies

We can add dependencies with two ways: I. Search for dependencies we needed in pubs.dev website. II. In terminal use command: • flutter pub add package_name To work we need the following dependencies:

  1. provider: • For state management.
  2. google_maps_flutter: • To use Google map in our program.  In order to use this package we need to set permission for android or for ios.

pemmision for android

permmission for ios

  1. geolocator: • Used to focus on where we are.
  2. http: • To use our Google API.
  3. geocoding: • To convert address written with coordinates to readable address and vice versa.

Chapter 3 Create and setup Google map API

After creating our API we need to set up the API so that it can be used by our application by:

  1. Enable APIs for android, ios, for rest searches for places: • Go to: Menu -> APIs & Services -> Library • Enable three APIs: Maps SDK for Android, maps SDK for ios, places API
  2. Create and get an API key: • Go to: Menu -> APIs & Services -> Credentials • In Credentials page create API by pressing: Create credentials-> API key

create_credentials

• Then a dialogue box will appear: create_api_dialoguebox

• Select RESTRICT KEY • Then we will restrict Maps SDK for Android, maps SDK for ios, places API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published