Я пытаюсь определить, установлено ли приложение Google Maps на iOS, и если да, запустите его, если нет, запустите Apple Maps. Вот что я до сих пор, но на моем телефоне с Google Maps установлен, он не обнаруживает его и не запускает надлежащим образом.
Есть идеи?
import 'package:url_launcher/url_launcher.dart';
_launchMaps() async {
  String googleUrl =
    'comgooglemaps://?center=${trip.origLocationObj.lat},${trip.origLocationObj.lon}';
  String appleUrl =
    'https://maps.apple.com/?sll=${trip.origLocationObj.lat},${trip.origLocationObj.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';
  }
}
 Я вытащил схему url отсюда: как я смогу открыть карты Google, когда я нажму кнопку в своем приложении?