I want to redirect to device default google map app. So i am calling bellow url using some parameters but optimization parameter not working. So, any one have idea how apply optimization true or false while launch google map url.
This is Output Url.
String mapOptions = [
'origin=${widget.currentLocation.latitude.toString()}%2C${widget.currentLocation.longitude.toString()}',
'destination=${(destinationAddress.replaceAll(',', '%2C')).replaceAll(' ', '%20')}',
'destination_place_id=${widget.routeDeliveryDetail.deliveryList[widget.routeDeliveryDetail.deliveryList.length - 1].placeId}',
'waypoints=$wayPoint',
'waypoint_place_ids=$wayPointPLaceId',
'optimization=true',
'travelmode=driving'
].join('&');
String googleUrl = 'https://www.google.com/maps/dir/?api=1&$mapOptions';
print(googleUrl);
try {
if (await canLaunch(googleUrl)) {
await launch(googleUrl);
} else {
throw 'Could not open the map.';
}
} catch (e) {
print(e);
}