init method
初始化
Implementation
Future<void> init({required String iosKey}) {
return platform(
android: (pool) async {
// 获取上下文, 这里获取的是Application
final context = await android_app_Application.get();
// 创建定位客户端
_androidClient ??= await com_amap_api_location_AMapLocationClient
.create__android_content_Context(context);
},
ios: (pool) async {
await AmapCore.init(iosKey);
_iosClient ??= await AMapLocationManager.create__();
},
);
}