Hello everybody
I just want to display in Google my origin coordinates and my destination coordinates in my application
this my class where , i implementing my method
class MapUtils {
MapUtils._();
static void lauchMapFromSourceToDestination(
sourceLat, sourceLng, destinationLat, destinationLng) async {
String mapOptions = [
'saddr=$sourceLat,$sourceLng',
'daddr=$destinationLat,$destinationLng',
'dir_action=navigate'
].join('&');
final mapUrl = 'https://www.google.com/maps?$mapOptions';
if (await canLaunch(mapUrl)) {
await launch(mapUrl);
} else {
throw "Could not launch $mapUrl";
}
}}
when i call it
onTap: () {
MapUtils.lauchMapFromSourceToDestination(
position!.latitude, position!.longitude, ifoodLat, ifoodLng);
},
this is an expetion
Could not launch https://www.google.com/maps?saddr=-11.5926663,27.5143076&daddr=-11.6161328,27.4741627&dir_action=navigate
However, this same link functions with Google, when I launch it in the browser without going through the application
Please can you help me
3