openMap static method

Future openMap({
  1. required String mapUrl,
  2. LaunchMode launchMode = LaunchMode.externalApplication,
})

Opens up google map with the given mapUrl in the given launchMode.

Implementation

static Future openMap({
  required String mapUrl,
  LaunchMode launchMode = LaunchMode.externalApplication,
}) async {
  try {
    final uri = Uri.parse(mapUrl);
    await launchUrl(uri, mode: launchMode);
  } catch (error, stackTrace) {
    ErrorLogger.instance.logError(
      error: error,
      stackTrace: stackTrace,
      file: "url_launcher_helper",
      event: "openMap",
    );
    return Future.error(error);
  }
}