FlAMapLocation class
Constructors
- FlAMapLocation()
-
factory
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
-
addListener(
{FlAMapLocationChanged? onLocationChanged, FlAMapLocationFailed? onLocationFailed, FlAMapLocationHeadingChanged? onHeadingChanged, FlAMapLocationAuthorizationChanged? onAuthorizationChanged}) → void - 添加回调监听
-
disableBackgroundLocation(
{bool removeNotification = true}) → Future< bool> -
仅支持android
关闭后台定位功能,关闭后台定位功能只是代表不再提供后台定位的能力,并不是停止定位,停止定位请调用
removeNotification
- 是否移除通知栏, true:移除通知栏,false:不移除通知栏,可以手动移除 -
dismissHeadingCalibrationDisplay(
) → Future< bool> - 仅支持ios 停止设备朝向校准显示
-
dispose(
) → Future< bool> - dispose
-
enableBackgroundLocation(
AMapNotificationForAndroid notification) → Future< bool> -
仅支持android
开启后台定位功能 注意: 如果您设置了target>=28,需要增加
android.permission.FOREGROUND_SERVICE
权限, 如果您的app需要运行在Android Q版本的手机上,需要为ApsService增加android:foregroundServiceType="location"属性, 例: -
getLocation(
{AMapLocationOptionForIOS? optionForIOS, AMapLocationOptionForAndroid? optionForAndroid}) → Future< AMapLocation?> - 直接获取定位
-
headingAvailable(
) → Future< bool> - 仅支持ios 设备是否支持方向识别 ture:设备支持方向识别 ; false:设备不支持支持方向识别
-
initialize(
{AMapLocationOptionForIOS? optionForIOS, AMapLocationOptionForAndroid? optionForAndroid}) → Future< bool> - 初始化定位
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startLocation(
{AMapLocationOptionForIOS? optionForIOS, AMapLocationOptionForAndroid? optionForAndroid}) → Future< bool> - 启动监听位置改变
-
startUpdatingHeading(
) → Future< bool> - 仅支持ios 开始获取设备朝向,如果设备支持方向识别,则会通过代理回调方法
-
stopLocation(
) → Future< bool> - 停止监听位置改变
-
stopUpdatingHeading(
) → Future< bool> - 仅支持ios 停止获取设备朝向
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited