Install and set up

Before installing the ArcGIS Maps SDK for Flutter, make sure your development machine meets the system requirements.

Flutter package repository

The ArcGIS Maps SDK for Flutter can be integrated into your Flutter project in VS Code using Flutter's package repository, pub.dev.

VS Code
  1. Open your Flutter project in VS Code.

  2. Go to View > Terminal.

  3. Add the arcgis_maps package as a project dependency.

    Use dark colors for code blocksCopy
    1
    dart pub add arcgis_maps
  4. Update to the latest compatible versions of all the dependencies by executing the following command:

    Use dark colors for code blocksCopy
    1
    flutter pub upgrade
  5. Download and install arcgis_maps_core:

    Use dark colors for code blocksCopy
    1
    dart run arcgis_maps install

To use this API, add the following import statement to any of your dart code (.dart) files:

Use dark colors for code blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import 'package:arcgis_maps/arcgis_maps.dart';

Platform specific configuration

To develop for Android, iOS, or both, you must also make the following configuration changes in your Flutter project.

  1. Update the following minimum requirements:

    • Android NDK version: 25.2.9519653

    • Android minimum SDK version: 26

    android/app/build.gradle
    Use dark colors for code blocks
    8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    Change lineChange line
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    android {
        namespace = "com.esri.flutter_project_template"
        compileSdk = flutter.compileSdkVersion
        ndkVersion = "25.2.9519653"
    
        compileOptions {
            sourceCompatibility = JavaVersion.VERSION_1_8
            targetCompatibility = JavaVersion.VERSION_1_8
        }
    
        kotlinOptions {
            jvmTarget = JavaVersion.VERSION_1_8
        }
    
        defaultConfig {
            // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
            applicationId = "com.esri.flutter_project_template"
            // You can update the following values to match your application needs.
            // For more information, see: https://flutter.dev/to/review-gradle-config.
            minSdk = 26
            targetSdk = flutter.targetSdkVersion
            versionCode = flutter.versionCode
            versionName = flutter.versionName
        }
    
  2. Update the Kotlin version:

    • Kotlin version: 1.9.0
    android/settings.gradle
    Use dark colors for code blocks
    19 20 21 22 23
    Change line
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    plugins {
        id "dev.flutter.flutter-plugin-loader" version "1.0.0"
        id "com.android.application" version "8.1.0" apply false
        id "org.jetbrains.kotlin.android" version "1.9.0" apply false
    }
    

Capabilities requiring permissions

The following permissions are required to deploy an application with a dependency on ArcGIS Maps SDK for Flutter. Add permission to access online resources and add permission to access the device's GPS. Note that users are only prompted to provide permission for access to device location if the app is actively using API that requires it.

android/app/src/main/AndroidManifest.xml
Use dark colors for code blocks
2 3 4 5 6 7 8 9
Add line.Add line.Add line.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <application
        android:label="flutter_project_template"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">

Enabling access to device's storage

If you require read/write operations to the device's storage, such as adding or exporting attachments, you may need to add the following additional permissions:

android/app/src/main/AndroidManifest.xml
Use dark colors for code blocks
2 3 4 5 6 7 8 9
Add line.Add line.Add line.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <application
        android:label="flutter_project_template"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">

Enabling user authentication

If you require the use of a system browser for user authentication, you need to add the following:

android/app/src/main/AndroidManifest.xml
Use dark colors for code blocks
37 38 39 40 41 42 43 44 45 46
Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
        <activity
            android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
            android:exported="true">
            <intent-filter android:label="flutter_web_auth_2">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="YOUR_CALLBACK_URL_SCHEME_HERE" />
            </intent-filter>
        </activity>

Replace YOUR_CALLBACK_URL_SCHEME_HERE with the scheme of the redirect URL used when you set up OAuth credentials in your portal. This is necessary so that the browser can communicate back to your app after the login workflow completes.

Additional downloads

Additional sources of sample code and data are available to enhance your development projects. You can even download this guide as stand-alone developer documentation.

Sample code

Get hands-on sample code that illustrates a variety of powerful capabilities that you can add to your own applications. Search for samples and browse the relevant code in the samples documentation or download the code from the samples repository and run them locally.

Stand-alone developer documentation

You can download the developer documentation as an archive from the downloads page. The archive contains instructions to serve the documentation from a local web server so you can access it without a connection to the internet. The stand-alone documentation includes the developer guide, API reference, tutorials, and samples documentation. This documentation is designed to run on a local stand-alone computer or on an internal network and not on the public internet.

To serve the documentation locally:

  • Download the documentation for the SDK you want to use. The downloaded files are in a .zip archive format.
  • Extract the archive to a local folder. The extracted archive has two subfolders: public and install.
  • Open the README.md file in the install folder and follow the instructions for your chosen web server.

Supplemental data

StreetMap Premium

StreetMap Premium delivers a high-quality, multiscale cartographic map display with enriched street data. In addition, it provides accurate geocoding, optimized routing, easy to follow directions, and powerful network analysis. StreetMap Premium maps can simultaneously fulfill the need for an address locator, street network dataset, and basemap in your apps. They are consistent across all regions of the world and are available for both online, connected scenarios and for use in offline, disconnected scenarios in the form of mobile map packages.

If you want to use StreetMap Premium data (the StreetMap Premium extension), download the demonstration data from the downloads page for development and testing. Please contact Esri Customer Service for access to a region of your choice for development and testing or to license StreetMap Premium data for deployment.

Projection Engine data

Datum transformations are used when geometries must be projected from one spatial reference to another when there is a difference in the datum that underlies the two spatial references. Datum transformations can be mathematically defined (equation-based transformations), or may rely on external supporting files (grid-based transformations). Certain Projection Engine data files must be present when you use a grid-based transformation in your app; attempting to use a transformation with missing Projection Engine files will cause an error. The API can detect whether the necessary files are available on the local file system.

If your app requires grid-based transformations, you can download supporting Projection Engine files from the downloads page. See the Spatial references topic for more information about working with coordinate systems, projections, and datum transformations.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.