amap_location_fluttify 0.8.6+356f11c

  • Readme
  • Changelog
  • Example
  • Installing
  • 94

Logo

高德 定位组件

pub package CI Gitter

Dart接口基于fluttify引擎生成. dartdoc接口文档.

Demo微信赞助支付宝赞助QQ群
扫描二维码
或者
点击下载
Example
如果项目帮到了你
不妨请作者喝杯奶茶 :)
微信
开源不易
你的star是我最大的动力
支付宝
加入QQ群讨论 <br/><br/> QQ群

安装:

dependencies:
  flutter:
    sdk: flutter
  amap_location_fluttify: ^x.x.x

导入:

import 'package:amap_location_fluttify/amap_location_fluttify.dart';

使用:

/// !注意: 只要是返回Future的方法, 一律使用`await`修饰, 确保当前方法执行完成后再执行下一行, 在不能使用`await`修饰的环境下, 在`then`方法中执行下一步.
/// 初始化 iOS在init方法中设置, android需要去AndroidManifest.xml里去设置, 详见 https://lbs.amap.com/api/android-sdk/gettingstarted
await AmapCore.init('ios key');

// 单次定位
if (await requestPermission()) {
  final location = await AmapLocation.fetchLocation();
  setState(() => _location = location);
}

// 连续定位
if (await requestPermission()) {
  await for (final location in AmapLocation.listenLocation()) {
    setState(() => _location = location);
  }
}

FAQ #

  • 这个项目跟amap_base有什么联系和区别?
    • 联系: 除了是同一个作者开发的之外没有联系;
    • 区别: amap_base使用的是常规的开发方式, 还是以MethodChannel为中心在dart和原生以及各个原生平台之间斡旋. 而fluttify系列插件是在fluttify引擎生成的dart接口之上去开发插件, 屏蔽了原生代码, 开发插件时不再需要在不同的原生代码之间斡旋, 只需要专注于整合不同平台的api即可.

LICENSE #

Copyright 2019 yohom

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

0.8.6 #

  • 提升依赖

0.8.5 #

  • docs: apk下载链接修正
  • docs: 去重重复的信息

0.8.4 #

  • enhance: 加入打包的key
  • docs: README加入apk下载二维码
  • roll engine #107df19

0.8.3 #

  • roll engine #4d92ce0. 主要解决type_op冲突的问题.

0.8.2 #

  • roll engine #5c1b957

0.8.1 #

  • feat: Location增加accuracy字段 (#38)

0.8.0 #

  • enhance: 提升依赖
  • roll engine #ea37ae9

0.7.0 #

  • 提升依赖

0.6.0 #

  • 提升依赖

0.5.1 #

  • enhance: 增加bearing(设备移动方向属性), 此属性需要较长时间时间才能获取到数据, 建议在连续定位中使用.
  • enhance: 提供仅在android端有效的DeviceSensor枚举

0.5.0 #

  • enhance: 导出amap_core_fluttify
  • roll engine #a918944
  • 适配flutter 1.12.13

0.4.2 #

  • fix: 连续定位空指针异常

0.4.1 #

  • fix: 单次定位防止重复订阅

0.4.0 #

  • enhance: [breaking change] 单次和连续定位单独实现,并返回Future和Stream

0.3.2 #

  • 解决依赖冲突

0.3.1 #

  • 更新依赖

0.3.0 #

  • 更新底层

0.2.7 #

  • doc: 增加await的说明
  • feat: 增加ios端requireAlwaysAuth的处理

0.2.6 #

  • fix: dispose时,置空_androidClient和_iosClient,防止在页面级别的State中释放了client之后,重新定位时,client不为空而没有去重新创建原生client导致的原生client为空。

0.2.5 #

  • enhancement: 经纬度统一使用LatLng
  • enhancement: 调整设置回调的位置

0.2.4 #

  • fix: 导出enums.dart; 删除utils.g.dart

0.2.3 #

  • fix: 高德的key不应该放在library模块里

0.2.2 #

  • fix: 释放原生对象时, 只释放当前插件创建的对象

0.2.1 #

  • 更新README
  • 更新引擎版本 38df15a

0.2.0 #

  • setLocationListener -> startLocation

0.1.0 #

  • 单次定位; 连续定位

example/README.md

amap_location_fluttify_example #

Demonstrates how to use the amap_location_fluttify plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  amap_location_fluttify: ^0.8.6+356f11c

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:amap_location_fluttify/amap_location_fluttify.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
89
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
94
Learn more about scoring.

We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/src/android/com/amap/api/fence/DistrictItem.g.dart.

Run flutter format to format lib/src/android/com/amap/api/fence/DistrictItem.g.dart.

Format lib/src/android/com/amap/api/fence/GeoFence.g.dart.

Run flutter format to format lib/src/android/com/amap/api/fence/GeoFence.g.dart.

Format lib/src/android/com/amap/api/fence/GeoFenceClient.g.dart.

Run flutter format to format lib/src/android/com/amap/api/fence/GeoFenceClient.g.dart.

Fix additional 48 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/android/com/amap/api/fence/GeoFenceListener.g.dart (Run flutter format to format lib/src/android/com/amap/api/fence/GeoFenceListener.g.dart.)
  • lib/src/android/com/amap/api/fence/GeoFenceManagerBase.g.dart (Run flutter format to format lib/src/android/com/amap/api/fence/GeoFenceManagerBase.g.dart.)
  • lib/src/android/com/amap/api/fence/PoiItem.g.dart (Run flutter format to format lib/src/android/com/amap/api/fence/PoiItem.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocation.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocation.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationClient.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationClient.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationClientOption.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationClientOption.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationMode.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationMode.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationProtocol.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationProtocol.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationPurpose.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationPurpose.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationClientOption/GeoLanguage.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationClientOption/GeoLanguage.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationListener.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationListener.g.dart.)
  • lib/src/android/com/amap/api/location/AMapLocationQualityReport.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/AMapLocationQualityReport.g.dart.)
  • lib/src/android/com/amap/api/location/APSServiceBase.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/APSServiceBase.g.dart.)
  • lib/src/android/com/amap/api/location/CoordUtil.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/CoordUtil.g.dart.)
  • lib/src/android/com/amap/api/location/CoordinateConverter.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/CoordinateConverter.g.dart.)
  • lib/src/android/com/amap/api/location/CoordinateConverter/CoordType.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/CoordinateConverter/CoordType.g.dart.)
  • lib/src/android/com/amap/api/location/DPoint.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/DPoint.g.dart.)
  • lib/src/android/com/amap/api/location/LocationManagerBase.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/LocationManagerBase.g.dart.)
  • lib/src/android/com/amap/api/location/UmidtokenInfo.g.dart (Run flutter format to format lib/src/android/com/amap/api/location/UmidtokenInfo.g.dart.)
  • lib/src/android/com/autonavi/aps/amapapi/model/AMapLocationServer.g.dart (Run flutter format to format lib/src/android/com/autonavi/aps/amapapi/model/AMapLocationServer.g.dart.)
  • lib/src/android/type_op.g.dart (Run flutter format to format lib/src/android/type_op.g.dart.)
  • lib/src/ios/AMapGeoFenceActiveAction.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceActiveAction.g.dart.)
  • lib/src/ios/AMapGeoFenceCircleRegion.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceCircleRegion.g.dart.)
  • lib/src/ios/AMapGeoFenceDistrictRegion.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceDistrictRegion.g.dart.)
  • lib/src/ios/AMapGeoFenceErrorCode.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceErrorCode.g.dart.)
  • lib/src/ios/AMapGeoFenceManager.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceManager.g.dart.)
  • lib/src/ios/AMapGeoFenceManagerDelegate.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceManagerDelegate.g.dart.)
  • lib/src/ios/AMapGeoFencePOIRegion.g.dart (Run flutter format to format lib/src/ios/AMapGeoFencePOIRegion.g.dart.)
  • lib/src/ios/AMapGeoFencePolygonRegion.g.dart (Run flutter format to format lib/src/ios/AMapGeoFencePolygonRegion.g.dart.)
  • lib/src/ios/AMapGeoFenceRegion.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceRegion.g.dart.)
  • lib/src/ios/AMapGeoFenceRegionActiveStatus.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceRegionActiveStatus.g.dart.)
  • lib/src/ios/AMapGeoFenceRegionStatus.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceRegionStatus.g.dart.)
  • lib/src/ios/AMapGeoFenceRegionType.g.dart (Run flutter format to format lib/src/ios/AMapGeoFenceRegionType.g.dart.)
  • lib/src/ios/AMapLocationCircleRegion.g.dart (Run flutter format to format lib/src/ios/AMapLocationCircleRegion.g.dart.)
  • lib/src/ios/AMapLocationCoordinateType.g.dart (Run flutter format to format lib/src/ios/AMapLocationCoordinateType.g.dart.)
  • lib/src/ios/AMapLocationDistrictItem.g.dart (Run flutter format to format lib/src/ios/AMapLocationDistrictItem.g.dart.)
  • lib/src/ios/AMapLocationErrorCode.g.dart (Run flutter format to format lib/src/ios/AMapLocationErrorCode.g.dart.)
  • lib/src/ios/AMapLocationManager.g.dart (Run flutter format to format lib/src/ios/AMapLocationManager.g.dart.)
  • lib/src/ios/AMapLocationManagerDelegate.g.dart (Run flutter format to format lib/src/ios/AMapLocationManagerDelegate.g.dart.)
  • lib/src/ios/AMapLocationPOIItem.g.dart (Run flutter format to format lib/src/ios/AMapLocationPOIItem.g.dart.)
  • lib/src/ios/AMapLocationPoint.g.dart (Run flutter format to format lib/src/ios/AMapLocationPoint.g.dart.)
  • lib/src/ios/AMapLocationPolygonRegion.g.dart (Run flutter format to format lib/src/ios/AMapLocationPolygonRegion.g.dart.)
  • lib/src/ios/AMapLocationReGeocode.g.dart (Run flutter format to format lib/src/ios/AMapLocationReGeocode.g.dart.)
  • lib/src/ios/AMapLocationReGeocodeLanguage.g.dart (Run flutter format to format lib/src/ios/AMapLocationReGeocodeLanguage.g.dart.)
  • lib/src/ios/AMapLocationRegion.g.dart (Run flutter format to format lib/src/ios/AMapLocationRegion.g.dart.)
  • lib/src/ios/AMapLocationRegionState.g.dart (Run flutter format to format lib/src/ios/AMapLocationRegionState.g.dart.)
  • lib/src/ios/functions.g.dart (Run flutter format to format lib/src/ios/functions.g.dart.)
  • lib/src/ios/type_op.g.dart (Run flutter format to format lib/src/ios/type_op.g.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
amap_core_fluttify ^0.5.3+356f11c 0.5.3+356f11c
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
foundation_fluttify 0.4.6
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test