AMapFlutterLocation class

高德定位Flutter插件入口类 提供定位功能的主要接口,包括开始定位、停止定位、设置参数等功能

Constructors

AMapFlutterLocation.new()
初始化定位插件 创建唯一的插件标识符

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → void
销毁定位 释放定位资源,取消流订阅
getSystemAccuracyAuthorization() Future<AMapAccuracyAuthorization>
适配iOS 14定位新特性,获取系统定位精度授权状态 只在iOS平台有效 返回:定位精度授权状态枚举值
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onLocationChanged() Stream<Map<String, Object>>
定位结果回调
setLocationOption(AMapLocationOption locationOption) → void
设置定位参数 @param locationOption 定位参数对象
startLocation() → void
开始定位 调用原生端开始定位的方法
stopLocation() → void
停止定位 调用原生端停止定位的方法
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

setApiKey(String androidKey, String iosKey, {String? ohosKey}) → void
设置Android和iOS的apikey 建议在widget初始化时设置 apiKey的申请请参考高德开放平台官网 @param androidKey Android平台的key @param iosKey iOS平台的key @param ohosKey 鸿蒙平台的key(可选)
updatePrivacyAgree(bool hasAgree) → void
设置是否已经取得用户同意 如果未取得用户同意,高德定位SDK将不会工作 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy 必须保证在调用定位功能之前调用,建议首次启动App时弹出《隐私政策》并取得用户同意 @param hasAgree 隐私权政策是否已经取得用户同意
updatePrivacyShow(bool hasContains, bool hasShow) → void
设置是否已经包含高德隐私政策并弹窗展示显示用户查看 如果未包含或者没有弹窗展示,高德定位SDK将不会工作 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy 必须保证在调用定位功能之前调用,建议首次启动App时弹出《隐私政策》并取得用户同意 @param hasContains 隐私声明中是否包含高德隐私政策说明 @param hasShow 隐私权政策是否弹窗展示告知用户