|
|
|
@ -2073,7 +2073,7 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
color: Colors.grey.withOpacity(0.1), |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
), |
|
|
|
child: const Icon(Icons.navigation, color: Colors.grey), |
|
|
|
child: const Icon(Icons.navigation, color: Colors.orange), |
|
|
|
), |
|
|
|
title: const Text('苹果地图'), |
|
|
|
subtitle: const Text('使用苹果地图导航'), |
|
|
|
@ -2082,6 +2082,23 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
openAppleMap(destination, mode); |
|
|
|
}, |
|
|
|
), |
|
|
|
ListTile( |
|
|
|
leading: Container( |
|
|
|
padding: const EdgeInsets.all(8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey.withOpacity(0.1), |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
), |
|
|
|
child: const Icon(Icons.navigation, color: Colors.grey), |
|
|
|
), |
|
|
|
title: const Text('内置导航'), |
|
|
|
subtitle: const Text('使用内置地图导航'), |
|
|
|
onTap: () { |
|
|
|
Get.back(); |
|
|
|
openInternalGaodeMap( |
|
|
|
start, destination, endlatitude, endlongitude, mode); |
|
|
|
}, |
|
|
|
), |
|
|
|
// 底部安全区域 |
|
|
|
SizedBox(height: MediaQuery.of(Get.context!).padding.bottom + 20), |
|
|
|
], |
|
|
|
@ -2503,6 +2520,24 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// 打开内置高德地图进行导航 |
|
|
|
Future<bool> openInternalGaodeMap( |
|
|
|
String start, |
|
|
|
String destination, |
|
|
|
String endlatitude, |
|
|
|
String endlongitude, |
|
|
|
String mode // 'driving', 'transit', 'walking', 'cycling' |
|
|
|
) async { |
|
|
|
try { |
|
|
|
_navigationManager.open(start, "$endlongitude,$endlatitude", mode); |
|
|
|
return true; |
|
|
|
} catch (e) { |
|
|
|
print('打开内置高德地图失败: $e'); |
|
|
|
Get.snackbar('错误', '打开地图时发生错误'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// 打开Google地图进行导航 |
|
|
|
Future<bool> openGoogleMap(String daddr, String mode) async { |
|
|
|
try { |
|
|
|
|