Platforms and setup
Native platforms: ios, android.
- Action fallbacks use Amap website rather than preserving the native action payload.
Public actions
Amap.open
factory Amap.open({final bool fallbackToStore = false})
Launch with DeeplinkX.launchApp. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
fallbackToStore | bool | No | false |
Amap.myLocation
static AmapMyLocationAction myLocation({ final String sourceApplication = _defaultSourceApplication, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
sourceApplication | String | No | _defaultSourceApplication |
fallbackToStore | bool | No | false |
Amap.view
static AmapViewAction view({ required final Coordinate coordinate, final String? title, final String sourceApplication = _defaultSourceApplication, final bool convertFromWgs84 = false, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
coordinate | Coordinate | Yes | — |
title | String? | No | — |
sourceApplication | String | No | _defaultSourceApplication |
convertFromWgs84 | bool | No | false |
fallbackToStore | bool | No | false |
Amap.search
static AmapSearchAction search({ required final String query, final AmapBounds? bounds, final String sourceApplication = _defaultSourceApplication, final bool convertFromWgs84 = false, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
query | String | Yes | — |
bounds | AmapBounds? | No | — |
sourceApplication | String | No | _defaultSourceApplication |
convertFromWgs84 | bool | No | false |
fallbackToStore | bool | No | false |
Amap.directions
static AmapDirectionsAction directions({ required final String destination, final String sourceApplication = _defaultSourceApplication, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
destination | String | Yes | — |
sourceApplication | String | No | _defaultSourceApplication |
fallbackToStore | bool | No | false |
Amap.directionsWithCoords
static AmapDirectionsWithCoordsAction directionsWithCoords({ required final Coordinate destination, final Coordinate? origin, final String? destinationTitle, final String? originTitle, final List<AmapWaypoint> waypoints = const [], final AmapTravelMode mode = AmapTravelMode.driving, final String sourceApplication = _defaultSourceApplication, final bool convertFromWgs84 = false, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
destination | Coordinate | Yes | — |
origin | Coordinate? | No | — |
destinationTitle | String? | No | — |
originTitle | String? | No | — |
waypoints | List<AmapWaypoint> | No | const [] |
mode | AmapTravelMode | No | AmapTravelMode.driving |
sourceApplication | String | No | _defaultSourceApplication |
convertFromWgs84 | bool | No | false |
fallbackToStore | bool | No | false |
Provider setup and examples
DeeplinkX supports Amap (Gaode Maps) deep links on Android and iOS for opening the app, viewing locations, searching places, and planning routes.
References
- Amap Android URI docs: https://lbs.amap.com/api/amap-mobile/guide/android/marker
- Amap iOS URI docs: https://lbs.amap.com/api/amap-mobile/guide/ios/ios-uri-information
- Amap Android route docs: https://lbs.amap.com/api/amap-mobile/guide/android/route
- Amap iOS route docs: https://lbs.amap.com/api/amap-mobile/guide/ios/route
- Amap Android search docs: https://lbs.amap.com/api/amap-mobile/guide/android/search
- Amap iOS search docs: https://lbs.amap.com/api/amap-mobile/guide/ios/search
Available Actions
Launch Amap
final deeplinkX = DeeplinkX();
await deeplinkX.launchApp(Amap.open());
My Location
await deeplinkX.launchAction(Amap.myLocation());
View Map
await deeplinkX.launchAction(
Amap.view(
coordinate: const Coordinate(latitude: 39.98848272, longitude: 116.47560823),
title: 'Amap HQ',
sourceApplication: 'my_flutter_app',
convertFromWgs84: true,
),
);
Search
await deeplinkX.launchAction(
Amap.search(
query: 'bank|fuel',
bounds: const AmapBounds(
topLeft: Coordinate(latitude: 36.1, longitude: 116.1),
bottomRight: Coordinate(latitude: 36.2, longitude: 116.2),
),
),
);
Directions
await deeplinkX.launchAction(
Amap.directions(destination: 'Amap HQ'),
);
Directions With Coordinates
await deeplinkX.launchAction(
Amap.directionsWithCoords(
origin: const Coordinate(latitude: 39.92848272, longitude: 116.39560823),
originTitle: 'Start',
destination: const Coordinate(latitude: 39.98848272, longitude: 116.47560823),
destinationTitle: 'Amap HQ',
waypoints: const [
AmapWaypoint(
coordinate: Coordinate(latitude: 39.5, longitude: 116.8),
title: 'Waypoint',
),
],
mode: AmapTravelMode.driving,
convertFromWgs84: true,
),
);
Platform Configuration
iOS
Add the Amap scheme to the LSApplicationQueriesSchemes array in ios/Runner/Info.plist:
<string>iosamap</string>
Android
Allow querying the Amap package in android/app/src/main/AndroidManifest.xml:
<queries>
<package android:name="com.autonavi.minimap" />
</queries>
URI Formats
iOS
- My location:
iosamap://mylocation?sourceApplication=deeplink_x - View map:
iosamap://viewmap?sourceApplication=deeplink_x&poiname={title}&lat={lat}&lon={lon}&dev={0|1} - Search:
iosamap://poi?sourceApplication=deeplink_x&name={query}&lat1={lat1}&lon1={lon1}&lat2={lat2}&lon2={lon2}&dev={0|1} - Directions:
iosamap://path?sourceApplication=deeplink_x&dname={destination}&dev=0&t=0 - Directions with coordinates:
iosamap://path?sourceApplication=deeplink_x&slat={origin_lat}&slon={origin_lng}&sname={origin}&dlat={dest_lat}&dlon={dest_lng}&dname={destination}&dev={0|1}&t={mode}
Android
- My location:
androidamap://mylocation?sourceApplication=deeplink_x - View map:
androidamap://viewmap?sourceApplication=deeplink_x&poiname={title}&lat={lat}&lon={lon}&dev={0|1} - Search:
androidamap://poi?sourceApplication=deeplink_x&keywords={query}&lat1={lat1}&lon1={lon1}&lat2={lat2}&lon2={lon2}&dev={0|1} - Directions:
androidamap://keywordNavi?sourceApplication=deeplink_x&keyword={destination}&style=2 - Directions with coordinates:
amapuri://route/plan/?sourceApplication=deeplink_x&slat={origin_lat}&slon={origin_lng}&sname={origin}&dlat={dest_lat}&dlon={dest_lng}&dname={destination}&dev={0|1}&t={mode}
sourceApplication is optional on every action and defaults to deeplink_x.
Marker titles default to Pin when omitted. Text-only Android destinations use
Amap's documented keywordNavi entry point.
Fallback Behavior
- DeeplinkX opens Amap when installed.
- If the app is missing and
fallbackToStoreistrue, DeeplinkX redirects to the platform store listing. - Otherwise actions fall back to
https://www.amap.com. - Set
disableFallback: truewhen callinglaunchActionto skip both store and web fallbacks.
Fallback Support Matrix
| Action | Store Fallback | Web Fallback |
|---|---|---|
| Open app | ✔️ | ✔️ |
| My location | ✔️ | ✔️ |
| View map | ✔️ | ✔️ |
| Search | ✔️ | ✔️ |
| Directions | ✔️ | ✔️ |
| Directions with coordinates | ✔️ | ✔️ |