|
1 | 1 | # ArcGIS Maps SDK for Flutter Samples |
2 | 2 |
|
3 | | -This repository contains Flutter sample code demonstrating the capabilities of ArcGIS Maps SDK for Flutter and how to use them in your own app. The project can be opened in Visual Studio Code and run on a simulator or a device. |
| 3 | +This repository contains Flutter sample code demonstrating the capabilities of ArcGIS Maps SDK for Flutter and how to use them in your own app. This SDK enables development of cross-platform GIS apps for mobile devices running iOS and Android. |
| 4 | + |
| 5 | +## Running the Samples app |
| 6 | + |
| 7 | +The app can be run on an iOS or Android simulator or device. |
| 8 | + |
| 9 | +- Open the flutter project in VSCode |
| 10 | +- Ensure a simulator is running or a device is connected to your development machine |
| 11 | +- Open the "Run and Debug" sidebar |
| 12 | +- Select which device or simulator you wish to use in the lower right corner of the VSCode window |
| 13 | +- Select "Samples (debug or release)" |
| 14 | + - Note that "Samples (release)" can only be run on a device |
| 15 | +- Click the run button or press F5 |
| 16 | + |
| 17 | +## Running individual samples |
| 18 | + |
| 19 | +Individual samples can also be run on an iOS or Android simulator or device. |
| 20 | + |
| 21 | +- Open the flutter project in VSCode |
| 22 | +- Ensure a simulator is running or a device is connected to your development machine |
| 23 | +- Select which device or simulator you wish to use in the lower right corner of the VSCode window |
| 24 | +- To run from VSCode, open a sample file from `/lib/src/samples` e.g. `display_map.dart` and click `run` above the `main()` method |
| 25 | +- Or run from the command line with `flutter run lib/src/samples/display_map.dart` |
| 26 | + |
| 27 | +## Configuring API Keys |
| 28 | + |
| 29 | +To fully take advantage of the samples in the app, you will need to generate an API Key. |
| 30 | + |
| 31 | +- Log into your developer account at the [ArcGIS Developers](https://developers.arcgis.com/) |
| 32 | + - If you do not have an account, [create one](https://developers.arcgis.com/sign-up/) |
| 33 | +- Go to the "API keys" tab |
| 34 | +- Click the "New API Key" button and provide a Title and Description |
| 35 | +- Set Location Service scopes to add or remove key capabilities |
| 36 | + |
| 37 | +Add the new API Key directly to [main.dart](lib/main.dart) or create an environment JSON file that can be loaded with the `--dart-define-from-file` `flutter run` command line argument. |
| 38 | + |
| 39 | +``` |
| 40 | +flutter run --dart-define-from-file=path/to/json/file.json |
| 41 | +``` |
| 42 | + |
| 43 | +or to run an individual sample: |
| 44 | + |
| 45 | +``` |
| 46 | +flutter run lib/src/samples/display_map.dart --dart-define-from-file=path/to/json/file.json |
| 47 | +``` |
4 | 48 |
|
5 | 49 | ## Licensing |
6 | | -Copyright 2022 - 2023 Esri |
| 50 | +Copyright 2024 Esri |
7 | 51 |
|
8 | 52 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at |
9 | 53 |
|
|
0 commit comments