amap_location_fluttify 0.2.7+10e2842

  • Readme
  • Changelog
  • Example
  • Installing
  • new75

Logo

高德 定位组件

pub package

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

安装:

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()) {
  await AmapLocation.startLocation(
    once: true,
    locationChanged: (location) {
      _location = location;
      setState(() {});
    },
  );
}

FAQ #

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

请作者喝杯奶茶 #

qq群 #

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.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.2.7+10e2842

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]
51
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
97
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Nov 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/dart/amap_location.dart. (-0.50 points)

Analysis of lib/src/dart/amap_location.dart reported 1 hint:

line 45 col 17: 'PlatformFactory_Android' is deprecated and shouldn't be used.

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.

Fix additional 51 files with analysis or formatting issues.

Additional issues in the following files:

  • 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.)
  • 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/object_factory.g.dart (Run flutter format to format lib/src/android/object_factory.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/object_factory.g.dart (Run flutter format to format lib/src/ios/object_factory.g.dart.)
  • lib/src/ios/type_op.g.dart (Run flutter format to format lib/src/ios/type_op.g.dart.)

Maintenance suggestions

The package description is too short. (-3 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
amap_core_fluttify ^0.0.11+a9797a4 0.0.11+a9797a4
flutter 0.0.0
foundation_fluttify ^0.0.9 0.0.9
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test