diff --git a/.github/workflows/pre_commit_check.yml b/.github/workflows/pre_commit_check.yml
index a35a92c035..c02ac7d682 100644
--- a/.github/workflows/pre_commit_check.yml
+++ b/.github/workflows/pre_commit_check.yml
@@ -13,8 +13,14 @@ env:
jobs:
precommit:
- runs-on: ubuntu-latest
+ # ArcGIS Maps' native build hook rejects Linux before Flutter tests start.
+ # Its test-host hook supports Windows, while production builds remain
+ # limited to the Android and iOS targets declared by the package.
+ runs-on: windows-latest
timeout-minutes: 20
+ defaults:
+ run:
+ shell: bash
steps:
- name: Check out code
uses: actions/checkout@v4
diff --git a/.gitignore b/.gitignore
index 52b9332cdf..d6ddc6ffec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -125,3 +125,6 @@ android/app/google-services.json
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
+
+# ESRI Map
+arcgis_maps_core
diff --git a/android/app/build.gradle b/android/app/build.gradle
index f190221d5e..5488c54bcf 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -16,7 +16,7 @@ if (keystorePropertiesFile.exists()) {
android {
namespace = "edu.ucsd"
compileSdk = 36
- ndkVersion = "27.0.12077973"
+ ndkVersion = "28.2.13676358"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
@@ -34,7 +34,7 @@ android {
defaultConfig {
applicationId = "edu.ucsd"
- minSdkVersion = flutter.minSdkVersion
+ minSdkVersion = 28
targetSdk = 36
versionCode = flutter.versionCode
versionName = flutter.versionName
diff --git a/assets/esri_map_assets/Center-Trident.svg b/assets/esri_map_assets/Center-Trident.svg
new file mode 100644
index 0000000000..b27fc3844c
--- /dev/null
+++ b/assets/esri_map_assets/Center-Trident.svg
@@ -0,0 +1,119 @@
+
diff --git a/assets/esri_map_assets/construction-thumbnail.png b/assets/esri_map_assets/construction-thumbnail.png
new file mode 100644
index 0000000000..61830070a3
Binary files /dev/null and b/assets/esri_map_assets/construction-thumbnail.png differ
diff --git a/assets/esri_map_assets/dark-thumbnail.png b/assets/esri_map_assets/dark-thumbnail.png
new file mode 100644
index 0000000000..a075c06460
Binary files /dev/null and b/assets/esri_map_assets/dark-thumbnail.png differ
diff --git a/assets/esri_map_assets/default-thumbnail.png b/assets/esri_map_assets/default-thumbnail.png
new file mode 100644
index 0000000000..d0f788b91e
Binary files /dev/null and b/assets/esri_map_assets/default-thumbnail.png differ
diff --git a/assets/esri_map_assets/districts-thumbnail.png b/assets/esri_map_assets/districts-thumbnail.png
new file mode 100644
index 0000000000..148916efac
Binary files /dev/null and b/assets/esri_map_assets/districts-thumbnail.png differ
diff --git a/assets/esri_map_assets/light-thumbnail.png b/assets/esri_map_assets/light-thumbnail.png
new file mode 100644
index 0000000000..36b5e8643d
Binary files /dev/null and b/assets/esri_map_assets/light-thumbnail.png differ
diff --git a/assets/esri_map_assets/mapConfig.json b/assets/esri_map_assets/mapConfig.json
new file mode 100644
index 0000000000..684b2dd455
--- /dev/null
+++ b/assets/esri_map_assets/mapConfig.json
@@ -0,0 +1,170 @@
+{
+ "portals": {
+ "age": "https://admin-enterprise-gis.ucsd.edu/portal",
+ "ago": "https://www.arcgis.com"
+ },
+
+ "serviceUrls": {
+ "hillshade": "https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",
+ "lightGrayBase": "https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer",
+ "darkGrayBase": "https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer",
+ "nearmap": "https://admin-enterprise-gis.ucsd.edu/server/rest/services/Campus_Imagery_Nearmap_9in_2025_0423_0514/MapServer",
+ "worldImagery": "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
+ },
+
+ "basemaps": {
+ "defaultMap": {
+ "label": "Default",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/default-thumbnail.png",
+ "baseLayers": [
+ {
+ "type": "arcgisVectorTiled",
+ "portalKey": "ago",
+ "itemId": "291da5eab3a0412593b66d384379f89f"
+ },
+ {
+ "type": "arcgisVectorTiled",
+ "portalKey": "age",
+ "itemId": "e19f33d2c1f44967aef673306c483913"
+ }
+ ]
+ },
+ "light": {
+ "label": "Light",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/light-thumbnail.png",
+ "baseLayers": [
+ {
+ "type": "arcgisVectorTiled",
+ "portalKey": "ago",
+ "itemId": "291da5eab3a0412593b66d384379f89f"
+ },
+ {
+ "type": "arcgisVectorTiled",
+ "portalKey": "age",
+ "itemId": "6643ee62af494f5bafe7dfdb8eb3f857"
+ }
+ ]
+ },
+ "dark": {
+ "label": "Dark",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/dark-thumbnail.png",
+ "baseLayers": [
+ {
+ "type": "arcgisVectorTiled",
+ "portalKey": "ago",
+ "itemId": "5e9b3685f4c24d8781073dd928ebda50"
+ },
+ {
+ "type": "arcgisVectorTiled",
+ "portalKey": "age",
+ "itemId": "09d7b3934b6c4c2cad8380c04e08c1b1"
+ }
+ ]
+ },
+ "satellite": {
+ "label": "Satellite",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/satellite-thumbnail.png",
+ "baseLayers": [
+ {
+ "type": "arcgisTiled",
+ "serviceKey": "worldImagery"
+ }
+ ]
+ }
+ },
+
+ "layers": {
+ "tritonTransit": {
+ "label": "Transit",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/shuttles-thumbnail.png",
+ "source": "portalItem",
+ "portalKey": "ago",
+ "itemId": "ea5cdd8987414942b62178726120d5c7",
+ "refreshInterval": 0,
+ "popup": false
+ },
+ "campusDistricts": {
+ "label": "Districts",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/districts-thumbnail.png",
+ "source": "url",
+ "url": "https://admin-enterprise-gis.ucsd.edu/server/rest/services/AdministrationServices/Areas_and_Boundaries/MapServer/4",
+ "refreshInterval": 0,
+ "popup": false
+ },
+ "construction": {
+ "label": "Construction",
+ "thumbnailAsset": "https://dvsbke0idzv4u.cloudfront.net/thumbnails/construction-thumbnail.png",
+ "source": "url",
+ "sublayers": [
+ {
+ "source": "url",
+ "url": "https://admin-enterprise-gis.ucsd.edu/server/rest/services/Construction/Construction_Alert_Approved/MapServer/0",
+ "refreshInterval": 0
+ },
+ {
+ "source": "url",
+ "url": "https://admin-enterprise-gis.ucsd.edu/server/rest/services/Construction/Construction_Alert_Approved/MapServer/1",
+ "refreshInterval": 0
+ },
+ {
+ "source": "url",
+ "url": "https://admin-enterprise-gis.ucsd.edu/server/rest/services/Construction/Construction_Alert_Approved/MapServer/2",
+ "refreshInterval": 0
+ }
+ ],
+ "refreshInterval": 0,
+ "popup": false
+ }
+ },
+
+ "scenes": {
+ "default": {
+ "label": "Default",
+ "type": "2d"
+ },
+ "building3d": {
+ "label": "3D Building",
+ "type": "scene",
+ "portalKey": "ago",
+ "itemId": "b6931d8c429c4138afd9dd936ee7bcd1"
+ },
+ "droneView": {
+ "label": "Drone View",
+ "type": "scene",
+ "portalKey": "age",
+ "itemId": "0ffe293479844ce49ff5c30ffc0a0b67"
+ }
+ },
+
+ "features": {
+ "aiSearch": true,
+ "scenes": true
+ },
+
+ "searchCategories": [
+ {
+ "label": "Dining",
+ "poiClass": "Dining and Beverage",
+ "icon": "restaurant",
+ "color": "#00C6D7"
+ },
+ {
+ "label": "Library",
+ "poiClass": "Library",
+ "icon": "menu_book",
+ "color": "#D462AD"
+ },
+ {
+ "label": "Parking",
+ "poiClass": "Parking",
+ "icon": "local_parking",
+ "color": "#6E963B"
+ },
+ {
+ "label": "Recreation",
+ "poiClass": "Recreation Facilities",
+ "icon": "fitness_center",
+ "color": "#FC8900"
+ }
+ ]
+}
diff --git a/assets/esri_map_assets/satellite-thumbnail.png b/assets/esri_map_assets/satellite-thumbnail.png
new file mode 100644
index 0000000000..d66c7b6834
Binary files /dev/null and b/assets/esri_map_assets/satellite-thumbnail.png differ
diff --git a/assets/esri_map_assets/shuttles-thumbnail.png b/assets/esri_map_assets/shuttles-thumbnail.png
new file mode 100644
index 0000000000..977d2bb51c
Binary files /dev/null and b/assets/esri_map_assets/shuttles-thumbnail.png differ
diff --git a/assets/esri_map_assets/tgpt-dark.svg b/assets/esri_map_assets/tgpt-dark.svg
new file mode 100644
index 0000000000..59a5767677
--- /dev/null
+++ b/assets/esri_map_assets/tgpt-dark.svg
@@ -0,0 +1,14 @@
+
diff --git a/assets/esri_map_assets/tgpt-light.svg b/assets/esri_map_assets/tgpt-light.svg
new file mode 100644
index 0000000000..10d9304a8c
--- /dev/null
+++ b/assets/esri_map_assets/tgpt-light.svg
@@ -0,0 +1,14 @@
+
diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist
index 86343d8600..f32f270dc1 100644
--- a/ios/Flutter/AppFrameworkInfo.plist
+++ b/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 16.0
+ 17.0
diff --git a/ios/Podfile b/ios/Podfile
index 755467ccd7..824c74203c 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
-platform :ios, '16.0'
+platform :ios, '17.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -31,6 +31,9 @@ target 'Runner' do
use_frameworks!
use_modular_headers!
+ pod 'Runtimecore', :podspec => '../arcgis_maps_core/ios/Runtimecore.podspec'
+ pod 'arcgis_maps_ffi', :podspec => '../arcgis_maps_core/ios/arcgis_maps_ffi.podspec'
+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
@@ -38,7 +41,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '17.0'
end
end
end
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index a7c9c228c9..97565cab2f 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -158,6 +158,7 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
348EE9E2258A901800712F2E /* ShellScript */,
B19D24E1170B60724162B13B /* [CP] Embed Pods Frameworks */,
+ F3660986D315CC3D0C38923C /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -241,7 +242,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${BUILD_DIR%Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n";
+ shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/FirebaseCrashlytics/run\"\n";
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
@@ -281,13 +282,69 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
+ "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfigInterop/FirebaseRemoteConfigInterop.framework",
+ "${BUILT_PRODUCTS_DIR}/FirebaseSessions/FirebaseSessions.framework",
+ "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
+ "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
+ "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
+ "${BUILT_PRODUCTS_DIR}/PromisesSwift/Promises.framework",
"${BUILT_PRODUCTS_DIR}/app_links/app_links.framework",
+ "${BUILT_PRODUCTS_DIR}/arcgis_maps/arcgis_maps.framework",
+ "${BUILT_PRODUCTS_DIR}/connectivity_plus/connectivity_plus.framework",
+ "${BUILT_PRODUCTS_DIR}/device_info_plus/device_info_plus.framework",
+ "${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
+ "${BUILT_PRODUCTS_DIR}/flutter_secure_storage_darwin/flutter_secure_storage_darwin.framework",
+ "${BUILT_PRODUCTS_DIR}/flutter_web_auth_2/flutter_web_auth_2.framework",
+ "${BUILT_PRODUCTS_DIR}/geolocator_apple/geolocator_apple.framework",
+ "${BUILT_PRODUCTS_DIR}/haptic_feedback/haptic_feedback.framework",
+ "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
+ "${BUILT_PRODUCTS_DIR}/package_info_plus/package_info_plus.framework",
+ "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
+ "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
+ "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
+ "${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework",
"${BUILT_PRODUCTS_DIR}/wifi_connection/wifi_connection.framework",
+ "${PODS_XCFRAMEWORKS_BUILD_DIR}/Runtimecore/Runtimecore.framework/Runtimecore",
+ "${PODS_XCFRAMEWORKS_BUILD_DIR}/arcgis_maps_ffi/arcgis_maps_ffi.framework/arcgis_maps_ffi",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCrashlytics.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfigInterop.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseSessions.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Promises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/app_links.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/arcgis_maps.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity_plus.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_storage_darwin.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_web_auth_2.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/geolocator_apple.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/haptic_feedback.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info_plus.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wifi_connection.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Runtimecore.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/arcgis_maps_ffi.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -316,6 +373,30 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
+ F3660986D315CC3D0C38923C /* [CP] Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/GoogleMaps/GoogleMapsResources.bundle",
+ "${PODS_CONFIGURATION_BUILD_DIR}/firebase_messaging/firebase_messaging_Privacy.bundle",
+ "${PODS_CONFIGURATION_BUILD_DIR}/google_maps_flutter_ios_sdk10/google_maps_flutter_ios_sdk10_privacy.bundle",
+ "${PODS_CONFIGURATION_BUILD_DIR}/permission_handler_apple/permission_handler_apple_privacy.bundle",
+ );
+ name = "[CP] Copy Pods Resources";
+ outputPaths = (
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMapsResources.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/firebase_messaging_Privacy.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/google_maps_flutter_ios_sdk10_privacy.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/permission_handler_apple_privacy.bundle",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -416,7 +497,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 16.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -558,7 +639,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 16.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -595,7 +676,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 16.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
deleted file mode 100644
index c47cc29630..0000000000
--- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ /dev/null
@@ -1,149 +0,0 @@
-{
- "pins" : [
- {
- "identity" : "abseil-cpp-binary",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/abseil-cpp-binary.git",
- "state" : {
- "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5",
- "version" : "1.2024072200.0"
- }
- },
- {
- "identity" : "app-check",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/app-check.git",
- "state" : {
- "revision" : "3e33dd27dd4c69bd81c7c81fe61d8ccf58846902",
- "version" : "11.3.1"
- }
- },
- {
- "identity" : "firebase-ios-sdk",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/firebase-ios-sdk",
- "state" : {
- "revision" : "9ab4a7e6e5d6d3df2a2aa002a11d25e078c8d6e5",
- "version" : "12.16.0"
- }
- },
- {
- "identity" : "flutterfire",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/flutterfire",
- "state" : {
- "revision" : "39bdb5b1ef392e8c31c60209e333b45e408099e8",
- "version" : "4.3.0-firebase-core-swift"
- }
- },
- {
- "identity" : "google-ads-on-device-conversion-ios-sdk",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk",
- "state" : {
- "revision" : "dc39082d8881109d35b94b1c122164c0e8d08a55",
- "version" : "3.6.1"
- }
- },
- {
- "identity" : "google-maps-ios-utils",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/googlemaps/google-maps-ios-utils",
- "state" : {
- "revision" : "1727a5e25036cecc07296569b8ad3f85d4baca4b",
- "version" : "6.1.3"
- }
- },
- {
- "identity" : "googleappmeasurement",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/GoogleAppMeasurement.git",
- "state" : {
- "revision" : "ce606e3768abddff0510783e1a6d2f270b943b35",
- "version" : "12.16.0"
- }
- },
- {
- "identity" : "googledatatransport",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/GoogleDataTransport.git",
- "state" : {
- "revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
- "version" : "10.1.0"
- }
- },
- {
- "identity" : "googleutilities",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/GoogleUtilities.git",
- "state" : {
- "revision" : "9f183ae842be978784f2963a343682e0c46d8fb3",
- "version" : "8.1.2"
- }
- },
- {
- "identity" : "grpc-binary",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/grpc-binary.git",
- "state" : {
- "revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6",
- "version" : "1.69.1"
- }
- },
- {
- "identity" : "gtm-session-fetcher",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/gtm-session-fetcher.git",
- "state" : {
- "revision" : "c0ac7575d70050c2973ba2318bd5af47f8e8153a",
- "version" : "5.3.0"
- }
- },
- {
- "identity" : "interop-ios-for-google-sdks",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
- "state" : {
- "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
- "version" : "101.0.0"
- }
- },
- {
- "identity" : "ios-maps-sdk",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/googlemaps/ios-maps-sdk",
- "state" : {
- "revision" : "a951b24ac0ca7720f87d4be3d5bd539552d13882",
- "version" : "10.15.0"
- }
- },
- {
- "identity" : "leveldb",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/leveldb.git",
- "state" : {
- "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
- "version" : "1.22.5"
- }
- },
- {
- "identity" : "nanopb",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/nanopb.git",
- "state" : {
- "revision" : "3851d94a41890dea16dc3db34caf60e585cb4163",
- "version" : "2.30910.1"
- }
- },
- {
- "identity" : "promises",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/promises.git",
- "state" : {
- "revision" : "f4a19a3c313dc2616c70bb49d29a799fb16be837",
- "version" : "2.4.1"
- }
- }
- ],
- "version" : 2
-}
diff --git a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
deleted file mode 100644
index c47cc29630..0000000000
--- a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ /dev/null
@@ -1,149 +0,0 @@
-{
- "pins" : [
- {
- "identity" : "abseil-cpp-binary",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/abseil-cpp-binary.git",
- "state" : {
- "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5",
- "version" : "1.2024072200.0"
- }
- },
- {
- "identity" : "app-check",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/app-check.git",
- "state" : {
- "revision" : "3e33dd27dd4c69bd81c7c81fe61d8ccf58846902",
- "version" : "11.3.1"
- }
- },
- {
- "identity" : "firebase-ios-sdk",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/firebase-ios-sdk",
- "state" : {
- "revision" : "9ab4a7e6e5d6d3df2a2aa002a11d25e078c8d6e5",
- "version" : "12.16.0"
- }
- },
- {
- "identity" : "flutterfire",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/flutterfire",
- "state" : {
- "revision" : "39bdb5b1ef392e8c31c60209e333b45e408099e8",
- "version" : "4.3.0-firebase-core-swift"
- }
- },
- {
- "identity" : "google-ads-on-device-conversion-ios-sdk",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk",
- "state" : {
- "revision" : "dc39082d8881109d35b94b1c122164c0e8d08a55",
- "version" : "3.6.1"
- }
- },
- {
- "identity" : "google-maps-ios-utils",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/googlemaps/google-maps-ios-utils",
- "state" : {
- "revision" : "1727a5e25036cecc07296569b8ad3f85d4baca4b",
- "version" : "6.1.3"
- }
- },
- {
- "identity" : "googleappmeasurement",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/GoogleAppMeasurement.git",
- "state" : {
- "revision" : "ce606e3768abddff0510783e1a6d2f270b943b35",
- "version" : "12.16.0"
- }
- },
- {
- "identity" : "googledatatransport",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/GoogleDataTransport.git",
- "state" : {
- "revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
- "version" : "10.1.0"
- }
- },
- {
- "identity" : "googleutilities",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/GoogleUtilities.git",
- "state" : {
- "revision" : "9f183ae842be978784f2963a343682e0c46d8fb3",
- "version" : "8.1.2"
- }
- },
- {
- "identity" : "grpc-binary",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/grpc-binary.git",
- "state" : {
- "revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6",
- "version" : "1.69.1"
- }
- },
- {
- "identity" : "gtm-session-fetcher",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/gtm-session-fetcher.git",
- "state" : {
- "revision" : "c0ac7575d70050c2973ba2318bd5af47f8e8153a",
- "version" : "5.3.0"
- }
- },
- {
- "identity" : "interop-ios-for-google-sdks",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
- "state" : {
- "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
- "version" : "101.0.0"
- }
- },
- {
- "identity" : "ios-maps-sdk",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/googlemaps/ios-maps-sdk",
- "state" : {
- "revision" : "a951b24ac0ca7720f87d4be3d5bd539552d13882",
- "version" : "10.15.0"
- }
- },
- {
- "identity" : "leveldb",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/leveldb.git",
- "state" : {
- "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
- "version" : "1.22.5"
- }
- },
- {
- "identity" : "nanopb",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/firebase/nanopb.git",
- "state" : {
- "revision" : "3851d94a41890dea16dc3db34caf60e585cb4163",
- "version" : "2.30910.1"
- }
- },
- {
- "identity" : "promises",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/promises.git",
- "state" : {
- "revision" : "f4a19a3c313dc2616c70bb49d29a799fb16be837",
- "version" : "2.4.1"
- }
- }
- ],
- "version" : 2
-}
diff --git a/lib/app_networking.dart b/lib/app_networking.dart
index f7026077a2..bce80e2a46 100644
--- a/lib/app_networking.dart
+++ b/lib/app_networking.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:campus_mobile_experimental/app_styles.dart';
import 'package:dio/dio.dart';
diff --git a/lib/app_router.dart b/lib/app_router.dart
index 78058c8507..ca1b56b968 100644
--- a/lib/app_router.dart
+++ b/lib/app_router.dart
@@ -35,6 +35,7 @@ import 'package:campus_mobile_experimental/ui/shuttle/add_shuttle_stops_view.dar
import 'package:campus_mobile_experimental/ui/shuttle/manage_shuttle_view.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
+import 'package:campus_mobile_experimental/ui/esrimap/esrimap.dart';
class Router {
static Route generateRoute(RouteSettings settings) {
@@ -53,7 +54,7 @@ class Router {
},
);
case RoutePaths.MAP:
- return MaterialPageRoute(builder: (_) => prefix0.Maps());
+ return MaterialPageRoute(builder: (_) => EsriMap());
case RoutePaths.MAP_SEARCH:
return MaterialPageRoute(builder: (_) => MapSearchView());
case RoutePaths.NOTIFICATIONS:
diff --git a/lib/app_styles.dart b/lib/app_styles.dart
index 5abe3fcbc6..26e35b1ea5 100644
--- a/lib/app_styles.dart
+++ b/lib/app_styles.dart
@@ -304,7 +304,7 @@ const IconThemeData darkIconTheme = IconThemeData(color: darkPrimaryColor2);
// Unselected / inactive colors
const Color unselectedIconLightColor = Color(0xFF6A6B6D);
-const Color unselectedIconDarkColor = Color(0xFF6A6B6D);
+const Color unselectedIconDarkColor = Color(0xFF909193);
const noArrivalsFoundColor = "#747678";
// Colors for text on buttons using light theme
@@ -351,7 +351,7 @@ const Color c3 = Color.fromARGB(255, 0, 0, 255);
// List Tile Theme Data
const lightListTileTheme = ListTileThemeData(selectedColor: const Color(0xFF00629B));
-const darkListTileTheme = ListTileThemeData(selectedColor: const Color(0xFF00C6D7));
+const darkListTileTheme = ListTileThemeData(selectedColor: secondaryColorDark);
// New Onboarding Screen Colors
const lightOnboardingScreen = Color.fromARGB(255, 245, 240, 228);
diff --git a/lib/core/models/authentication.dart b/lib/core/models/authentication.dart
index a5eca9aac5..844e98c925 100644
--- a/lib/core/models/authentication.dart
+++ b/lib/core/models/authentication.dart
@@ -1,4 +1,5 @@
import 'dart:convert';
+
import 'package:hive/hive.dart';
part 'authentication.g.dart';
diff --git a/lib/core/models/dining.dart b/lib/core/models/dining.dart
index e9373afd3f..ec1621a88c 100644
--- a/lib/core/models/dining.dart
+++ b/lib/core/models/dining.dart
@@ -1,4 +1,5 @@
import 'dart:convert';
+
import 'package:campus_mobile_experimental/core/models/location.dart';
// To parse this JSON data, do
diff --git a/lib/core/models/esri_map_models/esrimap_ai_search_model.dart b/lib/core/models/esri_map_models/esrimap_ai_search_model.dart
new file mode 100644
index 0000000000..e68cbc0637
--- /dev/null
+++ b/lib/core/models/esri_map_models/esrimap_ai_search_model.dart
@@ -0,0 +1,105 @@
+/// ============================================================================
+/// File: esrimap_ai_search_model.dart
+/// Description: Data models for AI natural language search queries, including
+/// location search results, route stops, and response wrappers.
+/// ============================================================================
+
+/// Location search result returned by AI search endpoint.
+class AiSearchResult {
+ /// Name or title of location.
+ final String name;
+
+ /// Subtitle / category tag.
+ final String subtitle;
+
+ /// Physical address string.
+ final String address;
+
+ /// Latitude coordinate.
+ final double latitude;
+
+ /// Longitude coordinate.
+ final double longitude;
+
+ /// Optional distance in feet.
+ final int? distanceFeet;
+
+ /// Optional formatted distance string (e.g. "0.3 mi").
+ final String? distanceFormatted;
+
+ /// Constructs an [AiSearchResult] instance.
+ const AiSearchResult({
+ required this.name,
+ required this.subtitle,
+ required this.address,
+ required this.latitude,
+ required this.longitude,
+ this.distanceFeet,
+ this.distanceFormatted,
+ });
+
+ /// Factory constructor to deserialize [AiSearchResult] from a JSON map.
+ factory AiSearchResult.fromJson(Map j) => AiSearchResult(
+ name: j['name'] as String,
+ subtitle: j['subtitle'] as String? ?? '',
+ address: j['address'] as String? ?? '',
+ latitude: (j['latitude'] as num).toDouble(),
+ longitude: (j['longitude'] as num).toDouble(),
+ distanceFeet: j['distanceFeet'] as int?,
+ distanceFormatted: j['distanceFormatted'] as String?,
+ );
+}
+
+/// Geographical coordinate stop along a multi-stop AI route.
+class AiSearchRouteStop {
+ /// Latitude coordinate.
+ final double lat;
+
+ /// Longitude coordinate.
+ final double lon;
+
+ /// Constructs an [AiSearchRouteStop] instance.
+ const AiSearchRouteStop({required this.lat, required this.lon});
+
+ /// Factory constructor to deserialize [AiSearchRouteStop] from a JSON map.
+ factory AiSearchRouteStop.fromJson(Map j) =>
+ AiSearchRouteStop(lat: (j['lat'] as num).toDouble(), lon: (j['lon'] as num).toDouble());
+}
+
+/// Response payload returned from AI search REST API endpoint.
+class AiSearchResponse {
+ /// Explanatory text or response message.
+ final String message;
+
+ /// List of matching location search results.
+ final List results;
+
+ /// Optional list of stop names for suggested routes.
+ final List? routeStopNames;
+
+ /// Optional list of stop coordinates for suggested routes.
+ final List? routeStopCoords;
+
+ /// Constructs an [AiSearchResponse] instance.
+ const AiSearchResponse({required this.message, required this.results, this.routeStopNames, this.routeStopCoords});
+
+ /// Factory constructor to deserialize [AiSearchResponse] from a JSON map.
+ factory AiSearchResponse.fromJson(Map j) {
+ List? stopNames;
+ List? stopCoords;
+ final route = j['suggestedRoute'];
+ final hasRoute = route != null;
+ if (hasRoute) {
+ stopNames = (route['stops'] as List).cast();
+ stopCoords = (route['stopCoords'] as List)
+ .map((s) => AiSearchRouteStop.fromJson(s as Map))
+ .toList();
+ }
+ return AiSearchResponse(
+ message: j['message'] as String,
+ results: (j['results'] as List).map((r) => AiSearchResult.fromJson(r as Map)).toList(),
+ routeStopNames: stopNames,
+ routeStopCoords: stopCoords,
+ );
+ }
+}
diff --git a/lib/core/models/esri_map_models/esrimap_basemaps.dart b/lib/core/models/esri_map_models/esrimap_basemaps.dart
new file mode 100644
index 0000000000..b79cde4b1d
--- /dev/null
+++ b/lib/core/models/esri_map_models/esrimap_basemaps.dart
@@ -0,0 +1,50 @@
+/// ============================================================================
+/// File: esrimap_basemaps.dart
+/// Description: Enum models and conversion utilities for basemap types
+/// (Default, Light, Dark, Satellite).
+/// ============================================================================
+
+/// Enumeration representing available basemap styles on the map view.
+enum BasemapType {
+ /// Default standard campus vector map basemap.
+ defaultMap,
+
+ /// Light neutral canvas basemap.
+ light,
+
+ /// Dark slate mode basemap.
+ dark,
+
+ /// Satellite imagery basemap.
+ satellite,
+}
+
+/// Converts a [BasemapType] enum value into its corresponding configuration string key.
+String basemapKey(BasemapType type) {
+ switch (type) {
+ case BasemapType.defaultMap:
+ return 'defaultMap';
+ case BasemapType.light:
+ return 'light';
+ case BasemapType.dark:
+ return 'dark';
+ case BasemapType.satellite:
+ return 'satellite';
+ }
+}
+
+/// Converts a raw string key into a matching [BasemapType] enum, or null if unmapped.
+BasemapType? basemapTypeFromKey(String key) {
+ switch (key) {
+ case 'defaultMap':
+ return BasemapType.defaultMap;
+ case 'light':
+ return BasemapType.light;
+ case 'dark':
+ return BasemapType.dark;
+ case 'satellite':
+ return BasemapType.satellite;
+ default:
+ return null;
+ }
+}
diff --git a/lib/core/models/esri_map_models/esrimap_config.dart b/lib/core/models/esri_map_models/esrimap_config.dart
new file mode 100644
index 0000000000..6fa66a6532
--- /dev/null
+++ b/lib/core/models/esri_map_models/esrimap_config.dart
@@ -0,0 +1,300 @@
+/// ============================================================================
+/// File: esrimap_config.dart
+/// Description: Data models for parsing backend map configuration JSON,
+/// including portals, basemaps, operational layers, scenes, and feature flags.
+/// ============================================================================
+
+/// Specification for a base map layer.
+class BaseLayerSpec {
+ /// Layer type identifier ('arcgisTiled', 'arcgisVectorTiled', 'arcgisMapImage').
+ final String type;
+
+ /// Service key resolving to a URL in [EsriMapConfig.serviceUrls].
+ final String? serviceKey;
+
+ /// Portal key resolving to a portal URI in [EsriMapConfig.portals].
+ final String? portalKey;
+
+ /// Optional item ID for portal items.
+ final String? itemId;
+
+ /// Constructs a [BaseLayerSpec] instance.
+ const BaseLayerSpec({required this.type, this.serviceKey, this.portalKey, this.itemId});
+
+ /// Factory constructor to deserialize [BaseLayerSpec] from a JSON map.
+ factory BaseLayerSpec.fromJson(Map json) => BaseLayerSpec(
+ type: json['type'] as String,
+ serviceKey: json['serviceKey'] as String?,
+ portalKey: json['portalKey'] as String?,
+ itemId: json['itemId'] as String?,
+ );
+}
+
+/// Configuration structure for a basemap option.
+class BasemapConfig {
+ /// Display label for the basemap tile in UI.
+ final String label;
+
+ /// Asset path or URL for the basemap thumbnail image.
+ final String thumbnailAsset;
+
+ /// List of underlying base layers constituting the basemap.
+ final List baseLayers;
+
+ /// Constructs a [BasemapConfig] instance.
+ const BasemapConfig({required this.label, required this.thumbnailAsset, required this.baseLayers});
+
+ /// Factory constructor to deserialize [BasemapConfig] from a JSON map.
+ factory BasemapConfig.fromJson(Map json) => BasemapConfig(
+ label: json['label'] as String,
+ thumbnailAsset: json['thumbnailAsset'] as String,
+ baseLayers: (json['baseLayers'] as List).map((e) => BaseLayerSpec.fromJson(e as Map)).toList(),
+ );
+}
+
+/// Configuration structure for a sublayer inside a map image layer.
+class SublayerEntry {
+ /// Display name of the sublayer.
+ final String name;
+
+ /// Data source classification ('url', etc.).
+ final String source;
+
+ /// REST service URL for the sublayer.
+ final String? url;
+
+ /// Key resolving to a portal URI in [EsriMapConfig.portals].
+ final String? portalKey;
+
+ /// Optional item ID for portal items.
+ final String? itemId;
+
+ /// Refresh timer interval in seconds (0 = disabled).
+ final int refreshInterval;
+
+ /// Whether popup feature information is enabled for this sublayer.
+ final bool popup;
+
+ /// Optional template string for feature popups.
+ final String? popupTemplate;
+
+ /// Constructs a [SublayerEntry] instance.
+ const SublayerEntry({
+ required this.name,
+ required this.source,
+ this.url,
+ this.portalKey,
+ this.itemId,
+ required this.refreshInterval,
+ required this.popup,
+ this.popupTemplate,
+ });
+
+ /// Factory constructor to deserialize [SublayerEntry] from a JSON map.
+ factory SublayerEntry.fromJson(Map json) => SublayerEntry(
+ name: json['name'] as String? ?? '',
+ source: json['source'] as String? ?? '',
+ url: json['url'] as String?,
+ portalKey: json['portalKey'] as String?,
+ itemId: json['itemId'] as String?,
+ refreshInterval: (json['refreshInterval'] as num?)?.toInt() ?? 0,
+ popup: json['popup'] as bool? ?? false,
+ popupTemplate: json['popupTemplate'] as String?,
+ );
+}
+
+/// Configuration structure for an operational layer toggle.
+class LayerEntry {
+ /// Display label for the layer in UI.
+ final String label;
+
+ /// Asset path or URL for the layer thumbnail image.
+ final String thumbnailAsset;
+
+ /// Data source type string.
+ final String? source;
+
+ /// REST service URL for the layer.
+ final String? url;
+
+ /// Key resolving to a portal URI in [EsriMapConfig.portals].
+ final String? portalKey;
+
+ /// Optional item ID for portal items.
+ final String? itemId;
+
+ /// Refresh timer interval in seconds (0 = disabled).
+ final int refreshInterval;
+
+ /// Whether popup feature information is enabled.
+ final bool popup;
+
+ /// Optional template string for feature popups.
+ final String? popupTemplate;
+
+ /// Optional list of sublayers if this is a composite layer.
+ final List? sublayers;
+
+ /// Constructs a [LayerEntry] instance.
+ const LayerEntry({
+ required this.label,
+ required this.thumbnailAsset,
+ this.source,
+ this.url,
+ this.portalKey,
+ this.itemId,
+ this.refreshInterval = 0,
+ this.popup = false,
+ this.popupTemplate,
+ this.sublayers,
+ });
+
+ /// Returns true if sublayers list is non-null and not empty.
+ bool get hasSublayers {
+ final hasSub = sublayers != null && sublayers!.isNotEmpty;
+ return hasSub;
+ }
+
+ /// Factory constructor to deserialize [LayerEntry] from a JSON map.
+ factory LayerEntry.fromJson(Map json) {
+ final sublayersJson = json['sublayers'];
+ final hasSublayersJson = sublayersJson != null;
+
+ return LayerEntry(
+ label: json['label'] as String,
+ thumbnailAsset: json['thumbnailAsset'] as String,
+ source: json['source'] as String?,
+ url: json['url'] as String?,
+ portalKey: json['portalKey'] as String?,
+ itemId: json['itemId'] as String?,
+ refreshInterval: (json['refreshInterval'] as num?)?.toInt() ?? 0,
+ popup: json['popup'] as bool? ?? false,
+ popupTemplate: json['popupTemplate'] as String?,
+ sublayers: hasSublayersJson
+ ? (sublayersJson as List).map((e) => SublayerEntry.fromJson(e as Map)).toList()
+ : null,
+ );
+ }
+}
+
+/// Configuration structure for a 3D scene mode.
+class SceneConfig {
+ /// Display label for the scene option.
+ final String label;
+
+ /// Scene view type ('2d' or 'scene').
+ final String type;
+
+ /// Key resolving to a portal URI in [EsriMapConfig.portals].
+ final String? portalKey;
+
+ /// Item ID for the 3D WebScene item in ArcGIS Online / Enterprise.
+ final String? itemId;
+
+ /// Constructs a [SceneConfig] instance.
+ const SceneConfig({required this.label, required this.type, this.portalKey, this.itemId});
+
+ /// Factory constructor to deserialize [SceneConfig] from a JSON map.
+ factory SceneConfig.fromJson(Map json) => SceneConfig(
+ label: json['label'] as String,
+ type: json['type'] as String,
+ portalKey: json['portalKey'] as String?,
+ itemId: json['itemId'] as String?,
+ );
+}
+
+/// Feature flags controlling availability of experimental app capabilities remotely.
+class FeaturesConfig {
+ /// Whether AI natural language search sheet is enabled.
+ final bool aiSearch;
+
+ /// Whether 3D scene modes are enabled.
+ final bool scenes;
+
+ /// Constructs a [FeaturesConfig] instance.
+ const FeaturesConfig({required this.aiSearch, required this.scenes});
+
+ /// Factory constructor to deserialize [FeaturesConfig] from a JSON map.
+ factory FeaturesConfig.fromJson(Map json) =>
+ FeaturesConfig(aiSearch: json['aiSearch'] as bool? ?? false, scenes: json['scenes'] as bool? ?? false);
+}
+
+/// Configuration structure for a search category quick-filter chip.
+class SearchCategoryConfig {
+ /// Display label for the category.
+ final String label;
+
+ /// POI class string used to query backend server.
+ final String poiClass;
+
+ /// Icon name key mapped via [iconDataForName].
+ final String icon;
+
+ /// Hexadecimal color string (e.g. "#F5F0E6").
+ final String? color;
+
+ /// Constructs a [SearchCategoryConfig] instance.
+ const SearchCategoryConfig({required this.label, required this.poiClass, required this.icon, this.color});
+
+ /// Factory constructor to deserialize [SearchCategoryConfig] from a JSON map.
+ factory SearchCategoryConfig.fromJson(Map json) => SearchCategoryConfig(
+ label: json['label'] as String,
+ poiClass: json['poiClass'] as String,
+ icon: json['icon'] as String,
+ color: json['color'] as String?,
+ );
+}
+
+/// Root configuration container object holding all map settings.
+class EsriMapConfig {
+ /// Map of portal keys to portal endpoint URIs.
+ final Map portals;
+
+ /// Map of service keys to ArcGIS REST endpoint URLs.
+ final Map serviceUrls;
+
+ /// Map of basemap keys to basemap configuration objects.
+ final Map basemaps;
+
+ /// Map of layer keys to operational layer entries.
+ final Map layers;
+
+ /// Map of scene keys to 3D scene mode configurations.
+ final Map scenes;
+
+ /// Remote feature flags config.
+ final FeaturesConfig features;
+
+ /// Quick-search category entries.
+ final List searchCategories;
+
+ /// Constructs an [EsriMapConfig] instance.
+ const EsriMapConfig({
+ required this.portals,
+ required this.serviceUrls,
+ required this.basemaps,
+ required this.layers,
+ required this.scenes,
+ required this.features,
+ required this.searchCategories,
+ });
+
+ /// Factory constructor to deserialize root [EsriMapConfig] from a JSON map.
+ factory EsriMapConfig.fromJson(Map json) => EsriMapConfig(
+ portals: (json['portals'] as Map).cast(),
+ serviceUrls: (json['serviceUrls'] as Map).cast(),
+ basemaps: (json['basemaps'] as Map).map(
+ (k, v) => MapEntry(k, BasemapConfig.fromJson(v as Map)),
+ ),
+ layers: (json['layers'] as Map).map(
+ (k, v) => MapEntry(k, LayerEntry.fromJson(v as Map)),
+ ),
+ scenes: (json['scenes'] as Map).map(
+ (k, v) => MapEntry(k, SceneConfig.fromJson(v as Map)),
+ ),
+ features: FeaturesConfig.fromJson(json['features'] as Map),
+ searchCategories: (json['searchCategories'] as List)
+ .map((e) => SearchCategoryConfig.fromJson(e as Map))
+ .toList(),
+ );
+}
diff --git a/lib/core/models/esri_map_models/esrimap_search_category.dart b/lib/core/models/esri_map_models/esrimap_search_category.dart
new file mode 100644
index 0000000000..66773dd103
--- /dev/null
+++ b/lib/core/models/esri_map_models/esrimap_search_category.dart
@@ -0,0 +1,58 @@
+/// ============================================================================
+/// File: esrimap_search_category.dart
+/// Description: Model and utility helpers representing search categories
+/// (e.g., Dining, Parking, Library) shown in suggestions.
+/// ============================================================================
+
+import 'package:flutter/material.dart';
+
+/// Data class representing a quick search category chip shown on the map UI.
+class EsriSearchCategory {
+ /// Display label for the category (e.g. "Dining", "Parking").
+ final String label;
+
+ /// Icon visual representation for the category.
+ final IconData icon;
+
+ /// Underlying POI class string value used for filtering server queries.
+ final String poiClassValue;
+
+ /// Accent or background color associated with the category.
+ final Color color;
+
+ /// Constructs an [EsriSearchCategory] instance.
+ const EsriSearchCategory({
+ required this.label,
+ required this.icon,
+ required this.poiClassValue,
+ this.color = const Color(0xFFF5F0E6),
+ });
+}
+
+/// Utility function mapping string icon names from config to [IconData] constants.
+IconData iconDataForName(String name) {
+ switch (name) {
+ case 'restaurant':
+ return Icons.restaurant;
+ case 'menu_book':
+ return Icons.menu_book;
+ case 'local_parking':
+ return Icons.local_parking;
+ case 'fitness_center':
+ return Icons.fitness_center;
+ case 'directions_bus':
+ return Icons.directions_bus;
+ default:
+ return Icons.place;
+ }
+}
+
+/// Utility function converting hexadecimal color strings (e.g., "#FFCD00") to Flutter [Color] objects.
+Color colorFromHex(String? hex) {
+ final isHexEmpty = hex == null || hex.isEmpty;
+ if (isHexEmpty) return const Color(0xFFF5F0E6);
+ final stripped = hex.replaceFirst('#', '');
+ final value = int.tryParse(stripped, radix: 16);
+ if (value == null) return const Color(0xFFF5F0E6);
+ return Color(0xFF000000 | value);
+}
diff --git a/lib/core/models/esri_map_models/map_search_result.dart b/lib/core/models/esri_map_models/map_search_result.dart
new file mode 100644
index 0000000000..b70f12dd4f
--- /dev/null
+++ b/lib/core/models/esri_map_models/map_search_result.dart
@@ -0,0 +1,96 @@
+/// ============================================================================
+/// File: map_search_result.dart
+/// Description: Represents a unified search result for both campus buildings
+/// and points of interest (POIs) in the Esri Map widget.
+/// ============================================================================
+
+/// Identifies the origin/type of search result.
+enum MapSearchSource {
+ /// Result represents a physical building on campus.
+ building,
+
+ /// Result represents a Point of Interest (POI) such as dining, parking, etc.
+ poi,
+}
+
+/// Unified search result model encapsulating location details, coordinates,
+/// description, and serialization logic for recent search persistence.
+class MapSearchResult {
+ /// Name or title of the building or POI.
+ final String name;
+
+ /// Subtitle or secondary detail string (e.g. building code or category).
+ final String subtitle;
+
+ /// Latitude coordinate of the location.
+ final double latitude;
+
+ /// Longitude coordinate of the location.
+ final double longitude;
+
+ /// Source classification indicating whether this is a building or a POI.
+ final MapSearchSource source;
+
+ /// Physical address string of the location.
+ final String address;
+
+ /// Detailed textual description or additional metadata.
+ final String description;
+
+ /// Optional website URL associated with this location.
+ final String? websiteUrl;
+
+ /// Optional polygon geometry for the building footprint. Not serialized to JSON.
+ final dynamic footprint;
+
+ /// Optional raw geometry dictionary for regenerating the footprint.
+ final Map? rawGeometry;
+
+ /// Optional timestamp (milliseconds since epoch) indicating when this result was fetched.
+ final int? fetchedAt;
+
+ /// Constructs a [MapSearchResult] instance.
+ const MapSearchResult({
+ required this.name,
+ required this.subtitle,
+ required this.latitude,
+ required this.longitude,
+ required this.source,
+ this.address = '',
+ this.description = '',
+ this.websiteUrl,
+ this.footprint,
+ this.rawGeometry,
+ this.fetchedAt,
+ });
+
+ /// Serializes the search result into a JSON-compatible map for storage in SharedPreferences.
+ Map toJson() => {
+ 'name': name,
+ 'subtitle': subtitle,
+ 'latitude': latitude,
+ 'longitude': longitude,
+ 'source': source.index,
+ 'address': address,
+ 'description': description,
+ 'websiteUrl': websiteUrl,
+ if (rawGeometry != null) 'rawGeometry': rawGeometry,
+ if (fetchedAt != null) 'fetchedAt': fetchedAt,
+ };
+
+ /// Factory constructor to deserialize a [MapSearchResult] from a JSON map.
+ factory MapSearchResult.fromJson(Map json) {
+ return MapSearchResult(
+ name: json['name'] as String? ?? '',
+ subtitle: json['subtitle'] as String? ?? '',
+ latitude: (json['latitude'] as num?)?.toDouble() ?? 0.0,
+ longitude: (json['longitude'] as num?)?.toDouble() ?? 0.0,
+ source: MapSearchSource.values[json['source'] as int? ?? 0],
+ address: json['address'] as String? ?? '',
+ description: json['description'] as String? ?? '',
+ websiteUrl: json['websiteUrl'] as String?,
+ rawGeometry: json['rawGeometry'] as Map?,
+ fetchedAt: json['fetchedAt'] as int?,
+ );
+ }
+}
diff --git a/lib/core/models/speed_test.dart b/lib/core/models/speed_test.dart
index dd4f0d2c4d..dd029f8120 100644
--- a/lib/core/models/speed_test.dart
+++ b/lib/core/models/speed_test.dart
@@ -1,5 +1,6 @@
import 'dart:convert';
import 'dart:io';
+
import 'package:wifi_connection/WifiInfo.dart';
class SpeedTestModel {
diff --git a/lib/core/models/user_profile.dart b/lib/core/models/user_profile.dart
index 5ed3f258c4..419bf575e2 100644
--- a/lib/core/models/user_profile.dart
+++ b/lib/core/models/user_profile.dart
@@ -1,4 +1,5 @@
import 'dart:convert';
+
import 'package:hive/hive.dart';
part 'user_profile.g.dart';
diff --git a/lib/core/providers/dining.dart b/lib/core/providers/dining.dart
index 6a91f22dfe..d8fb80faac 100644
--- a/lib/core/providers/dining.dart
+++ b/lib/core/providers/dining.dart
@@ -1,4 +1,5 @@
import 'dart:math';
+
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:campus_mobile_experimental/core/models/dining.dart';
import 'package:campus_mobile_experimental/core/models/location.dart';
diff --git a/lib/core/providers/location.dart b/lib/core/providers/location.dart
index 947f523a53..bb07223196 100644
--- a/lib/core/providers/location.dart
+++ b/lib/core/providers/location.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:campus_mobile_experimental/core/models/location.dart';
import 'package:flutter/cupertino.dart';
diff --git a/lib/core/providers/map.dart b/lib/core/providers/map.dart
index 79bc2d5794..3f1d5b2f5c 100644
--- a/lib/core/providers/map.dart
+++ b/lib/core/providers/map.dart
@@ -1,4 +1,5 @@
import 'dart:math';
+
import 'package:campus_mobile_experimental/core/models/location.dart';
import 'package:campus_mobile_experimental/core/models/map.dart';
import 'package:campus_mobile_experimental/core/services/map.dart';
diff --git a/lib/core/providers/notifications_freefood.dart b/lib/core/providers/notifications_freefood.dart
index fc30b9208d..d7d78862cc 100644
--- a/lib/core/providers/notifications_freefood.dart
+++ b/lib/core/providers/notifications_freefood.dart
@@ -1,4 +1,5 @@
import 'dart:collection';
+
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:campus_mobile_experimental/core/models/notifications.dart';
import 'package:campus_mobile_experimental/core/models/notifications_freefood.dart';
diff --git a/lib/core/providers/shuttle.dart b/lib/core/providers/shuttle.dart
index aae9b53657..adcec697d5 100644
--- a/lib/core/providers/shuttle.dart
+++ b/lib/core/providers/shuttle.dart
@@ -1,4 +1,5 @@
import 'dart:math' as Math;
+
import 'package:campus_mobile_experimental/core/models/location.dart';
import 'package:campus_mobile_experimental/core/models/shuttle_arrival.dart';
import 'package:campus_mobile_experimental/core/models/shuttle_stop.dart';
diff --git a/lib/core/providers/speed_test.dart b/lib/core/providers/speed_test.dart
index cff4116510..a556fc00ad 100644
--- a/lib/core/providers/speed_test.dart
+++ b/lib/core/providers/speed_test.dart
@@ -1,5 +1,6 @@
import 'dart:convert';
import 'dart:io';
+
import 'package:campus_mobile_experimental/app_constants.dart';
import 'package:campus_mobile_experimental/app_networking.dart';
import 'package:campus_mobile_experimental/core/models/location.dart';
diff --git a/lib/core/providers/user.dart b/lib/core/providers/user.dart
index 321cf3c9eb..4ec29adb52 100644
--- a/lib/core/providers/user.dart
+++ b/lib/core/providers/user.dart
@@ -1,5 +1,6 @@
import 'dart:convert';
import 'dart:typed_data';
+
import 'package:campus_mobile_experimental/app_provider.dart';
import 'package:campus_mobile_experimental/core/models/authentication.dart';
import 'package:campus_mobile_experimental/core/models/user_profile.dart';
diff --git a/lib/core/services/availability.dart b/lib/core/services/availability.dart
index e14899b1f4..bac3853886 100644
--- a/lib/core/services/availability.dart
+++ b/lib/core/services/availability.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+
import 'package:campus_mobile_experimental/app_networking.dart';
import 'package:campus_mobile_experimental/core/models/availability.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
diff --git a/lib/core/services/classes.dart b/lib/core/services/classes.dart
index 48be5dad47..859e64c980 100644
--- a/lib/core/services/classes.dart
+++ b/lib/core/services/classes.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+
import 'package:campus_mobile_experimental/app_networking.dart';
import 'package:campus_mobile_experimental/core/models/classes.dart';
import 'package:campus_mobile_experimental/core/models/term.dart';
diff --git a/lib/core/services/dining.dart b/lib/core/services/dining.dart
index 3091732412..370d639753 100644
--- a/lib/core/services/dining.dart
+++ b/lib/core/services/dining.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+
import 'package:campus_mobile_experimental/app_networking.dart';
import 'package:campus_mobile_experimental/core/models/dining.dart';
import 'package:campus_mobile_experimental/core/models/dining_menu.dart';
diff --git a/lib/core/services/employee_id.dart b/lib/core/services/employee_id.dart
index 2132f081d0..602a52e229 100644
--- a/lib/core/services/employee_id.dart
+++ b/lib/core/services/employee_id.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+
import 'package:campus_mobile_experimental/app_networking.dart';
import 'package:campus_mobile_experimental/core/models/employee_id.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
diff --git a/lib/core/services/esri_map_services/esrimap_auth_handler.dart b/lib/core/services/esri_map_services/esrimap_auth_handler.dart
new file mode 100644
index 0000000000..46e39b8c8b
--- /dev/null
+++ b/lib/core/services/esri_map_services/esrimap_auth_handler.dart
@@ -0,0 +1,103 @@
+/// ============================================================================
+/// File: esrimap_auth_handler.dart
+/// Description: Custom ArcGIS Authentication Challenge Handler that fetches and
+/// caches access tokens for secure ArcGIS Online / Enterprise services.
+/// ============================================================================
+
+import 'dart:convert';
+
+import 'package:arcgis_maps/arcgis_maps.dart';
+import 'package:flutter/material.dart';
+import 'package:http/http.dart' as http;
+
+/// Challenge handler implementation for authenticating protected ArcGIS REST services.
+class AgeAuthChallengeHandler implements ArcGISAuthenticationChallengeHandler {
+ /// Endpoint URL used to retrieve authorization tokens.
+ final String tokensUrl;
+
+ /// Cached token for ArcGIS Enterprise server hosts.
+ String? _cachedAgeToken;
+ DateTime? _ageTokenExpiry;
+
+ /// Cached token for ArcGIS Online (arcgis.com) hosts.
+ String? _cachedAgoToken;
+ DateTime? _agoTokenExpiry;
+
+ /// Creates an instance of [AgeAuthChallengeHandler] with the specified [tokensUrl].
+ AgeAuthChallengeHandler(this.tokensUrl);
+
+ /// Internal helper to retrieve an active token for the requested [host], reusing cached tokens if valid.
+ Future<(String?, DateTime?)> _getTokenForHost(String host) async {
+ final isAgo = host.contains('arcgis.com');
+
+ // Return cached token if valid and not expiring within 5 minutes
+ if (isAgo) {
+ final isAgoCachedValid =
+ _cachedAgoToken != null &&
+ _agoTokenExpiry != null &&
+ DateTime.now().isBefore(_agoTokenExpiry!.subtract(const Duration(minutes: 5)));
+ if (isAgoCachedValid) return (_cachedAgoToken, _agoTokenExpiry);
+ } else {
+ final isAgeCachedValid =
+ _cachedAgeToken != null &&
+ _ageTokenExpiry != null &&
+ DateTime.now().isBefore(_ageTokenExpiry!.subtract(const Duration(minutes: 5)));
+ if (isAgeCachedValid) return (_cachedAgeToken, _ageTokenExpiry);
+ }
+
+ // Request fresh authentication tokens from server endpoint
+ final response = await http.get(Uri.parse(tokensUrl));
+ final isTokenFetchNotOk = response.statusCode != 200;
+ if (isTokenFetchNotOk) throw Exception('Token fetch failed: ${response.statusCode}');
+ final data = jsonDecode(response.body) as Map;
+
+ // Cache Enterprise token
+ _cachedAgeToken = data['age']?['token'] as String?;
+ final ageExpiresIn = data['age']?['expires_in'] as int? ?? 7200;
+ _ageTokenExpiry = DateTime.now().add(Duration(seconds: ageExpiresIn));
+
+ // Cache ArcGIS Online token
+ _cachedAgoToken = data['ago']?['token'] as String?;
+ final agoExpiresIn = data['ago']?['expires_in'] as int? ?? 7200;
+ _agoTokenExpiry = DateTime.now().add(Duration(seconds: agoExpiresIn));
+
+ return isAgo ? (_cachedAgoToken, _agoTokenExpiry) : (_cachedAgeToken, _ageTokenExpiry);
+ }
+
+ /// Handles incoming ArcGIS authentication challenges by attaching pregenerated token credentials.
+ @override
+ Future handleArcGISAuthenticationChallenge(ArcGISAuthenticationChallenge challenge) async {
+ final host = challenge.requestUri.host;
+ int maxRetries = 5;
+ int retryDelaySeconds = 2;
+
+ for (int attempt = 1; attempt <= maxRetries; attempt++) {
+ try {
+ final (token, expiry) = await _getTokenForHost(host);
+ if (token == null || expiry == null) {
+ challenge.continueAndFail();
+ return;
+ }
+
+ final tokenInfo = TokenInfo.create(accessToken: token, expirationDate: expiry, isSslRequired: true);
+ if (tokenInfo == null) {
+ challenge.continueAndFail();
+ return;
+ }
+
+ final credential = PregeneratedTokenCredential(uri: challenge.requestUri, tokenInfo: tokenInfo, referer: '');
+ challenge.continueWithCredential(credential);
+ return; // Success, exit the loop
+ } catch (e) {
+ debugPrint('Auth challenge failed on attempt $attempt: $e');
+ if (attempt == maxRetries) {
+ challenge.continueAndFail();
+ return;
+ }
+ // Wait before retrying (exponential backoff)
+ await Future.delayed(Duration(seconds: retryDelaySeconds));
+ retryDelaySeconds *= 2;
+ }
+ }
+ }
+}
diff --git a/lib/core/services/esri_map_services/esrimap_basemap_factory.dart b/lib/core/services/esri_map_services/esrimap_basemap_factory.dart
new file mode 100644
index 0000000000..fdbfb0db49
--- /dev/null
+++ b/lib/core/services/esri_map_services/esrimap_basemap_factory.dart
@@ -0,0 +1,88 @@
+/// ============================================================================
+/// File: esrimap_basemap_factory.dart
+/// Description: Factory service constructing ArcGIS [Basemap] instances from
+/// [EsriMapConfig] layer specifications.
+/// ============================================================================
+
+import 'dart:async';
+
+import 'package:arcgis_maps/arcgis_maps.dart';
+import 'package:campus_mobile_experimental/core/models/esri_map_models/esrimap_basemaps.dart';
+import 'package:campus_mobile_experimental/core/models/esri_map_models/esrimap_config.dart';
+
+void _setupPersistentRetry(Layer layer) {
+ layer.onLoadStatusChanged.listen((status) async {
+ if (status == LoadStatus.failedToLoad) {
+ await Future.delayed(const Duration(seconds: 2));
+ layer.retryLoad();
+ }
+ });
+}
+
+/// Constructs an ArcGIS [Basemap] for the requested [type] using configuration settings in [config].
+///
+/// To provide complete geographical background (coastlines, ocean, islands, regional streets)
+/// without ever displaying "Map data not yet available" raster watermarks or requiring API keys:
+/// 1. Public Esri Living Atlas Vector Tile base layers are used as the foundation (Light Gray / Dark Gray Canvas Base).
+/// Vector tiles scale seamlessly to building/room level (Level 22+) without tile cutoff watermarks.
+/// 2. Custom UC San Diego campus vector tile layers are layered directly on top to display campus-specific facilities.
+Basemap buildBasemap(BasemapType type, EsriMapConfig config) {
+ // 1. Satellite Basemap: Use modern BasemapStyle for optimized CDN routing and faster raster loading.
+ var isSatellite = type == BasemapType.satellite;
+ if (isSatellite) return Basemap.withStyle(BasemapStyle.arcGISImagery);
+
+ final basemap = Basemap();
+
+ // 2. Global Public Vector Tile Base (Coastlines, ocean, off-campus streets, islands)
+ // Living Atlas Item IDs (100% public, keyless vector tile services hosted by Esri):
+ // - Light Gray Canvas Base: 291da5eab3a0412593b66d384379f89f
+ // - Dark Gray Canvas Base: 5e9b3685f4c24d8781073dd928ebda50
+ final globalBaseItemId = switch (type) {
+ BasemapType.dark => '5e9b3685f4c24d8781073dd928ebda50',
+ _ => '291da5eab3a0412593b66d384379f89f',
+ };
+
+ final globalLayer = ArcGISVectorTiledLayer.withItem(
+ PortalItem.withPortalAndItemId(portal: Portal.arcGISOnline(), itemId: globalBaseItemId),
+ );
+ _setupPersistentRetry(globalLayer);
+ basemap.baseLayers.add(globalLayer);
+
+ // 3. Custom UC San Diego Campus Vector Tile Layer (campus buildings, walkways, landscaping)
+ final entry = config.basemaps[basemapKey(type)];
+ final portalUrl = config.portals['age'] ?? 'https://admin-enterprise-gis.ucsd.edu/portal';
+ final vectorLayers = entry?.baseLayers.where((l) => l.type == 'arcgisVectorTiled').toList() ?? [];
+
+ // Filter out any duplicate reference to the global base item ID
+ final campusVectorLayers = vectorLayers.where((l) => l.itemId != globalBaseItemId).toList();
+
+ if (campusVectorLayers.isNotEmpty) {
+ for (final layer in campusVectorLayers) {
+ final pUrl = layer.portalKey != null ? config.portals[layer.portalKey!] : portalUrl;
+ var hasValidUrlAndId = pUrl != null && layer.itemId != null;
+ if (hasValidUrlAndId) {
+ final portal = pUrl.contains('arcgis.com') ? Portal.arcGISOnline() : Portal(Uri.parse(pUrl));
+ final campusLayer = ArcGISVectorTiledLayer.withItem(
+ PortalItem.withPortalAndItemId(portal: portal, itemId: layer.itemId!),
+ );
+ _setupPersistentRetry(campusLayer);
+ basemap.baseLayers.add(campusLayer);
+ }
+ }
+ } else {
+ // Fallback: Append known UCSD campus vector tile layer IDs
+ final fallbackItemId = switch (type) {
+ BasemapType.light => '6643ee62af494f5bafe7dfdb8eb3f857',
+ BasemapType.dark => '09d7b3934b6c4c2cad8380c04e08c1b1',
+ _ => 'e19f33d2c1f44967aef673306c483913',
+ };
+
+ final fallbackLayer = ArcGISVectorTiledLayer.withItem(
+ PortalItem.withPortalAndItemId(portal: Portal(Uri.parse(portalUrl)), itemId: fallbackItemId),
+ );
+ _setupPersistentRetry(fallbackLayer);
+ basemap.baseLayers.add(fallbackLayer);
+ }
+
+ return basemap;
+}
diff --git a/lib/core/services/esri_map_services/esrimap_config_service.dart b/lib/core/services/esri_map_services/esrimap_config_service.dart
new file mode 100644
index 0000000000..735f0a1c96
--- /dev/null
+++ b/lib/core/services/esri_map_services/esrimap_config_service.dart
@@ -0,0 +1,64 @@
+/// ============================================================================
+/// File: esrimap_config_service.dart
+/// Description: Service singleton fetching and caching backend EsriMapConfig
+/// JSON data and authentication token endpoints, with offline
+/// asset bundle fallback logic.
+/// ============================================================================
+
+import 'dart:convert';
+
+import 'package:campus_mobile_experimental/core/models/esri_map_models/esrimap_config.dart';
+import 'package:flutter/foundation.dart';
+import 'package:flutter/services.dart' show rootBundle;
+import 'package:http/http.dart' as http;
+
+/// Service managing remote map configuration loading and token URL lookup.
+class EsriMapConfigService {
+ /// Singleton instance accessor.
+ static final EsriMapConfigService instance = EsriMapConfigService._();
+ EsriMapConfigService._();
+
+ /// Base API endpoint URL.
+ static const String BASE_URL = 'https://appzxi70zi.execute-api.us-west-2.amazonaws.com/test/ArcGIS-Map';
+
+ /// Asset bundle path for offline fallback map configuration JSON.
+ static const String ASSET_FALLBACK_PATH = 'assets/esri_map_assets/mapConfig.json';
+
+ EsriMapConfig? _config;
+ Future? _pending;
+
+ /// Fetches [EsriMapConfig], reusing existing or in-flight Future tasks.
+ Future fetch() {
+ _pending ??= _doFetch();
+ return _pending!;
+ }
+
+ /// Returns cached [EsriMapConfig], or null if not yet loaded.
+ EsriMapConfig? get cached => _config;
+
+ /// Returns backend tokens URL for authentication challenge handlers.
+ String get tokensUrl => '$BASE_URL/tokens';
+
+ /// Fetches map configuration over network, falling back to local asset bundle if offline or failed.
+ Future _doFetch() async {
+ // 1. Instantly load local configuration JSON from app asset bundle so map opens immediately
+ final fallbackJson = await rootBundle.loadString(ASSET_FALLBACK_PATH);
+ _config = EsriMapConfig.fromJson(jsonDecode(fallbackJson) as Map);
+
+ // 2. Fire background network fetch to seamlessly update the cache for later
+ _fetchRemoteAndUpdateCache();
+
+ return _config!;
+ }
+
+ /// Silently fetches configuration over network in the background to update the cache.
+ Future _fetchRemoteAndUpdateCache() async {
+ try {
+ final response = await http.get(Uri.parse('$BASE_URL/config')).timeout(const Duration(seconds: 5));
+ if (response.statusCode == 200)
+ _config = EsriMapConfig.fromJson(jsonDecode(response.body) as Map);
+ } catch (e) {
+ debugPrint('Background remote map config fetch failed: $e');
+ }
+ }
+}
diff --git a/lib/core/services/esri_map_services/esrimap_route_service.dart b/lib/core/services/esri_map_services/esrimap_route_service.dart
new file mode 100644
index 0000000000..9d462d4e8d
--- /dev/null
+++ b/lib/core/services/esri_map_services/esrimap_route_service.dart
@@ -0,0 +1,102 @@
+/// ============================================================================
+/// File: esrimap_route_service.dart
+/// Description: Service handling route calculation via the ArcGIS Campus
+/// Wayfinding Network NAServer.
+/// ============================================================================
+
+import 'package:arcgis_maps/arcgis_maps.dart';
+import 'package:campus_mobile_experimental/core/models/esri_map_models/map_search_result.dart';
+import 'package:flutter/material.dart';
+
+/// Result data structure holding the outcome of a solved route calculation.
+class EsriRouteResult {
+ /// Travel duration in minutes.
+ final double travelTimeMinutes;
+
+ /// List of direction maneuver instructions (turn-by-turn steps).
+ final List directionManeuvers;
+
+ /// Visual geometry polyline representing the calculated route.
+ final Geometry? routeGeometry;
+
+ /// Envelope bounding box centered with padding for map viewpoint framing.
+ final Envelope? paddedExtent;
+
+ /// Constructs an [EsriRouteResult] instance.
+ const EsriRouteResult({
+ required this.travelTimeMinutes,
+ required this.directionManeuvers,
+ this.routeGeometry,
+ this.paddedExtent,
+ });
+}
+
+/// Service class encapsulating ArcGIS Route Task execution.
+class EsriMapRouteService {
+ /// Endpoint URL for the UCSD Campus Wayfinding Network service.
+ static const String ROUTE_SERVICE_URL =
+ 'https://admin-enterprise-gis.ucsd.edu/server/rest/services/'
+ 'Wayfinding/Campus_Wayfinding_Network/NAServer/Route';
+
+ /// Solves a network route between [originLatLng] and [destination] for the given [travelMode].
+ static Future solveRoute({
+ required (double lat, double lng) originLatLng,
+ required MapSearchResult destination,
+ required String travelMode,
+ }) async {
+ try {
+ final routeTask = RouteTask.withUri(Uri.parse(ROUTE_SERVICE_URL));
+ await routeTask.load();
+
+ final params = await routeTask.createDefaultParameters();
+ params.returnDirections = true;
+
+ // Match requested travel mode ('Walking', 'Accessible', etc.)
+ final taskInfo = routeTask.getRouteTaskInfo();
+ final matchingMode = taskInfo.travelModes.where((m) => m.name == travelMode).firstOrNull;
+ if (matchingMode != null) params.travelMode = matchingMode;
+
+ // Configure origin and destination stops
+ final origin = Stop(
+ ArcGISPoint(x: originLatLng.$2, y: originLatLng.$1, spatialReference: SpatialReference.wgs84),
+ );
+ final dest = Stop(
+ ArcGISPoint(x: destination.longitude, y: destination.latitude, spatialReference: SpatialReference.wgs84),
+ );
+ params.setStops([origin, dest]);
+
+ // Solve route
+ final result = await routeTask.solveRoute(params);
+ final isResultEmpty = result.routes.isEmpty;
+ if (isResultEmpty) return null;
+
+ final route = result.routes.first;
+ final routeGeometry = route.routeGeometry;
+ final isGeometryNull = routeGeometry == null;
+ if (isGeometryNull) return null;
+
+ // Compute padded extent so the route line stays visible above bottom sheets
+ final extent = routeGeometry.extent;
+ final dx = extent.width * 0.2;
+ final dyTop = extent.height * 0.5;
+ final dyBottom = extent.height * 0.75;
+ final paddedExtent = Envelope.fromXY(
+ xMin: extent.xMin - dx,
+ yMin: extent.yMin - dyBottom,
+ xMax: extent.xMax + dx,
+ yMax: extent.yMax + dyTop,
+ spatialReference: extent.spatialReference,
+ );
+
+ return EsriRouteResult(
+ travelTimeMinutes: route.totalTime,
+ directionManeuvers: route.directionManeuvers,
+ routeGeometry: routeGeometry,
+ paddedExtent: paddedExtent,
+ );
+ } catch (e) {
+ debugPrint('Route solve error: $e');
+ return null;
+ }
+ }
+}
diff --git a/lib/core/services/esri_map_services/esrimap_search_service.dart b/lib/core/services/esri_map_services/esrimap_search_service.dart
new file mode 100644
index 0000000000..8c9ec9f4b0
--- /dev/null
+++ b/lib/core/services/esri_map_services/esrimap_search_service.dart
@@ -0,0 +1,397 @@
+/// ============================================================================
+/// File: esrimap_search_service.dart
+/// Description: Service handling REST API requests for campus buildings & POIs,
+/// as well as persisting recent search history to SharedPreferences.
+/// ============================================================================
+
+import 'dart:convert';
+import 'dart:math' as math;
+
+import 'package:arcgis_maps/arcgis_maps.dart';
+import 'package:campus_mobile_experimental/core/models/esri_map_models/map_search_result.dart';
+import 'package:flutter/material.dart';
+import 'package:http/http.dart' as http;
+import 'package:shared_preferences/shared_preferences.dart';
+
+/// Service class managing location queries, POI class lookup, and local search history.
+class EsriMapSearchService {
+ /// Base API URL endpoint.
+ static const String BASE_URL = 'https://appzxi70zi.execute-api.us-west-2.amazonaws.com/test/ArcGIS-Map';
+
+ /// SharedPreferences key used to persist recent searches.
+ static const String RECENT_SEARCHES_KEY = 'esri_map_recent_searches';
+
+ /// SharedPreferences key used to persist cached building footprints.
+ static const String _CACHED_BUILDINGS_KEY = 'esrimap_cached_buildings';
+
+ static List _searches = [];
+ static List _cachedBuildings = [];
+
+ /// Maximum number of recent searches retained.
+ static const int MAX_RECENT_SEARCHES = 5;
+
+ // ---------------------------------------------------------------------------
+ // REST API Helpers
+ // ---------------------------------------------------------------------------
+
+ /// Performs an HTTP GET request to the specified [path] with optional query [params].
+ static Future