amap_location_fluttify 0.8.8+b356b08 copy "amap_location_fluttify: ^0.8.8+b356b08" to clipboard
amap_location_fluttify: ^0.8.8+b356b08 copied to clipboard

outdated

An `Amap` Location Component, Powered By `Fluttify` Engine, A Dart Bindings Generator For Native SDK.

Logo

高德 定位组件 #

pub package CI Gitter

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

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

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.

17
likes
0
pub points
84%
popularity

Publisher

verified publisherfluttify.com

An `Amap` Location Component, Powered By `Fluttify` Engine, A Dart Bindings Generator For Native SDK.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

amap_core_fluttify, flutter, foundation_fluttify

More

Packages that depend on amap_location_fluttify