gotoBaiduMap static method

Future<bool> gotoBaiduMap(
  1. dynamic longitude,
  2. dynamic latitude
)

Baidu Map / 百度地图

Implementation

static Future<bool> gotoBaiduMap(longitude, latitude) async {
  var url = 'baidumap://map/direction?destination=$latitude,$longitude&coord_type=bd09ll&mode=driving';

  bool canLaunchMap = await canLaunchUrl(Uri.parse(url));

  if (!canLaunchMap) {
    Utils.toast(('未检测到百度地图')); // "Not detect Baidu Map"
    return false;
  }

  await launchUrl(
    Uri.parse(url),
    mode: LaunchMode.externalApplication,
  );

  return canLaunchMap;
}