Platforms and setup
Native platforms: ios, android.
Public actions
Moovit.open
factory Moovit.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 |
Moovit.view
static MoovitViewAction view({ required final Coordinate coordinate, final String partnerId = 'deeplink_x', 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 | — |
partnerId | String | No | 'deeplink_x' |
fallbackToStore | bool | No | false |
Moovit.directionsWithCoords
static MoovitDirectionsWithCoordsAction directionsWithCoords({ required final Coordinate destination, final Coordinate? origin, final String? destinationTitle, final String? originTitle, final String partnerId = 'deeplink_x', 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 | — |
partnerId | String | No | 'deeplink_x' |
fallbackToStore | bool | No | false |
Provider setup and examples
DeeplinkX supports Moovit's moovit URI scheme so Flutter apps can open nearby transit options or launch coordinate-based directions in the native Moovit app on iOS and Android.
References
- Moovit deeplinking documentation: https://moovit.com/developers/deeplinking/
- Moovit App Store listing: https://apps.apple.com/us/app/moovit-bus-transit-tracker/id498477945
Available Actions
Launch Moovit
final deeplinkX = DeeplinkX();
await deeplinkX.launchApp(Moovit.open());
View Map
await deeplinkX.launchAction(
Moovit.view(
coordinate: const Coordinate(latitude: 40.7128, longitude: -74.0060),
partnerId: 'my_flutter_app',
),
);
Directions With Coordinates
await deeplinkX.launchAction(
Moovit.directionsWithCoords(
origin: const Coordinate(latitude: 40.7580, longitude: -73.9855),
originTitle: 'Times Square',
destination: const Coordinate(latitude: 40.7527, longitude: -73.9772),
destinationTitle: 'Grand Central',
),
);
Omit origin to let Moovit start from the user's current location.
Platform Configuration
iOS
Add the Moovit scheme to the LSApplicationQueriesSchemes array in ios/Runner/Info.plist:
<string>moovit</string>
Android
Allow querying the package in android/app/src/main/AndroidManifest.xml:
<queries>
<package android:name="com.tranzmate" />
</queries>
URI Formats
- View map:
moovit://nearby?lat={latitude}&lon={longitude}&partner_id={partnerId} - Directions:
moovit://directions?dest_lat={destinationLatitude}&dest_lon={destinationLongitude}&dest_name={destinationTitle}&orig_lat={originLatitude}&orig_lon={originLongitude}&orig_name={originTitle}&partner_id={partnerId}
partnerId is optional and defaults to deeplink_x. DeeplinkX emits Moovit's
documented partner_id on nearby and directions actions.
Fallback Behavior
- DeeplinkX opens the native app when installed.
- If the app is missing and
fallbackToStoreistrue, we redirect to the appropriate store listing. - Otherwise the action falls back to
https://www.moovit.com/. - Set
disableFallback: truewhen callinglaunchActionto skip both store and web fallbacks.
Fallback Support Matrix
| Action | Store Fallback | Web Fallback |
|---|---|---|
| Open app | Yes | Yes |
| View map | Yes | Yes |
| Directions with coordinates | Yes | Yes |