Create a New Project
You begin by creating an initial application. Throughout this tutorial, you will modify and extend that starter application to create a simple application which covers the basic features of this guide.
If you need help to create a new project use this official Flutter guide
Set Up Your Environment
This guide explains how to start using a MapsIndoors map in your Flutter application using the MapsIndoors Flutter SDK.
You will need to download and install the flutter toolchain.
We recommend using Android Studio and XCode for using this tutorial. Read how to set Android Studio up here: Installing Android Studio
If you do not have any devices, you can set up an emulator through Android Studio, or in Xcode.
If you already have an Android device, make sure to enable developer mode and USB debugging
To benefit from the guides, you will need basic knowledge about:
Flutter Development
Mobile Development
Set Up Your Project
To get your project started follow these steps:
Create a new project by writing the following command in your terminal
flutter create --platforms ios,android getting_started_mapsindoors_flutter
This will create a new project targeting Android and iOS platforms.
Go to
lib/main.dart
and delete its contents, we will fill it up again during this guide.
If you want to see an example of how this guide will look when completed, you can find it on Github here.
Set Up MapsIndoors
Google Maps
To get started with your project add MapsIndoors version .0
to your pubspec.yaml
.
First you need to extend the allowed gradle repositories to allow the SDK to resolve correctly:
Navigate to the app's project level
build.gradle
.add
maven { url 'https://maven.mapsindoors.com/' }
toallprojects
/repositories
aftermavenCentral()
To get the underlying Google Map to work, you need to perform the following steps:
Navigate to
android/app/src/main/res/value
.Create a file in this folder called
google_maps_api_key.xml
.Copy and paste the below code snippet and replace
YOUR_KEY_HERE
with your Google Maps API key.
Mapbox
To get started with your project add MapsIndoors version .0
to your pubspec.yaml
.
First you need to extend the allowed gradle repositories to allow the SDK to resolve correctly:
Navigate to the app's project level
build.gradle
.add
maven { url 'https://maven.mapsindoors.com/' }
toallprojects
/repositories
aftermavenCentral()
add mapbox to repositories like in the example below:
add your mapbox download token to gradle.properties
To get the underlying Mapbox Map to work, you need to perform the following steps:
Navigate to
android/app/src/main/res/value
.Create a file in this folder called
mapbox_api_key.xml
.Copy and paste the below code snippet and replace
YOUR_KEY_HERE
with your Mapbox keys.
Last updated