in my flutter code, I am launching Google Maps app with a predefined location, on a button click. Below is the code
_launchMaps(double lat, double lon) async {
String googleUrl =
'comgooglemaps://?center=${lat},${lon}';
String appleUrl =
'https://www.google.com/maps/search/?api=1&query=$lat,$lon';
if (await canLaunch("comgooglemaps://")) {
print('launching com googleUrl');
await launch(googleUrl);
} else if (await canLaunch(appleUrl)) {
print('launching apple url');
await launch(appleUrl);
} else {
throw 'Could not launch url';
}
}
In iOS, I did add the following lines to the info.plist file
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlechromes</string>
<string>comgooglemaps</string>
</array>
In Android, when I click on the button I get the google maps opened, and I can clearly see the "Directions" button where I can click and start navigating. example below
In iOS I get the Google Map opened, the location is pointed in marker, but I don't get the "Directions" button or anything like that so I can start navigating. how can I fix this?
