openMap function

Future openMap(
  1. BuildContext context,
  2. PlaceDetails placeDetails
)

Implementation

Future openMap(BuildContext context, gmaps.PlaceDetails placeDetails) async {
  final geo = placeDetails.geometry!.location;

  if (infoX.isIOS) {
    final url = "https://maps.apple.com/?q=${geo.lat},${geo.lng}";
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      SunnyHud.error(context, "Unable to show a map at this time");
    }
  } else {
    SunnyHud.info(context, "Coming soon");
  }
}