Skip to content

Commit 653d875

Browse files
authored
Initial Samples Project
This PR ports the Samples project to this separate Github repo.
2 parents d9ba61d + 6d23177 commit 653d875

File tree

137 files changed

+7498
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+7498
-22
lines changed

.gitignore

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
1-
# See https://www.dartlang.org/guides/libraries/private-files
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
212

3-
# Files and directories created by pub
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
pubspec.lock
26+
**/doc/api/
27+
**/ios/Flutter/.last_build_id
428
.dart_tool/
5-
.packages
29+
.flutter-plugins
30+
.flutter-plugins-dependencies
31+
.pub-cache/
32+
.pub/
33+
/build/
634
build/
7-
# If you're building an application, you may want to check-in your pubspec.lock
8-
pubspec.lock
35+
.packages
936

10-
# Directory created by dartdoc
11-
# If you don't generate documentation locally you can remove this line.
12-
doc/api/
1337

14-
# dotenv environment variables file
15-
.env*
38+
# Symbolication related
39+
app.*.symbols
1640

17-
# Avoid committing generated Javascript files:
18-
*.dart.js
19-
*.info.json # Produced by the --dump-info flag.
20-
*.js # When generated by dart2js. Don't specify *.js if your
21-
# project includes source files written in JavaScript.
22-
*.js_
23-
*.js.deps
24-
*.js.map
41+
# Obfuscation related
42+
app.*.map.json
2543

26-
.flutter-plugins
27-
.flutter-plugins-dependencies
44+
# Android Studio will place build artifacts here
45+
/android/app/debug
46+
/android/app/profile
47+
/android/app/release
48+
49+
50+
env.json
51+
52+
arcgis_maps_core

.metadata

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "9e1c857886f07d342cf106f2cd588bcd5e031bb2"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
17+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
18+
- platform: android
19+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
20+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
21+
- platform: ios
22+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
23+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
24+
25+
# User provided section
26+
27+
# List of Local paths (relative to this file) that should be
28+
# ignored by the migrate tool.
29+
#
30+
# Files that are not part of the templates will be ignored by default.
31+
unmanaged_files:
32+
- 'lib/main.dart'
33+
- 'ios/Runner.xcodeproj/project.pbxproj'

.vscode/launch.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Samples (debug)",
9+
"request": "launch",
10+
"type": "dart",
11+
"flutterMode": "debug"
12+
},
13+
{
14+
"name": "Samples (release)",
15+
"request": "launch",
16+
"type": "dart",
17+
"flutterMode": "release"
18+
},
19+
{
20+
"name": "Samples with API Key (debug)",
21+
"request": "launch",
22+
"type": "dart",
23+
"flutterMode": "debug",
24+
"toolArgs": [
25+
"--dart-define-from-file=env.json"
26+
]
27+
},
28+
{
29+
"name": "Samples with API Key (release)",
30+
"request": "launch",
31+
"type": "dart",
32+
"flutterMode": "release",
33+
"toolArgs": [
34+
"--dart-define-from-file=env.json"
35+
]
36+
},
37+
{
38+
"name": "Custom Sample with API Key (debug)",
39+
"request": "launch",
40+
"type": "dart",
41+
"flutterMode": "debug",
42+
// replace display_map with another sample to run individually
43+
"program": "lib/src/samples/display_map.dart",
44+
"toolArgs": [
45+
"--dart-define-from-file=env.json"
46+
]
47+
},
48+
]
49+
}

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,53 @@
11
# ArcGIS Maps SDK for Flutter Samples
22

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+
```
448

549
## Licensing
6-
Copyright 2022 - 2023 Esri
50+
Copyright 2024 Esri
751

852
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
953

analysis_options.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
linter:
4+
rules:
5+
prefer_single_quotes: true

android/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks

android/app/build.gradle

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
if (flutterVersionCode == null) {
17+
flutterVersionCode = '1'
18+
}
19+
20+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
if (flutterVersionName == null) {
22+
flutterVersionName = '1.0'
23+
}
24+
25+
android {
26+
namespace "com.esri.arcgis_maps_sdk_flutter_samples"
27+
compileSdkVersion flutter.compileSdkVersion
28+
ndkVersion "25.2.9519653"
29+
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
35+
kotlinOptions {
36+
jvmTarget = '1.8'
37+
}
38+
39+
sourceSets {
40+
main.java.srcDirs += 'src/main/kotlin'
41+
}
42+
43+
defaultConfig {
44+
applicationId "com.esri.arcgis_maps_sdk_flutter_samples"
45+
minSdkVersion 26
46+
ndk {
47+
abiFilters 'x86_64', 'arm64-v8a'
48+
}
49+
targetSdkVersion flutter.targetSdkVersion
50+
versionCode flutterVersionCode.toInteger()
51+
versionName flutterVersionName
52+
}
53+
54+
buildTypes {
55+
release {
56+
signingConfig signingConfigs.debug
57+
}
58+
}
59+
}
60+
61+
flutter {
62+
source '../..'
63+
}
64+
65+
dependencies {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<uses-permission android:name="android.permission.INTERNET" />
3+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
4+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5+
<application
6+
android:label="arcgis_maps_sdk_flutter_samples"
7+
android:name="${applicationName}"
8+
android:icon="@mipmap/ic_launcher">
9+
<activity
10+
android:name=".MainActivity"
11+
android:exported="true"
12+
android:launchMode="singleTop"
13+
android:theme="@style/LaunchTheme"
14+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
15+
android:hardwareAccelerated="true"
16+
android:windowSoftInputMode="adjustResize">
17+
<!-- Specifies an Android theme to apply to this Activity as soon as
18+
the Android process has started. This theme is visible to the user
19+
while the Flutter UI initializes. After that, this theme continues
20+
to determine the Window background behind the Flutter UI. -->
21+
<meta-data
22+
android:name="io.flutter.embedding.android.NormalTheme"
23+
android:resource="@style/NormalTheme"
24+
/>
25+
<intent-filter>
26+
<action android:name="android.intent.action.MAIN"/>
27+
<category android:name="android.intent.category.LAUNCHER"/>
28+
</intent-filter>
29+
</activity>
30+
<!-- Don't delete the meta-data below.
31+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
32+
<meta-data
33+
android:name="flutterEmbedding"
34+
android:value="2" />
35+
</application>
36+
</manifest>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../arcgis_maps_core/android/arm64-v8a/libarcgis_maps_ffi.so

0 commit comments

Comments
 (0)