launchMapsDirections static method
void
launchMapsDirections({})
Implementation
static void launchMapsDirections({
String? destinationTitle,
String? originTitle,
List<Coords>? waypoints,
DirectionsMode directionsMode = DirectionsMode.driving,
Map<String, String>? extraParams,
required double latitude,
required double longitude,
double? latitudeOrigin,
double? longitudeOrigin,
}) async {
try {
final availableMaps = await MapLauncher.installedMaps;
await availableMaps.first.showDirections(
destinationTitle: destinationTitle,
origin: longitudeOrigin != null && latitudeOrigin != null
? Coords(
latitudeOrigin,
longitudeOrigin,
)
: null,
originTitle: originTitle,
destination: Coords(
latitude,
longitude,
),
);
} catch (e) {
LoggerService.logInfo('Utils launchMapsDirections: could not launch string: $destinationTitle');
}
}