Prefer native map candidates before fallback
const destination = Coordinate(latitude: 37.5665, longitude: 126.9780);
Future<bool> openDirections() =>
deeplinkX.launchMapDirectionsWithCoordsAction(
actions: [
GoogleMaps.directionsWithCoords(destination: destination),
Waze.directionsWithCoords(destination: destination),
AppleMaps.directionsWithCoords(destination: destination),
],
);
The order is an application preference. The helper first tries every native candidate in the supplied order with fallbacks disabled. If none succeeds and fallback is allowed, it makes another pass with normal action fallback behavior. A first candidate's web link therefore does not preempt a later candidate's successful native path. If all attempts fail, the result is false. Supply disableFallback: true to the map helper to stop after the native pass.
Other map helpers are launchMapViewAction, launchMapSearchAction, and launchMapDirectionsAction. Only include constructors implementing the corresponding shared abstraction. Each provider supports its own subset and parameter constraints; an action with the same broad label can have different provider behavior.
The example selector offers 25 options at its default Seoul coordinate, including experimental TomTom GO Expert. NAVER is omitted outside its supported coordinate bounds.
Choose a platform-matched store
Future<bool> openMyAppListing() => deeplinkX.redirectToStore(
storeActions: [
PlayStore.openAppPage(packageName: 'com.example.app'),
IOSAppStore.openAppPage(appId: 'YOUR_APP_ID', appName: 'your-app'),
MicrosoftStore.openAppPage(productId: 'YOUR_PRODUCT_ID'),
],
);
Replace the illustrative identifiers before use. redirectToStore filters actions to the current platform, then attempts matching native store actions in order with fallback disabled. It returns false when none matches or launches. This helper is not a general browser-listing fallback for unmatched platforms. Calling an individual listing with launchAction can permit that action's browser fallback; make that separate policy explicit when your application needs it.
For real UI composition, see Update App, Map Selector, Rate & Review, and Promoted App CTA.