├── .github ├── ISSUE_TEMPLATE │ ├── ---.md │ ├── bug-report.md │ └── bug.md ├── stale.yml └── workflows │ └── CI.yml ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── proguard-rules.pro ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── me │ └── yohom │ └── amap_location_fluttify │ ├── AmapLocationFluttifyPlugin.java │ └── sub_handler │ ├── SubHandler0.java │ ├── SubHandler1.java │ ├── SubHandler2.java │ └── custom │ └── SubHandlerCustom.java ├── assets └── amap_location_fluttify_apk.png ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── amap_location_test.jks │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── me │ │ │ │ │ └── yohom │ │ │ │ │ └── amap_location_fluttify_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── .last_build_id │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── AmapLocationFluttifyPlugin.h │ ├── AmapLocationFluttifyPlugin.m │ └── SubHandler │ │ ├── Custom │ │ ├── SubHandlerCustom.h │ │ └── SubHandlerCustom.m │ │ ├── SubHandler0.h │ │ ├── SubHandler0.m │ │ ├── SubHandler1.h │ │ └── SubHandler1.m └── amap_location_fluttify.podspec ├── lib ├── amap_location_fluttify.dart └── src │ ├── android │ ├── android.export.g.dart │ ├── com │ │ └── amap │ │ │ └── api │ │ │ ├── fence │ │ │ ├── DistrictItem.g.dart │ │ │ ├── GeoFence.g.dart │ │ │ ├── GeoFenceClient.g.dart │ │ │ ├── GeoFenceListener.g.dart │ │ │ └── PoiItem.g.dart │ │ │ └── location │ │ │ ├── AMapLocation.g.dart │ │ │ ├── AMapLocationClient.g.dart │ │ │ ├── AMapLocationClientOption.g.dart │ │ │ ├── AMapLocationClientOption │ │ │ ├── AMapLocationMode.g.dart │ │ │ ├── AMapLocationProtocol.g.dart │ │ │ ├── AMapLocationPurpose.g.dart │ │ │ └── GeoLanguage.g.dart │ │ │ ├── AMapLocationListener.g.dart │ │ │ ├── AMapLocationQualityReport.g.dart │ │ │ ├── APSService.g.dart │ │ │ ├── CoordUtil.g.dart │ │ │ ├── CoordinateConverter.g.dart │ │ │ ├── CoordinateConverter │ │ │ └── CoordType.g.dart │ │ │ ├── DPoint.g.dart │ │ │ └── UmidtokenInfo.g.dart │ ├── constants.g.dart │ └── type_op.g.dart │ ├── facade │ ├── amap_location.dart │ ├── delegates.dart │ ├── enums.dart │ ├── extensions.dart │ ├── models.dart │ └── objects.g.dart │ └── ios │ ├── AMapGeoFenceActiveAction.g.dart │ ├── AMapGeoFenceCircleRegion.g.dart │ ├── AMapGeoFenceDistrictRegion.g.dart │ ├── AMapGeoFenceErrorCode.g.dart │ ├── AMapGeoFenceManager.g.dart │ ├── AMapGeoFenceManagerDelegate.g.dart │ ├── AMapGeoFencePOIRegion.g.dart │ ├── AMapGeoFencePolygonRegion.g.dart │ ├── AMapGeoFenceRegion.g.dart │ ├── AMapGeoFenceRegionActiveStatus.g.dart │ ├── AMapGeoFenceRegionStatus.g.dart │ ├── AMapGeoFenceRegionType.g.dart │ ├── AMapLocationCircleRegion.g.dart │ ├── AMapLocationCoordinateType.g.dart │ ├── AMapLocationDistrictItem.g.dart │ ├── AMapLocationErrorCode.g.dart │ ├── AMapLocationManager.g.dart │ ├── AMapLocationManagerDelegate.g.dart │ ├── AMapLocationPOIItem.g.dart │ ├── AMapLocationPoint.g.dart │ ├── AMapLocationPolygonRegion.g.dart │ ├── AMapLocationReGeocode.g.dart │ ├── AMapLocationReGeocodeLanguage.g.dart │ ├── AMapLocationRegion.g.dart │ ├── AMapLocationRegionState.g.dart │ ├── constants.g.dart │ ├── functions.g.dart │ ├── ios.export.g.dart │ └── type_op.g.dart ├── pubspec.lock ├── pubspec.yaml └── test └── amap_location_fluttify_test.dart /.github/ISSUE_TEMPLATE/---.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 新功能 3 | about: 添加功能 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **功能描述** 11 | 12 | **Native端对应字段/方法** 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: 遇到了bug. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **插件版本** 11 | 12 | **遇到bug的平台(Android/iOS)** 13 | 14 | **描述bug** 15 | 16 | **复现步骤** 17 | 18 | **期望行为** 19 | 20 | **截图** 21 | 22 | **flutter doctor** 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: 遇到了bug. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **插件版本** 11 | 12 | **遇到bug的平台(Android/iOS)** 13 | 14 | **描述bug** 15 | 16 | **复现步骤** 17 | 18 | **期望行为** 19 | 20 | **截图** 21 | 22 | **flutter doctor** 23 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false -------------------------------------------------------------------------------- /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push] 3 | jobs: 4 | build: 5 | runs-on: macos-latest 6 | steps: 7 | - uses: actions/checkout@v1 8 | - uses: actions/setup-java@v1 9 | with: 10 | java-version: '12.x' 11 | - uses: subosito/flutter-action@v1 12 | with: 13 | channel: 'stable' 14 | - run: flutter pub get 15 | - run: flutter test 16 | - run: cd example; flutter build apk; flutter build ios --no-codesign; 17 | 18 | 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | *.iml -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 1aedbb1835bd6eb44550293d57d4d124f19901f0 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.13.2 2 | - fix: regecode空安全 3 | - enhance: 添加监听定位的最小更新距离. 4 | 5 | ## 0.13.1 6 | - enhance: 简化导出 7 | 8 | ## 0.13.0 9 | - enhance: 提升依赖 10 | 11 | ## 0.12.0 12 | - enhance: 更新底层依赖 13 | - fix: android超时时间单位为毫秒 14 | 15 | ## 0.11.0 16 | - enhance: [breaking change] timeout类型换为更直观的Duration类 17 | - enhance: Location类增加speed字段 [#48] 18 | 19 | ## 0.10.0 20 | - enhance: 更新底层依赖 21 | 22 | ## 0.9.0 23 | - enhance: [breaking change] 使用原始值代替Future返回, 简化使用 24 | - roll engine #939e12d7 25 | 26 | ## 0.8.11 27 | - roll engine #481e45c1 28 | 29 | ## 0.8.10 30 | - roll engine #dbad1c35 (#53) 31 | - fix: 直接调用stopLocation时, 对client的空判断 32 | 33 | ## 0.8.9 34 | - roll engine #0a5ab5f (#39) 35 | 36 | ## 0.8.8 37 | - roll engine #b356b08 38 | 39 | ## 0.8.7 40 | - roll engine #1053dca 41 | 42 | ## 0.8.6 43 | - 提升依赖 44 | 45 | ## 0.8.5 46 | - docs: apk下载链接修正 47 | - docs: 去重重复的信息 48 | 49 | ## 0.8.4 50 | - enhance: 加入打包的key 51 | - docs: README加入apk下载二维码 52 | - roll engine #107df19 53 | 54 | ## 0.8.3 55 | - roll engine #4d92ce0. 主要解决type_op冲突的问题. 56 | 57 | ## 0.8.2 58 | - roll engine #5c1b957 59 | 60 | ## 0.8.1 61 | - feat: Location增加accuracy字段 (#38) 62 | 63 | ## 0.8.0 64 | - enhance: 提升依赖 65 | - roll engine #ea37ae9 66 | 67 | ## 0.7.0 68 | - 提升依赖 69 | 70 | ## 0.6.0 71 | - 提升依赖 72 | 73 | ## 0.5.1 74 | - enhance: 增加bearing(设备移动方向属性), 此属性需要较长时间时间才能获取到数据, 建议在连续定位中使用. 75 | - enhance: 提供仅在android端有效的DeviceSensor枚举 76 | 77 | ## 0.5.0 78 | - enhance: 导出amap_core_fluttify 79 | - roll engine #a918944 80 | - 适配flutter 1.12.13 81 | 82 | ## 0.4.2 83 | - fix: 连续定位空指针异常 84 | 85 | ## 0.4.1 86 | - fix: 单次定位防止重复订阅 87 | 88 | ## 0.4.0 89 | - enhance: [breaking change] 单次和连续定位单独实现,并返回Future和Stream 90 | 91 | ## 0.3.2 92 | - 解决依赖冲突 93 | 94 | ## 0.3.1 95 | - 更新依赖 96 | 97 | ## 0.3.0 98 | - 更新底层 99 | 100 | ## 0.2.7 101 | - doc: 增加`await`的说明 102 | - feat: 增加ios端requireAlwaysAuth的处理 103 | 104 | ## 0.2.6 105 | - fix: dispose时,置空_androidClient和_iosClient,防止在页面级别的State中释放了client之后,重新定位时,client不为空而没有去重新创建原生client导致的原生client为空。 106 | 107 | ## 0.2.5 108 | - enhancement: 经纬度统一使用LatLng 109 | - enhancement: 调整设置回调的位置 110 | 111 | ## 0.2.4 112 | - fix: 导出enums.dart; 删除utils.g.dart 113 | 114 | ## 0.2.3 115 | - fix: 高德的key不应该放在library模块里 116 | 117 | ## 0.2.2 118 | - fix: 释放原生对象时, 只释放当前插件创建的对象 119 | 120 | ## 0.2.1 121 | - 更新README 122 | - 更新引擎版本 38df15a 123 | 124 | ## 0.2.0 125 | - setLocationListener -> startLocation 126 | 127 | ## 0.1.0 128 | - 单次定位; 连续定位 129 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 yohom 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Logo](https://github.com/fluttify-project/fluttify-core-example/blob/develop/other/Logo-Landscape.png?raw=true) 2 | 3 | # 高德 `定位`组件 4 | 5 | [![pub package](https://img.shields.io/pub/v/amap_location_fluttify.svg)](https://pub.Flutter-io.cn/packages/amap_location_fluttify) 6 | 7 | Dart接口基于[fluttify](https://github.com/yohom/fluttify-core-example)引擎生成. dartdoc[接口文档](https://pub.flutter-io.cn/documentation/amap_location_fluttify/latest/). 8 | 9 | ## DEMO 与 社区 10 | 11 | | Demo | QQ群 | 12 | | :----------: | :----------: | 13 | | 扫描二维码
或者
[点击下载](https://github.com/fluttify-project/amap_location_fluttify/blob/master/example/build/app/outputs/apk/release/app-release.apk?raw=true)
| 加入QQ群讨论
| 14 | 15 | 安装: 16 | ```yaml 17 | dependencies: 18 | flutter: 19 | sdk: flutter 20 | amap_location_fluttify: ^x.x.x 21 | ``` 22 | 23 | 导入: 24 | ```dart 25 | import 'package:amap_location_fluttify/amap_location_fluttify.dart'; 26 | ``` 27 | 28 | 使用: 29 | ```dart 30 | /// !注意: 只要是返回Future的方法, 一律使用`await`修饰, 确保当前方法执行完成后再执行下一行, 在不能使用`await`修饰的环境下, 在`then`方法中执行下一步. 31 | /// 初始化 iOS在init方法中设置, android需要去AndroidManifest.xml里去设置, 详见 https://lbs.amap.com/api/android-sdk/gettingstarted 32 | await AmapCore.init('ios key'); 33 | 34 | // 单次定位 35 | if (await requestPermission()) { 36 | final location = await AmapLocation.fetchLocation(); 37 | setState(() => _location = location); 38 | } 39 | 40 | // 连续定位 41 | if (await requestPermission()) { 42 | AmapLocation.listenLocation() 43 | .listen((location) => setState(() => _location = location)); 44 | } 45 | ``` 46 | 47 | ## LICENSE 48 | > Copyright 2020 yohom 49 | > 50 | > Licensed under the Apache License, Version 2.0 (the "License"); 51 | you may not use this file except in compliance with the License. 52 | You may obtain a copy of the License at 53 | > 54 | > http://www.apache.org/licenses/LICENSE-2.0 55 | > 56 | > Unless required by applicable law or agreed to in writing, software 57 | > distributed under the License is distributed on an "AS IS" BASIS, 58 | > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 | > See the License for the specific language governing permissions and 60 | > limitations under the License. -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:pedantic/analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | camel_case_types: false 6 | camel_case_extensions: false 7 | omit_local_variable_types: false 8 | prefer_single_quotes: false 9 | unnecessary_this: false -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'me.yohom.amap_location_fluttify' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | maven { url 'http://download.flutter.io' } 9 | maven { url "https://oss.sonatype.org/content/groups/public" } 10 | maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } 11 | maven { url "https://dl.bintray.com/aweme-open-sdk-team/public" } 12 | maven { url 'http://developer.huawei.com/repo/' } 13 | } 14 | 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.5.0' 17 | } 18 | } 19 | 20 | rootProject.allprojects { 21 | repositories { 22 | google() 23 | jcenter() 24 | maven { url 'http://download.flutter.io' } 25 | maven { url "https://oss.sonatype.org/content/groups/public" } 26 | maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } 27 | maven { url "https://dl.bintray.com/aweme-open-sdk-team/public" } 28 | maven { url 'http://developer.huawei.com/repo/' } 29 | } 30 | } 31 | 32 | apply plugin: 'com.android.library' 33 | 34 | android { 35 | compileSdkVersion 28 36 | 37 | sourceSets { 38 | main.java.srcDirs += 'src/main/kotlin' 39 | main.jniLibs.srcDir 'libs' 40 | } 41 | defaultConfig { 42 | minSdkVersion 16 43 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 44 | } 45 | lintOptions { 46 | disable 'InvalidPackage' 47 | } 48 | compileOptions { 49 | targetCompatibility JavaVersion.VERSION_1_8 50 | sourceCompatibility JavaVersion.VERSION_1_8 51 | } 52 | packagingOptions { 53 | merge 'res/values/values.xml' 54 | merge 'AndroidManifest.xml' 55 | merge 'R.txt' 56 | merge 'classes.jar' 57 | merge 'proguard.txt' 58 | } 59 | buildTypes { 60 | release { 61 | consumerProguardFiles "proguard-rules.pro" 62 | } 63 | } 64 | } 65 | 66 | dependencies { 67 | implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 68 | implementation 'androidx.annotation:annotation:1.1.0' 69 | implementation 'androidx.appcompat:appcompat:1.1.0' 70 | compileOnly rootProject.findProject(":foundation_fluttify") 71 | // flutter plugin dependency 72 | compileOnly rootProject.findProject(":amap_core_fluttify") 73 | // sdk dependency 74 | api 'com.amap.api:location:5.2.0' 75 | } 76 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip 6 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | # 高德地图混淆规则 24 | -keep class com.amap.api.location.**{*;} 25 | -keep class com.amap.api.fence.**{*;} 26 | -keep class com.autonavi.aps.amapapi.model.**{*;} -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'amap_location_fluttify' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /android/src/main/java/me/yohom/amap_location_fluttify/AmapLocationFluttifyPlugin.java: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | package me.yohom.amap_location_fluttify; 6 | 7 | import android.os.Bundle; 8 | import android.util.Log; 9 | import android.app.Activity; 10 | 11 | import java.util.ArrayList; 12 | import java.util.Collection; 13 | import java.util.HashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | 17 | import androidx.annotation.NonNull; 18 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 19 | import io.flutter.embedding.engine.plugins.activity.ActivityAware; 20 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; 21 | import io.flutter.plugin.common.BinaryMessenger; 22 | import io.flutter.plugin.common.MethodCall; 23 | import io.flutter.plugin.common.MethodChannel; 24 | import io.flutter.plugin.common.PluginRegistry.Registrar; 25 | import io.flutter.plugin.common.StandardMethodCodec; 26 | import io.flutter.plugin.platform.PlatformViewRegistry; 27 | 28 | import me.yohom.amap_location_fluttify.sub_handler.*; 29 | import me.yohom.amap_location_fluttify.sub_handler.custom.SubHandlerCustom; 30 | import me.yohom.foundation_fluttify.core.FluttifyMessageCodec; 31 | 32 | import static me.yohom.foundation_fluttify.FoundationFluttifyPluginKt.getEnableLog; 33 | import static me.yohom.foundation_fluttify.FoundationFluttifyPluginKt.getHEAP; 34 | 35 | @SuppressWarnings("ALL") 36 | public class AmapLocationFluttifyPlugin implements FlutterPlugin, MethodChannel.MethodCallHandler, ActivityAware { 37 | 38 | private static List> handlerMapList; 39 | 40 | // v1 android embedding for compatible 41 | public static void registerWith(Registrar registrar) { 42 | final MethodChannel channel = new MethodChannel(registrar.messenger(), "me.yohom/amap_location_fluttify", new StandardMethodCodec(new FluttifyMessageCodec())); 43 | 44 | AmapLocationFluttifyPlugin plugin = new AmapLocationFluttifyPlugin(); 45 | 46 | BinaryMessenger messenger = registrar.messenger(); 47 | PlatformViewRegistry platformViewRegistry = registrar.platformViewRegistry(); 48 | Activity activity = registrar.activity(); 49 | 50 | plugin.messenger = messenger; 51 | plugin.platformViewRegistry = platformViewRegistry; 52 | 53 | handlerMapList = new ArrayList<>(); 54 | handlerMapList.add(SubHandler0.getSubHandler(messenger)); 55 | handlerMapList.add(SubHandler1.getSubHandler(messenger)); 56 | handlerMapList.add(SubHandler2.getSubHandler(messenger)); 57 | handlerMapList.add(SubHandlerCustom.instance.getSubHandler(messenger, registrar.activity())); 58 | 59 | channel.setMethodCallHandler(plugin); 60 | 61 | // register platform view 62 | 63 | } 64 | 65 | private BinaryMessenger messenger; 66 | private PlatformViewRegistry platformViewRegistry; 67 | 68 | // v2 android embedding 69 | @Override 70 | public void onAttachedToEngine(FlutterPluginBinding binding) { 71 | if (getEnableLog()) { 72 | Log.d("fluttify-java", "AmapLocationFluttifyPlugin::onAttachedToEngine@" + binding); 73 | } 74 | 75 | final MethodChannel channel = new MethodChannel(binding.getBinaryMessenger(), "me.yohom/amap_location_fluttify", new StandardMethodCodec(new FluttifyMessageCodec())); 76 | 77 | messenger = binding.getBinaryMessenger(); 78 | platformViewRegistry = binding.getPlatformViewRegistry(); 79 | 80 | handlerMapList = new ArrayList<>(); 81 | handlerMapList.add(SubHandler0.getSubHandler(messenger)); 82 | handlerMapList.add(SubHandler1.getSubHandler(messenger)); 83 | handlerMapList.add(SubHandler2.getSubHandler(messenger)); 84 | 85 | channel.setMethodCallHandler(this); 86 | } 87 | 88 | @Override 89 | public void onDetachedFromEngine(FlutterPluginBinding binding) { 90 | if (getEnableLog()) { 91 | Log.d("fluttify-java", "AmapLocationFluttifyPlugin::onDetachedFromEngine@" + binding); 92 | } 93 | } 94 | 95 | @Override 96 | public void onAttachedToActivity(ActivityPluginBinding binding) { 97 | if (getEnableLog()) { 98 | Log.d("fluttify-java", "AmapLocationFluttifyPlugin::onAttachedToActivity@" + binding); 99 | } 100 | Activity activity = binding.getActivity(); 101 | 102 | handlerMapList.add(SubHandlerCustom.instance.getSubHandler(messenger, activity)); 103 | 104 | // register platform view 105 | 106 | } 107 | 108 | @Override 109 | public void onDetachedFromActivity() { 110 | if (getEnableLog()) { 111 | Log.d("fluttify-java", "AmapLocationFluttifyPlugin::onDetachedFromActivity"); 112 | } 113 | } 114 | 115 | @Override 116 | public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { 117 | if (getEnableLog()) { 118 | Log.d("fluttify-java", "AmapLocationFluttifyPlugin::onReattachedToActivityForConfigChanges@" + binding); 119 | } 120 | } 121 | 122 | @Override 123 | public void onDetachedFromActivityForConfigChanges() { 124 | if (getEnableLog()) { 125 | Log.d("fluttify-java", "AmapLocationFluttifyPlugin::onDetachedFromActivityForConfigChanges"); 126 | } 127 | } 128 | 129 | @Override 130 | public void onMethodCall(@NonNull MethodCall methodCall, @NonNull MethodChannel.Result methodResult) { 131 | Handler handler = null; 132 | for (Map handlerMap : handlerMapList) { 133 | if (handlerMap.containsKey(methodCall.method)) { 134 | handler = handlerMap.get(methodCall.method); 135 | break; 136 | } 137 | } 138 | if (handler != null) { 139 | try { 140 | handler.call(methodCall.arguments, methodResult); 141 | } catch (Exception e) { 142 | e.printStackTrace(); 143 | methodResult.error(e.getMessage(), null, null); 144 | } 145 | } else { 146 | methodResult.notImplemented(); 147 | } 148 | } 149 | 150 | @FunctionalInterface 151 | public static interface Handler { 152 | void call(Object args, MethodChannel.Result methodResult) throws Exception; 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /assets/amap_location_fluttify_apk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/assets/amap_location_fluttify_apk.png -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/Flutter/flutter_export_environment.sh 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 1aedbb1835bd6eb44550293d57d4d124f19901f0 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # amap_location_fluttify_example 2 | 3 | Demonstrates how to use the amap_location_fluttify plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/amap_location_test.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/android/amap_location_test.jks -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | applicationId "me.yohom.amap_location_fluttify_example" 41 | minSdkVersion 16 42 | targetSdkVersion 28 43 | versionCode flutterVersionCode.toInteger() 44 | versionName flutterVersionName 45 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 46 | } 47 | 48 | signingConfigs { 49 | release { 50 | keyAlias 'amap_location_test' 51 | keyPassword 'amap_location_test' 52 | storeFile file('../amap_location_test.jks') 53 | storePassword 'amap_location_test' 54 | } 55 | } 56 | 57 | buildTypes { 58 | debug { 59 | signingConfig signingConfigs.release 60 | } 61 | release { 62 | signingConfig signingConfigs.release 63 | } 64 | } 65 | } 66 | 67 | flutter { 68 | source '../..' 69 | } 70 | 71 | dependencies { 72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 73 | testImplementation 'junit:junit:4.12' 74 | androidTestImplementation 'androidx.test:runner:1.1.1' 75 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 76 | } 77 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 14 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/me/yohom/amap_location_fluttify_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package me.yohom.amap_location_fluttify_example; 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity; 5 | import io.flutter.embedding.engine.FlutterEngine; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | android.enableR8=true 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | 6b1e15df3a85166b1cc796937be1a5f7 -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 32 | end 33 | 34 | post_install do |installer| 35 | installer.pods_project.targets.each do |target| 36 | flutter_additional_ios_build_settings(target) 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | amap_location_fluttify_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | NSLocationAlwaysAndWhenInUseUsageDescription 36 | 需要后台定位 37 | NSLocationWhenInUseUsageDescription 38 | 需要定位 39 | UIBackgroundModes 40 | 41 | location 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | io.flutter.embedded_views_preview 53 | YES 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:amap_core_fluttify/amap_core_fluttify.dart'; 2 | import 'package:amap_location_fluttify/amap_location_fluttify.dart'; 3 | import 'package:decorated_flutter/decorated_flutter.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:permission_handler/permission_handler.dart'; 6 | 7 | void main() async { 8 | WidgetsFlutterBinding.ensureInitialized(); 9 | 10 | await AmapLocation.instance.init(iosKey: 'f6422eadda731fb0d9ffb3260a5cf899'); 11 | runApp(MyApp()); 12 | } 13 | 14 | class MyApp extends StatefulWidget { 15 | @override 16 | _MyAppState createState() => _MyAppState(); 17 | } 18 | 19 | class _MyAppState extends State { 20 | Location _location; 21 | String _fenceStatus; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return MaterialApp( 26 | home: Scaffold( 27 | appBar: AppBar(title: const Text('Plugin example app')), 28 | body: DecoratedColumn( 29 | padding: EdgeInsets.symmetric(horizontal: kSpaceLarge), 30 | crossAxisAlignment: CrossAxisAlignment.stretch, 31 | mainAxisAlignment: MainAxisAlignment.center, 32 | children: [ 33 | RaisedButton( 34 | child: Text('获取单次定位'), 35 | onPressed: () async { 36 | if (await requestPermission()) { 37 | final location = await AmapLocation.instance.fetchLocation(); 38 | setState(() => _location = location); 39 | } 40 | }, 41 | ), 42 | RaisedButton( 43 | child: Text('获取连续定位'), 44 | onPressed: () async { 45 | if (await requestPermission()) { 46 | await AmapLocation.instance.enableBackgroundLocation( 47 | 10, 48 | BackgroundNotification( 49 | contentTitle: 'contentTitle', 50 | channelId: 'channelId', 51 | contentText: 'contentText', 52 | channelName: 'channelName', 53 | ), 54 | ); 55 | AmapLocation.instance 56 | .listenLocation() 57 | .listen((event) => setState(() => _location = event)); 58 | } 59 | }, 60 | ), 61 | RaisedButton( 62 | child: Text('停止定位'), 63 | onPressed: () async { 64 | if (await requestPermission()) { 65 | await AmapLocation.instance.stopLocation(); 66 | setState(() => _location = null); 67 | } 68 | }, 69 | ), 70 | RaisedButton( 71 | child: Text('添加圆形围栏'), 72 | onPressed: () async { 73 | if (await requestPermission()) { 74 | AmapLocation.instance 75 | .addCircleGeoFence( 76 | center: LatLng(29, 119), 77 | radius: 1000, 78 | customId: 'testid', 79 | ) 80 | .listen((event) { 81 | setState(() { 82 | _fenceStatus = 83 | '状态: ${event.status}, 围栏id: ${event.fenceId}, 自定义id: ${event.customId}'; 84 | }); 85 | }); 86 | } 87 | }, 88 | ), 89 | RaisedButton( 90 | child: Text('添加多边形围栏'), 91 | onPressed: () async { 92 | if (await requestPermission()) { 93 | AmapLocation.instance.addPolygonGeoFence( 94 | pointList: [ 95 | LatLng(29.255201, 119.353437), 96 | LatLng(28.974455, 119.508619), 97 | LatLng(29.172496, 119.560804), 98 | LatLng(29.306707, 119.422101), 99 | ], 100 | customId: 'testid', 101 | ).listen((event) { 102 | setState(() { 103 | _fenceStatus = 104 | '状态: ${event.status}, 围栏id: ${event.fenceId}, 自定义id: ${event.customId}'; 105 | }); 106 | }); 107 | } 108 | }, 109 | ), 110 | RaisedButton( 111 | child: Text('添加poi围栏'), 112 | onPressed: () async { 113 | if (await requestPermission()) { 114 | AmapLocation.instance 115 | .addPoiGeoFence( 116 | keyword: '肯德基', 117 | customId: 'testid', 118 | city: '兰溪', 119 | aroundRadius: 10000, 120 | ) 121 | .listen((event) { 122 | setState(() { 123 | _fenceStatus = 124 | '状态: ${event.status}, 围栏id: ${event.fenceId}, 自定义id: ${event.customId}'; 125 | }); 126 | }); 127 | } 128 | }, 129 | ), 130 | RaisedButton( 131 | child: Text('添加行政区划围栏'), 132 | onPressed: () async { 133 | if (await requestPermission()) { 134 | AmapLocation.instance 135 | .addDistrictGeoFence(keyword: '兰溪') 136 | .listen((event) { 137 | setState(() { 138 | _fenceStatus = 139 | '状态: ${event.status}, 围栏id: ${event.fenceId}, 自定义id: ${event.customId}'; 140 | }); 141 | }); 142 | } 143 | }, 144 | ), 145 | RaisedButton( 146 | child: Text('释放资源'), 147 | onPressed: () { 148 | AmapLocation.instance.dispose(); 149 | }, 150 | ), 151 | DecoratedColumn( 152 | expanded: true, 153 | scrollable: true, 154 | children: [ 155 | if (_location != null) 156 | Center( 157 | child: Text( 158 | _location.toString(), 159 | textAlign: TextAlign.center, 160 | ), 161 | ), 162 | if (_fenceStatus != null) 163 | Center( 164 | child: Text( 165 | _fenceStatus.toString(), 166 | textAlign: TextAlign.center, 167 | ), 168 | ), 169 | ], 170 | ), 171 | ], 172 | ), 173 | ), 174 | ); 175 | } 176 | } 177 | 178 | Future requestPermission() async { 179 | final permissions = await Permission.locationWhenInUse.request(); 180 | 181 | if (permissions.isGranted) { 182 | return true; 183 | } else { 184 | toast('需要定位权限!'); 185 | return false; 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: amap_location_fluttify_example 2 | description: Demonstrates how to use the amap_location_fluttify plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.2.2 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | cupertino_icons: ^0.1.3 12 | decorated_flutter: ^0.18.0 13 | permission_handler: ^5.0.0 14 | 15 | #dependency_overrides: 16 | # foundation_fluttify: 17 | # path: /Users/yohom/Github/Me/All/fluttify/fluttify_infra/foundation_fluttify 18 | # core_location_fluttify: 19 | # path: /Users/yohom/Github/Me/All/fluttify/fluttify_infra/core_location_fluttify 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | amap_location_fluttify: 25 | path: ../ 26 | 27 | flutter: 28 | uses-material-design: true -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | void main() {} 9 | -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | amap_location_fluttify_example 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amap_location_fluttify_example", 3 | "short_name": "amap_location_fluttify_example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "Demonstrates how to use the amap_location_fluttify plugin.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/amap_location_fluttify/6b729990030098db5760b3d04f501fa138d15259/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/AmapLocationFluttifyPlugin.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import 6 | #import 7 | 8 | typedef void (^Handler)(NSObject *, id, FlutterResult); 9 | 10 | @interface AmapLocationFluttifyPlugin : NSObject 11 | 12 | - (instancetype) initWithFlutterPluginRegistrar: (NSObject *) registrar; 13 | 14 | @property(nonatomic) NSObject* registrar; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/Custom/SubHandlerCustom.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "AmapLocationFluttifyPlugin.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface AmapLocationFluttifyPlugin (SubHandlerCustom) 10 | - (NSDictionary*) getSubHandlerCustom; 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END 14 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/Custom/SubHandlerCustom.m: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "SubHandlerCustom.h" 6 | 7 | // Dart端一次方法调用所存在的栈, 只有当MethodChannel传递参数受限时, 再启用这个容器 8 | extern NSMutableDictionary* STACK; 9 | // Dart端随机存取对象的容器 10 | extern NSMutableDictionary* HEAP; 11 | // 日志打印开关 12 | extern BOOL enableLog; 13 | 14 | @implementation AmapLocationFluttifyPlugin (SubHandlerCustom) 15 | - (NSDictionary*) getSubHandlerCustom { 16 | return @{ 17 | 18 | }; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/SubHandler0.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "AmapLocationFluttifyPlugin.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface AmapLocationFluttifyPlugin (SubHandler0) 10 | - (NSDictionary*) getSubHandler0; 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END 14 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/SubHandler1.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "AmapLocationFluttifyPlugin.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface AmapLocationFluttifyPlugin (SubHandler1) 10 | - (NSDictionary*) getSubHandler1; 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END 14 | -------------------------------------------------------------------------------- /ios/amap_location_fluttify.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'amap_location_fluttify' 6 | s.version = '0.0.1' 7 | s.summary = 'An `Amap` Location Component, Powered By `Fluttify`, A Compiler Generating Dart Bindings For Native SDK.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'https://github.com/fluttify-project/amap_location_fluttify' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'yohom' => 'yohombao@qq.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = ['Classes/**/*.h', 'Vendors/*.h'] # 只接收顶层的.h文件, 防止framework下面的.h文件被包含 17 | s.dependency 'Flutter' 18 | s.dependency 'foundation_fluttify' 19 | # flutter plugin dependency 20 | s.dependency 'amap_core_fluttify' 21 | # sdk dependency 22 | s.dependency 'AMapLocation-NO-IDFA', '2.6.5' 23 | 24 | s.static_framework = true 25 | s.ios.deployment_target = '8.0' 26 | # include project framework 27 | s.vendored_frameworks = 'Vendors/*.framework' 28 | # include project .a 29 | s.vendored_libraries = 'Vendors/*.a' 30 | # ios system framework 31 | s.frameworks = [ 32 | 33 | ] 34 | # ios system library 35 | s.libraries = [ 36 | 37 | ] 38 | # resources 39 | s.resources = 'Vendors/**/*.bundle' 40 | # s.resource_bundles = { 41 | # 'amap_location_fluttify' => ['Vendors/*.framework/*.bundle'] 42 | # } 43 | end 44 | 45 | -------------------------------------------------------------------------------- /lib/amap_location_fluttify.dart: -------------------------------------------------------------------------------- 1 | library amap_location_fluttify; 2 | 3 | export 'src/facade/amap_location.dart'; 4 | export 'src/facade/enums.dart'; 5 | export 'src/facade/models.dart'; 6 | -------------------------------------------------------------------------------- /lib/src/android/android.export.g.dart: -------------------------------------------------------------------------------- 1 | export 'type_op.g.dart'; 2 | export 'constants.g.dart'; 3 | export 'com/amap/api/location/AMapLocationClientOption/AMapLocationProtocol.g.dart'; 4 | export 'com/amap/api/location/AMapLocationClientOption/AMapLocationPurpose.g.dart'; 5 | export 'com/amap/api/location/AMapLocationClientOption/GeoLanguage.g.dart'; 6 | export 'com/amap/api/location/AMapLocationClientOption/AMapLocationMode.g.dart'; 7 | export 'com/amap/api/location/CoordUtil.g.dart'; 8 | export 'com/amap/api/location/APSService.g.dart'; 9 | export 'com/amap/api/location/UmidtokenInfo.g.dart'; 10 | export 'com/amap/api/location/AMapLocationClientOption.g.dart'; 11 | export 'com/amap/api/location/CoordinateConverter.g.dart'; 12 | export 'com/amap/api/location/CoordinateConverter/CoordType.g.dart'; 13 | export 'com/amap/api/location/AMapLocation.g.dart'; 14 | export 'com/amap/api/location/AMapLocationListener.g.dart'; 15 | export 'com/amap/api/location/AMapLocationQualityReport.g.dart'; 16 | export 'com/amap/api/location/AMapLocationClient.g.dart'; 17 | export 'com/amap/api/location/DPoint.g.dart'; 18 | export 'com/amap/api/fence/DistrictItem.g.dart'; 19 | export 'com/amap/api/fence/PoiItem.g.dart'; 20 | export 'com/amap/api/fence/GeoFenceClient.g.dart'; 21 | export 'com/amap/api/fence/GeoFenceListener.g.dart'; 22 | export 'com/amap/api/fence/GeoFence.g.dart'; 23 | export 'package:amap_core_fluttify/amap_core_fluttify.dart'; 24 | export '../facade/objects.g.dart'; 25 | -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/fence/GeoFenceListener.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | 16 | 17 | mixin com_amap_api_fence_GeoFenceListener on java_lang_Object { 18 | 19 | 20 | 21 | 22 | @override 23 | final String tag__ = 'amap_location_fluttify'; 24 | 25 | 26 | 27 | 28 | 29 | @mustCallSuper 30 | Future onGeoFenceCreateFinished(List var1, int var2, String var3) {} 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationMode.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum com_amap_api_location_AMapLocationClientOption_AMapLocationMode { 7 | Battery_Saving /* null */, 8 | Device_Sensors /* null */, 9 | Hight_Accuracy /* null */ 10 | } 11 | 12 | extension com_amap_api_location_AMapLocationClientOption_AMapLocationModeToX on com_amap_api_location_AMapLocationClientOption_AMapLocationMode { 13 | int toValue() { 14 | switch (this) { 15 | case com_amap_api_location_AMapLocationClientOption_AMapLocationMode.Battery_Saving: return com_amap_api_location_AMapLocationClientOption_AMapLocationMode.Battery_Saving.index + 0; 16 | case com_amap_api_location_AMapLocationClientOption_AMapLocationMode.Device_Sensors: return com_amap_api_location_AMapLocationClientOption_AMapLocationMode.Device_Sensors.index + 0; 17 | case com_amap_api_location_AMapLocationClientOption_AMapLocationMode.Hight_Accuracy: return com_amap_api_location_AMapLocationClientOption_AMapLocationMode.Hight_Accuracy.index + 0; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension com_amap_api_location_AMapLocationClientOption_AMapLocationModeFromX on int { 24 | com_amap_api_location_AMapLocationClientOption_AMapLocationMode tocom_amap_api_location_AMapLocationClientOption_AMapLocationMode() { 25 | switch (this) { 26 | 27 | default: return com_amap_api_location_AMapLocationClientOption_AMapLocationMode.values[this + 0]; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationProtocol.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol { 7 | HTTP /* null */, 8 | HTTPS /* null */ 9 | } 10 | 11 | extension com_amap_api_location_AMapLocationClientOption_AMapLocationProtocolToX on com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol { 12 | int toValue() { 13 | switch (this) { 14 | case com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol.HTTP: return com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol.HTTP.index + 0; 15 | case com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol.HTTPS: return com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol.HTTPS.index + 0; 16 | default: return 0; 17 | } 18 | } 19 | } 20 | 21 | extension com_amap_api_location_AMapLocationClientOption_AMapLocationProtocolFromX on int { 22 | com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol tocom_amap_api_location_AMapLocationClientOption_AMapLocationProtocol() { 23 | switch (this) { 24 | 25 | default: return com_amap_api_location_AMapLocationClientOption_AMapLocationProtocol.values[this + 0]; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/AMapLocationClientOption/AMapLocationPurpose.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose { 7 | SignIn /* null */, 8 | Transport /* null */, 9 | Sport /* null */ 10 | } 11 | 12 | extension com_amap_api_location_AMapLocationClientOption_AMapLocationPurposeToX on com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose { 13 | int toValue() { 14 | switch (this) { 15 | case com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.SignIn: return com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.SignIn.index + 0; 16 | case com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.Transport: return com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.Transport.index + 0; 17 | case com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.Sport: return com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.Sport.index + 0; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension com_amap_api_location_AMapLocationClientOption_AMapLocationPurposeFromX on int { 24 | com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose tocom_amap_api_location_AMapLocationClientOption_AMapLocationPurpose() { 25 | switch (this) { 26 | 27 | default: return com_amap_api_location_AMapLocationClientOption_AMapLocationPurpose.values[this + 0]; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/AMapLocationClientOption/GeoLanguage.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum com_amap_api_location_AMapLocationClientOption_GeoLanguage { 7 | DEFAULT /* null */, 8 | ZH /* null */, 9 | EN /* null */ 10 | } 11 | 12 | extension com_amap_api_location_AMapLocationClientOption_GeoLanguageToX on com_amap_api_location_AMapLocationClientOption_GeoLanguage { 13 | int toValue() { 14 | switch (this) { 15 | case com_amap_api_location_AMapLocationClientOption_GeoLanguage.DEFAULT: return com_amap_api_location_AMapLocationClientOption_GeoLanguage.DEFAULT.index + 0; 16 | case com_amap_api_location_AMapLocationClientOption_GeoLanguage.ZH: return com_amap_api_location_AMapLocationClientOption_GeoLanguage.ZH.index + 0; 17 | case com_amap_api_location_AMapLocationClientOption_GeoLanguage.EN: return com_amap_api_location_AMapLocationClientOption_GeoLanguage.EN.index + 0; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension com_amap_api_location_AMapLocationClientOption_GeoLanguageFromX on int { 24 | com_amap_api_location_AMapLocationClientOption_GeoLanguage tocom_amap_api_location_AMapLocationClientOption_GeoLanguage() { 25 | switch (this) { 26 | 27 | default: return com_amap_api_location_AMapLocationClientOption_GeoLanguage.values[this + 0]; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/AMapLocationListener.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | 16 | 17 | mixin com_amap_api_location_AMapLocationListener on java_lang_Object { 18 | 19 | 20 | 21 | 22 | @override 23 | final String tag__ = 'amap_location_fluttify'; 24 | 25 | 26 | 27 | 28 | 29 | @mustCallSuper 30 | Future onLocationChanged(com_amap_api_location_AMapLocation var1) {} 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/APSService.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class com_amap_api_location_APSService extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'com.amap.api.location.APSService'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createcom_amap_api_location_APSService__', ); 28 | } 29 | 30 | static Future> create_batch__(int length) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchcom_amap_api_location_APSService__', {'length': length}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | 41 | //endregion 42 | 43 | //region setters 44 | 45 | //endregion 46 | 47 | //region methods 48 | 49 | Future onCreate__android_content_Context(android_content_Context var1) async { 50 | // print log 51 | if (fluttifyLogEnabled) { 52 | debugPrint('fluttify-dart: com.amap.api.location.APSService@$refId::onCreate([])'); 53 | } 54 | 55 | // invoke native method 56 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onCreate__android_content_Context', {"var1": var1, "__this__": this}); 57 | 58 | 59 | // handle native call 60 | 61 | 62 | return __result__; 63 | } 64 | 65 | 66 | Future onCreate() async { 67 | // print log 68 | if (fluttifyLogEnabled) { 69 | debugPrint('fluttify-dart: com.amap.api.location.APSService@$refId::onCreate([])'); 70 | } 71 | 72 | // invoke native method 73 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onCreate', {"__this__": this}); 74 | 75 | 76 | // handle native call 77 | 78 | 79 | return __result__; 80 | } 81 | 82 | 83 | Future onStartCommand(android_content_Intent var1, int var2, int var3) async { 84 | // print log 85 | if (fluttifyLogEnabled) { 86 | debugPrint('fluttify-dart: com.amap.api.location.APSService@$refId::onStartCommand([\'var2\':$var2, \'var3\':$var3])'); 87 | } 88 | 89 | // invoke native method 90 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onStartCommand', {"var1": var1, "var2": var2, "var3": var3, "__this__": this}); 91 | 92 | 93 | // handle native call 94 | 95 | 96 | return __result__; 97 | } 98 | 99 | 100 | Future onDestroy() async { 101 | // print log 102 | if (fluttifyLogEnabled) { 103 | debugPrint('fluttify-dart: com.amap.api.location.APSService@$refId::onDestroy([])'); 104 | } 105 | 106 | // invoke native method 107 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onDestroy', {"__this__": this}); 108 | 109 | 110 | // handle native call 111 | 112 | 113 | return __result__; 114 | } 115 | 116 | //endregion 117 | 118 | @override 119 | String toString() { 120 | return 'com_amap_api_location_APSService{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 121 | } 122 | } 123 | 124 | extension com_amap_api_location_APSService_Batch on List { 125 | //region getters 126 | 127 | //endregion 128 | 129 | //region setters 130 | 131 | //endregion 132 | 133 | //region methods 134 | 135 | Future> onCreate__android_content_Context_batch(List var1) async { 136 | if (false) { 137 | return Future.error('all args must have same length!'); 138 | } 139 | 140 | // invoke native method 141 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onCreate__android_content_Context_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 142 | 143 | 144 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 145 | } 146 | 147 | 148 | Future> onCreate_batch() async { 149 | if (false) { 150 | return Future.error('all args must have same length!'); 151 | } 152 | 153 | // invoke native method 154 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onCreate_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 155 | 156 | 157 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 158 | } 159 | 160 | 161 | Future> onStartCommand_batch(List var1, List var2, List var3) async { 162 | if (var1.length != var2.length || var2.length != var3.length) { 163 | return Future.error('all args must have same length!'); 164 | } 165 | 166 | // invoke native method 167 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onStartCommand_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "var2": var2[__i__], "var3": var3[__i__], "__this__": this[__i__]}]); 168 | 169 | 170 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 171 | } 172 | 173 | 174 | Future> onDestroy_batch() async { 175 | if (false) { 176 | return Future.error('all args must have same length!'); 177 | } 178 | 179 | // invoke native method 180 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.APSService::onDestroy_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 181 | 182 | 183 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 184 | } 185 | 186 | //endregion 187 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/CoordUtil.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class com_amap_api_location_CoordUtil extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'com.amap.api.location.CoordUtil'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createcom_amap_api_location_CoordUtil__', ); 28 | } 29 | 30 | static Future> create_batch__(int length) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchcom_amap_api_location_CoordUtil__', {'length': length}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | 41 | //endregion 42 | 43 | //region setters 44 | 45 | //endregion 46 | 47 | //region methods 48 | 49 | static Future convertToGcj(Float64List var0, Float64List var1) async { 50 | // print log 51 | if (fluttifyLogEnabled) { 52 | debugPrint('fluttify-dart: com.amap.api.location.CoordUtil::convertToGcj([\'var0\':$var0, \'var1\':$var1])'); 53 | } 54 | 55 | // invoke native method 56 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordUtil::convertToGcj', {"var0": var0, "var1": var1}); 57 | 58 | 59 | // handle native call 60 | 61 | 62 | return __result__; 63 | } 64 | 65 | 66 | static Future isLoadedSo() async { 67 | // print log 68 | if (fluttifyLogEnabled) { 69 | debugPrint('fluttify-dart: com.amap.api.location.CoordUtil::isLoadedSo([])'); 70 | } 71 | 72 | // invoke native method 73 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordUtil::isLoadedSo', ); 74 | 75 | 76 | // handle native call 77 | 78 | 79 | return __result__; 80 | } 81 | 82 | 83 | static Future setLoadedSo(bool var0) async { 84 | // print log 85 | if (fluttifyLogEnabled) { 86 | debugPrint('fluttify-dart: com.amap.api.location.CoordUtil::setLoadedSo([\'var0\':$var0])'); 87 | } 88 | 89 | // invoke native method 90 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordUtil::setLoadedSo', {"var0": var0}); 91 | 92 | 93 | // handle native call 94 | 95 | 96 | return __result__; 97 | } 98 | 99 | //endregion 100 | 101 | @override 102 | String toString() { 103 | return 'com_amap_api_location_CoordUtil{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 104 | } 105 | } 106 | 107 | extension com_amap_api_location_CoordUtil_Batch on List { 108 | //region getters 109 | 110 | //endregion 111 | 112 | //region setters 113 | 114 | //endregion 115 | 116 | //region methods 117 | 118 | static Future> convertToGcj_batch(List var0, List var1) async { 119 | if (var0.length != var1.length) { 120 | return Future.error('all args must have same length!'); 121 | } 122 | 123 | // invoke native method 124 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordUtil::convertToGcj_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__], "var1": var1[__i__]}]); 125 | 126 | 127 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 128 | } 129 | 130 | 131 | static Future> isLoadedSo_batch() async { 132 | if (false) { 133 | return Future.error('all args must have same length!'); 134 | } 135 | 136 | // invoke native method 137 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordUtil::isLoadedSo_batch', ); 138 | 139 | 140 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 141 | } 142 | 143 | 144 | static Future> setLoadedSo_batch(List var0) async { 145 | if (false) { 146 | return Future.error('all args must have same length!'); 147 | } 148 | 149 | // invoke native method 150 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordUtil::setLoadedSo_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__]}]); 151 | 152 | 153 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 154 | } 155 | 156 | //endregion 157 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/CoordinateConverter.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class com_amap_api_location_CoordinateConverter extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'com.amap.api.location.CoordinateConverter'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__android_content_Context(android_content_Context var1) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createcom_amap_api_location_CoordinateConverter__android_content_Context', {"var1": var1}); 28 | } 29 | 30 | static Future> create_batch__android_content_Context(List var1) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchcom_amap_api_location_CoordinateConverter__android_content_Context', [for (int __i__ = 0; __i__ < var1.length; __i__++) {"var1": var1[__i__]}]); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | 41 | //endregion 42 | 43 | //region setters 44 | 45 | //endregion 46 | 47 | //region methods 48 | 49 | Future from(com_amap_api_location_CoordinateConverter_CoordType var1) async { 50 | // print log 51 | if (fluttifyLogEnabled) { 52 | debugPrint('fluttify-dart: com.amap.api.location.CoordinateConverter@$refId::from([])'); 53 | } 54 | 55 | // invoke native method 56 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::from', {"var1": var1.toValue(), "__this__": this}); 57 | 58 | 59 | // handle native call 60 | 61 | 62 | return __result__; 63 | } 64 | 65 | 66 | Future coord(com_amap_api_location_DPoint var1) async { 67 | // print log 68 | if (fluttifyLogEnabled) { 69 | debugPrint('fluttify-dart: com.amap.api.location.CoordinateConverter@$refId::coord([])'); 70 | } 71 | 72 | // invoke native method 73 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::coord', {"var1": var1, "__this__": this}); 74 | 75 | 76 | // handle native call 77 | 78 | 79 | return __result__; 80 | } 81 | 82 | 83 | Future convert() async { 84 | // print log 85 | if (fluttifyLogEnabled) { 86 | debugPrint('fluttify-dart: com.amap.api.location.CoordinateConverter@$refId::convert([])'); 87 | } 88 | 89 | // invoke native method 90 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::convert', {"__this__": this}); 91 | 92 | 93 | // handle native call 94 | 95 | 96 | return __result__; 97 | } 98 | 99 | 100 | static Future isAMapDataAvailable(double var0, double var2) async { 101 | // print log 102 | if (fluttifyLogEnabled) { 103 | debugPrint('fluttify-dart: com.amap.api.location.CoordinateConverter::isAMapDataAvailable([\'var0\':$var0, \'var2\':$var2])'); 104 | } 105 | 106 | // invoke native method 107 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::isAMapDataAvailable', {"var0": var0, "var2": var2}); 108 | 109 | 110 | // handle native call 111 | 112 | 113 | return __result__; 114 | } 115 | 116 | 117 | static Future calculateLineDistance(com_amap_api_location_DPoint var0, com_amap_api_location_DPoint var1) async { 118 | // print log 119 | if (fluttifyLogEnabled) { 120 | debugPrint('fluttify-dart: com.amap.api.location.CoordinateConverter::calculateLineDistance([])'); 121 | } 122 | 123 | // invoke native method 124 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::calculateLineDistance', {"var0": var0, "var1": var1}); 125 | 126 | 127 | // handle native call 128 | 129 | 130 | return __result__; 131 | } 132 | 133 | //endregion 134 | 135 | @override 136 | String toString() { 137 | return 'com_amap_api_location_CoordinateConverter{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 138 | } 139 | } 140 | 141 | extension com_amap_api_location_CoordinateConverter_Batch on List { 142 | //region getters 143 | 144 | //endregion 145 | 146 | //region setters 147 | 148 | //endregion 149 | 150 | //region methods 151 | 152 | Future> from_batch(List var1) async { 153 | if (false) { 154 | return Future.error('all args must have same length!'); 155 | } 156 | 157 | // invoke native method 158 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::from_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__].toValue(), "__this__": this[__i__]}]); 159 | 160 | 161 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 162 | } 163 | 164 | 165 | Future> coord_batch(List var1) async { 166 | if (false) { 167 | return Future.error('all args must have same length!'); 168 | } 169 | 170 | // invoke native method 171 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::coord_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 172 | 173 | 174 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 175 | } 176 | 177 | 178 | Future> convert_batch() async { 179 | if (false) { 180 | return Future.error('all args must have same length!'); 181 | } 182 | 183 | // invoke native method 184 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::convert_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 185 | 186 | 187 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 188 | } 189 | 190 | 191 | static Future> isAMapDataAvailable_batch(List var0, List var2) async { 192 | if (var0.length != var2.length) { 193 | return Future.error('all args must have same length!'); 194 | } 195 | 196 | // invoke native method 197 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::isAMapDataAvailable_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__], "var2": var2[__i__]}]); 198 | 199 | 200 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 201 | } 202 | 203 | 204 | static Future> calculateLineDistance_batch(List var0, List var1) async { 205 | if (var0.length != var1.length) { 206 | return Future.error('all args must have same length!'); 207 | } 208 | 209 | // invoke native method 210 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.CoordinateConverter::calculateLineDistance_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__], "var1": var1[__i__]}]); 211 | 212 | 213 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 214 | } 215 | 216 | //endregion 217 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/CoordinateConverter/CoordType.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum com_amap_api_location_CoordinateConverter_CoordType { 7 | BAIDU /* null */, 8 | MAPBAR /* null */, 9 | MAPABC /* null */, 10 | SOSOMAP /* null */, 11 | ALIYUN /* null */, 12 | GOOGLE /* null */, 13 | GPS /* null */ 14 | } 15 | 16 | extension com_amap_api_location_CoordinateConverter_CoordTypeToX on com_amap_api_location_CoordinateConverter_CoordType { 17 | int toValue() { 18 | switch (this) { 19 | case com_amap_api_location_CoordinateConverter_CoordType.BAIDU: return com_amap_api_location_CoordinateConverter_CoordType.BAIDU.index + 0; 20 | case com_amap_api_location_CoordinateConverter_CoordType.MAPBAR: return com_amap_api_location_CoordinateConverter_CoordType.MAPBAR.index + 0; 21 | case com_amap_api_location_CoordinateConverter_CoordType.MAPABC: return com_amap_api_location_CoordinateConverter_CoordType.MAPABC.index + 0; 22 | case com_amap_api_location_CoordinateConverter_CoordType.SOSOMAP: return com_amap_api_location_CoordinateConverter_CoordType.SOSOMAP.index + 0; 23 | case com_amap_api_location_CoordinateConverter_CoordType.ALIYUN: return com_amap_api_location_CoordinateConverter_CoordType.ALIYUN.index + 0; 24 | case com_amap_api_location_CoordinateConverter_CoordType.GOOGLE: return com_amap_api_location_CoordinateConverter_CoordType.GOOGLE.index + 0; 25 | case com_amap_api_location_CoordinateConverter_CoordType.GPS: return com_amap_api_location_CoordinateConverter_CoordType.GPS.index + 0; 26 | default: return 0; 27 | } 28 | } 29 | } 30 | 31 | extension com_amap_api_location_CoordinateConverter_CoordTypeFromX on int { 32 | com_amap_api_location_CoordinateConverter_CoordType tocom_amap_api_location_CoordinateConverter_CoordType() { 33 | switch (this) { 34 | 35 | default: return com_amap_api_location_CoordinateConverter_CoordType.values[this + 0]; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/DPoint.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class com_amap_api_location_DPoint extends java_lang_Object with android_os_Parcelable { 16 | //region constants 17 | static const String name__ = 'com.amap.api.location.DPoint'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createcom_amap_api_location_DPoint__', ); 28 | } 29 | 30 | static Future create__double__double(double var1, double var3) async { 31 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createcom_amap_api_location_DPoint__double__double', {"var1": var1, "var3": var3}); 32 | } 33 | 34 | static Future> create_batch__(int length) async { 35 | if (false) { 36 | return Future.error('all args must have same length!'); 37 | } 38 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchcom_amap_api_location_DPoint__', {'length': length}); 39 | } 40 | 41 | static Future> create_batch__double__double(List var1, List var3) async { 42 | if (var1.length != var3.length) { 43 | return Future.error('all args must have same length!'); 44 | } 45 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchcom_amap_api_location_DPoint__double__double', [for (int __i__ = 0; __i__ < var1.length; __i__++) {"var1": var1[__i__], "var3": var3[__i__]}]); 46 | } 47 | 48 | //endregion 49 | 50 | //region getters 51 | 52 | //endregion 53 | 54 | //region setters 55 | 56 | //endregion 57 | 58 | //region methods 59 | 60 | Future getLongitude() async { 61 | // print log 62 | if (fluttifyLogEnabled) { 63 | debugPrint('fluttify-dart: com.amap.api.location.DPoint@$refId::getLongitude([])'); 64 | } 65 | 66 | // invoke native method 67 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::getLongitude', {"__this__": this}); 68 | 69 | 70 | // handle native call 71 | 72 | 73 | return __result__; 74 | } 75 | 76 | 77 | Future setLongitude(double var1) async { 78 | // print log 79 | if (fluttifyLogEnabled) { 80 | debugPrint('fluttify-dart: com.amap.api.location.DPoint@$refId::setLongitude([\'var1\':$var1])'); 81 | } 82 | 83 | // invoke native method 84 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::setLongitude', {"var1": var1, "__this__": this}); 85 | 86 | 87 | // handle native call 88 | 89 | 90 | return __result__; 91 | } 92 | 93 | 94 | Future getLatitude() async { 95 | // print log 96 | if (fluttifyLogEnabled) { 97 | debugPrint('fluttify-dart: com.amap.api.location.DPoint@$refId::getLatitude([])'); 98 | } 99 | 100 | // invoke native method 101 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::getLatitude', {"__this__": this}); 102 | 103 | 104 | // handle native call 105 | 106 | 107 | return __result__; 108 | } 109 | 110 | 111 | Future setLatitude(double var1) async { 112 | // print log 113 | if (fluttifyLogEnabled) { 114 | debugPrint('fluttify-dart: com.amap.api.location.DPoint@$refId::setLatitude([\'var1\':$var1])'); 115 | } 116 | 117 | // invoke native method 118 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::setLatitude', {"var1": var1, "__this__": this}); 119 | 120 | 121 | // handle native call 122 | 123 | 124 | return __result__; 125 | } 126 | 127 | //endregion 128 | 129 | @override 130 | String toString() { 131 | return 'com_amap_api_location_DPoint{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 132 | } 133 | } 134 | 135 | extension com_amap_api_location_DPoint_Batch on List { 136 | //region getters 137 | 138 | //endregion 139 | 140 | //region setters 141 | 142 | //endregion 143 | 144 | //region methods 145 | 146 | Future> getLongitude_batch() async { 147 | if (false) { 148 | return Future.error('all args must have same length!'); 149 | } 150 | 151 | // invoke native method 152 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::getLongitude_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 153 | 154 | 155 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 156 | } 157 | 158 | 159 | Future> setLongitude_batch(List var1) async { 160 | if (false) { 161 | return Future.error('all args must have same length!'); 162 | } 163 | 164 | // invoke native method 165 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::setLongitude_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 166 | 167 | 168 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 169 | } 170 | 171 | 172 | Future> getLatitude_batch() async { 173 | if (false) { 174 | return Future.error('all args must have same length!'); 175 | } 176 | 177 | // invoke native method 178 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::getLatitude_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 179 | 180 | 181 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 182 | } 183 | 184 | 185 | Future> setLatitude_batch(List var1) async { 186 | if (false) { 187 | return Future.error('all args must have same length!'); 188 | } 189 | 190 | // invoke native method 191 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.DPoint::setLatitude_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 192 | 193 | 194 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 195 | } 196 | 197 | //endregion 198 | } -------------------------------------------------------------------------------- /lib/src/android/com/amap/api/location/UmidtokenInfo.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class com_amap_api_location_UmidtokenInfo extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'com.amap.api.location.UmidtokenInfo'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createcom_amap_api_location_UmidtokenInfo__', ); 28 | } 29 | 30 | static Future> create_batch__(int length) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchcom_amap_api_location_UmidtokenInfo__', {'length': length}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | 41 | //endregion 42 | 43 | //region setters 44 | 45 | //endregion 46 | 47 | //region methods 48 | 49 | static Future getUmidtoken() async { 50 | // print log 51 | if (fluttifyLogEnabled) { 52 | debugPrint('fluttify-dart: com.amap.api.location.UmidtokenInfo::getUmidtoken([])'); 53 | } 54 | 55 | // invoke native method 56 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.UmidtokenInfo::getUmidtoken', ); 57 | 58 | 59 | // handle native call 60 | 61 | 62 | return __result__; 63 | } 64 | 65 | 66 | static Future setLocAble(bool var0) async { 67 | // print log 68 | if (fluttifyLogEnabled) { 69 | debugPrint('fluttify-dart: com.amap.api.location.UmidtokenInfo::setLocAble([\'var0\':$var0])'); 70 | } 71 | 72 | // invoke native method 73 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.UmidtokenInfo::setLocAble', {"var0": var0}); 74 | 75 | 76 | // handle native call 77 | 78 | 79 | return __result__; 80 | } 81 | 82 | 83 | static Future setUmidtoken(android_content_Context var0, String var1) async { 84 | // print log 85 | if (fluttifyLogEnabled) { 86 | debugPrint('fluttify-dart: com.amap.api.location.UmidtokenInfo::setUmidtoken([\'var1\':$var1])'); 87 | } 88 | 89 | // invoke native method 90 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.UmidtokenInfo::setUmidtoken', {"var0": var0, "var1": var1}); 91 | 92 | 93 | // handle native call 94 | 95 | 96 | return __result__; 97 | } 98 | 99 | //endregion 100 | 101 | @override 102 | String toString() { 103 | return 'com_amap_api_location_UmidtokenInfo{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 104 | } 105 | } 106 | 107 | extension com_amap_api_location_UmidtokenInfo_Batch on List { 108 | //region getters 109 | 110 | //endregion 111 | 112 | //region setters 113 | 114 | //endregion 115 | 116 | //region methods 117 | 118 | static Future> getUmidtoken_batch() async { 119 | if (false) { 120 | return Future.error('all args must have same length!'); 121 | } 122 | 123 | // invoke native method 124 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.UmidtokenInfo::getUmidtoken_batch', ); 125 | 126 | 127 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 128 | } 129 | 130 | 131 | static Future> setLocAble_batch(List var0) async { 132 | if (false) { 133 | return Future.error('all args must have same length!'); 134 | } 135 | 136 | // invoke native method 137 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.UmidtokenInfo::setLocAble_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__]}]); 138 | 139 | 140 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 141 | } 142 | 143 | 144 | static Future> setUmidtoken_batch(List var0, List var1) async { 145 | if (var0.length != var1.length) { 146 | return Future.error('all args must have same length!'); 147 | } 148 | 149 | // invoke native method 150 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('com.amap.api.location.UmidtokenInfo::setUmidtoken_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__], "var1": var1[__i__]}]); 151 | 152 | 153 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 154 | } 155 | 156 | //endregion 157 | } -------------------------------------------------------------------------------- /lib/src/android/constants.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | import 'package:flutter/services.dart'; 6 | import '../facade/objects.g.dart'; 7 | 8 | -------------------------------------------------------------------------------- /lib/src/facade/delegates.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | part of 'amap_location.dart'; 3 | 4 | typedef void _OnAndroidLocationChanged( 5 | com_amap_api_location_AMapLocation location, 6 | ); 7 | typedef void _OnIOSLocationChanged( 8 | CLLocation location, 9 | AMapLocationReGeocode reGeocode, 10 | ); 11 | typedef void _OnRequireAlwaysAuth(CLLocationManager manager); 12 | typedef void _OnGeoFenceStatusChanged( 13 | AMapGeoFenceRegion region, 14 | String customID, 15 | NSError error, 16 | ); 17 | 18 | class _AndroidLocationDelegate extends java_lang_Object 19 | with 20 | com_amap_api_location_AMapLocationListener, 21 | com_amap_api_fence_GeoFenceListener { 22 | _OnAndroidLocationChanged _onLocationChanged; 23 | 24 | @override 25 | Future onLocationChanged( 26 | com_amap_api_location_AMapLocation var1, 27 | ) async { 28 | super.onLocationChanged(var1); 29 | if (_onLocationChanged != null) { 30 | _onLocationChanged(var1); 31 | } 32 | } 33 | 34 | @override 35 | Future onGeoFenceCreateFinished( 36 | List var1, int var2, String var3) async { 37 | super.onGeoFenceCreateFinished(var1, var2, var3); 38 | debugPrint( 39 | '围栏创建结果: $var2, ${com_amap_api_fence_GeoFence.ADDGEOFENCE_SUCCESS}'); 40 | } 41 | } 42 | 43 | class _IOSLocationDelegate extends NSObject 44 | with AMapLocationManagerDelegate, AMapGeoFenceManagerDelegate { 45 | _OnIOSLocationChanged _onLocationChanged; 46 | _OnRequireAlwaysAuth _onRequireAlwaysAuth; 47 | _OnGeoFenceStatusChanged _onGeoFenceStatusChanged; 48 | 49 | @override 50 | Future amapLocationManager_didUpdateLocation_reGeocode( 51 | AMapLocationManager manager, 52 | CLLocation location, 53 | AMapLocationReGeocode reGeocode, 54 | ) async { 55 | super.amapLocationManager_didUpdateLocation_reGeocode( 56 | manager, 57 | location, 58 | reGeocode, 59 | ); 60 | if (_onLocationChanged != null) { 61 | _onLocationChanged(location, reGeocode); 62 | } 63 | } 64 | 65 | @override 66 | Future amapLocationManager_doRequireLocationAuth( 67 | AMapLocationManager manager, 68 | CLLocationManager locationManager, 69 | ) async { 70 | super.amapLocationManager_doRequireLocationAuth(manager, locationManager); 71 | if (_onRequireAlwaysAuth != null) { 72 | _onRequireAlwaysAuth(locationManager); 73 | } 74 | } 75 | 76 | @override 77 | Future 78 | amapGeoFenceManager_didGeoFencesStatusChangedForRegion_customID_error( 79 | AMapGeoFenceManager manager, 80 | AMapGeoFenceRegion region, 81 | String customID, 82 | NSError error) async { 83 | super.amapGeoFenceManager_didGeoFencesStatusChangedForRegion_customID_error( 84 | manager, region, customID, error); 85 | if (_onGeoFenceStatusChanged != null) { 86 | _onGeoFenceStatusChanged(region, customID, error); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/src/facade/enums.dart: -------------------------------------------------------------------------------- 1 | /// 定位模式 2 | enum LocationAccuracy { 3 | /// 高 4 | High, 5 | 6 | /// 低 7 | Low, 8 | 9 | /// 设备传感器 仅android 10 | DeviceSensor, 11 | } 12 | 13 | /// 电子围栏激活动作 14 | enum GeoFenceActiveAction { 15 | In, 16 | Out, 17 | Stayed, 18 | } 19 | 20 | /// 电子围栏状态 21 | enum GeoFenceStatus { 22 | Unknown, 23 | In, 24 | Out, 25 | Stayed, 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/facade/extensions.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 3 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | 6 | import 'enums.dart'; 7 | 8 | extension AMapGeoFenceManagerX on AMapGeoFenceManager { 9 | // 由于ios端的枚举实际上是由int构成的, 所以枚举值拿来`或`, 但是dart这边枚举就是枚举, 或了之后就只能是int了 10 | // 这里需要加一个传递int值的相同方法 11 | Future set_activeActionX(int activeAction) async { 12 | await kAmapLocationFluttifyChannel.invokeMethod( 13 | 'AMapGeoFenceManager::set_activeAction', 14 | {'__this__': this, "activeAction": activeAction}, 15 | ); 16 | } 17 | } 18 | 19 | extension GeoFenceStatusX on GeoFenceStatus { 20 | static GeoFenceStatus fromAndroid(int androidModel) { 21 | return GeoFenceStatus.values[androidModel]; 22 | } 23 | 24 | static GeoFenceStatus fromIOS(AMapGeoFenceRegionStatus iosModel) { 25 | switch (iosModel) { 26 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusUnknown: 27 | return GeoFenceStatus.Unknown; 28 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusInside: 29 | return GeoFenceStatus.In; 30 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusOutside: 31 | return GeoFenceStatus.Out; 32 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusStayed: 33 | return GeoFenceStatus.Stayed; 34 | default: 35 | return GeoFenceStatus.Unknown; 36 | } 37 | } 38 | } 39 | 40 | extension com_amap_api_fence_GeoFenceClient_X 41 | on com_amap_api_fence_GeoFenceClient { 42 | Future addCircleGeoFence( 43 | int activeAction, 44 | com_amap_api_location_DPoint center, 45 | double radius, 46 | String customId, 47 | ) async { 48 | await kAmapLocationFluttifyChannel.invokeMethod( 49 | 'com.amap.api.fence.GeoFenceClient::addCircleGeoFenceX', 50 | { 51 | '__this__': this, 52 | 'activeAction': activeAction, 53 | 'center': center, 54 | 'radius': radius, 55 | 'customId': customId, 56 | }, 57 | ); 58 | } 59 | 60 | Future addPoiGeoFence({ 61 | @required String keyword, 62 | String poiType, 63 | String city, 64 | int aroundRadius, 65 | String customId = '', 66 | int activeAction, 67 | }) async { 68 | await kAmapLocationFluttifyChannel.invokeMethod( 69 | 'com.amap.api.fence.GeoFenceClient::addPoiGeoFenceX', 70 | { 71 | '__this__': this, 72 | 'activeAction': activeAction, 73 | 'keyword': keyword, 74 | 'poiType': poiType, 75 | 'city': city, 76 | 'size': aroundRadius, 77 | 'customId': customId, 78 | }, 79 | ); 80 | } 81 | 82 | Future addPolygonGeoFence({ 83 | @required List polygon, 84 | String customId = '', 85 | int activeAction, 86 | }) async { 87 | await kAmapLocationFluttifyChannel.invokeMethod( 88 | 'com.amap.api.fence.GeoFenceClient::addPolygonGeoFenceX', 89 | { 90 | '__this__': this, 91 | 'polygon': polygon, 92 | 'customId': customId, 93 | 'activeAction': activeAction, 94 | }, 95 | ); 96 | } 97 | 98 | Future addDistrictGeoFence({ 99 | @required String keyword, 100 | String customId = '', 101 | @required int activeAction, 102 | }) async { 103 | await kAmapLocationFluttifyChannel.invokeMethod( 104 | 'com.amap.api.fence.GeoFenceClient::addDistrictGeoFenceX', 105 | { 106 | '__this__': this, 107 | 'keyword': keyword, 108 | 'customId': customId, 109 | 'activeAction': activeAction, 110 | }, 111 | ); 112 | } 113 | } 114 | 115 | extension ListX on List { 116 | int getActiveAction() { 117 | debugPrint('激活动作: $this'); 118 | int activeAction = 0; 119 | if (contains(GeoFenceActiveAction.In)) { 120 | activeAction |= com_amap_api_fence_GeoFenceClient.GEOFENCE_IN; 121 | } 122 | if (contains(GeoFenceActiveAction.Out)) { 123 | activeAction |= com_amap_api_fence_GeoFenceClient.GEOFENCE_OUT; 124 | } 125 | if (contains(GeoFenceActiveAction.Stayed)) { 126 | activeAction |= com_amap_api_fence_GeoFenceClient.GEOFENCE_STAYED; 127 | } 128 | debugPrint('激活动作解析结果: $activeAction'); 129 | return activeAction; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /lib/src/facade/models.dart: -------------------------------------------------------------------------------- 1 | import 'package:amap_core_fluttify/amap_core_fluttify.dart'; 2 | import 'package:amap_location_fluttify/amap_location_fluttify.dart'; 3 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 4 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | 7 | /// 定位结果 model 8 | class Location { 9 | Location({ 10 | @required this.address, 11 | @required this.latLng, 12 | @required this.altitude, 13 | @required this.bearing, 14 | @required this.country, 15 | @required this.province, 16 | @required this.city, 17 | @required this.cityCode, 18 | @required this.adCode, 19 | @required this.district, 20 | @required this.poiName, 21 | @required this.street, 22 | @required this.streetNumber, 23 | @required this.aoiName, 24 | @required this.accuracy, 25 | @required this.speed, 26 | }); 27 | 28 | /// 地址全称 29 | String address; 30 | 31 | /// 经纬度 32 | LatLng latLng; 33 | 34 | /// 海拔 35 | double altitude; 36 | 37 | /// 设备朝向/移动方向 38 | double bearing; 39 | 40 | /// 国家 41 | String country; 42 | 43 | /// 省份 44 | String province; 45 | 46 | /// 城市 47 | String city; 48 | 49 | /// 城市编号 50 | String cityCode; 51 | 52 | /// 邮编 53 | String adCode; 54 | 55 | /// 区域 56 | String district; 57 | 58 | /// poi名称 59 | String poiName; 60 | 61 | /// 街道 62 | String street; 63 | 64 | /// 街道号 65 | String streetNumber; 66 | 67 | /// aoi名称 68 | String aoiName; 69 | 70 | /// 精度 71 | double accuracy; 72 | 73 | /// 速度 74 | double speed; 75 | 76 | @override 77 | String toString() { 78 | return 'Location{\naddress: $address, \nlatLng: ${latLng.latitude}, ${latLng.longitude}, \naltitude: $altitude, \nbearing: $bearing, \ncountry: $country, \nprovince: $province, \ncity: $city, \ncityCode: $cityCode, \nadCode: $adCode, \ndistrict: $district, \npoiName: $poiName, \nstreet: $street, \nstreetNumber: $streetNumber, \naoiName: $aoiName, \naccuracy: $accuracy\n}'; 79 | } 80 | } 81 | 82 | /// 后台定位notification 83 | class BackgroundNotification { 84 | BackgroundNotification({ 85 | @required this.contentTitle, 86 | @required this.contentText, 87 | this.when, 88 | @required this.channelId, 89 | @required this.channelName, 90 | this.enableLights = true, 91 | this.showBadge = true, 92 | }); 93 | 94 | String contentTitle; 95 | String contentText; 96 | int when; 97 | String channelId; 98 | String channelName; 99 | bool enableLights; 100 | bool showBadge; 101 | } 102 | 103 | class GeoFenceEvent { 104 | final String customId; 105 | final String fenceId; 106 | final GeoFenceStatus status; 107 | final GeoFence genFence; 108 | 109 | GeoFenceEvent({ 110 | this.customId, 111 | this.fenceId, 112 | this.status, 113 | this.genFence, 114 | }); 115 | 116 | @override 117 | String toString() { 118 | return 'GeoFenceEvent{customId: $customId, fenceId: $fenceId, status: $status, genFence: $genFence}'; 119 | } 120 | } 121 | 122 | class GeoFence { 123 | final com_amap_api_fence_GeoFence androidModel; 124 | final AMapGeoFenceRegion iosModel; 125 | 126 | GeoFence.android(this.androidModel) : this.iosModel = null; 127 | 128 | GeoFence.ios(this.iosModel) : this.androidModel = null; 129 | 130 | Future get customId async { 131 | return platform( 132 | android: (pool) => androidModel.getCustomId(), 133 | ios: (pool) => iosModel.get_customID(), 134 | ); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /lib/src/facade/objects.g.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 3 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 4 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 5 | 6 | const kAmapLocationFluttifyMessageCodec = FluttifyMessageCodec(tag: 'amap_location_fluttify', androidCaster: AmapLocationFluttifyAndroidAs, iosCaster: AmapLocationFluttifyIOSAs); 7 | const kAmapLocationFluttifyMethodCodec = StandardMethodCodec(kAmapLocationFluttifyMessageCodec); 8 | const kAmapLocationFluttifyChannel = MethodChannel('me.yohom/amap_location_fluttify', kAmapLocationFluttifyMethodCodec); 9 | const kAmapLocationFluttifyProjectName = 'amap_location_fluttify'; -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceActiveAction.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapGeoFenceActiveAction { 7 | AMapGeoFenceActiveActionNone /* 0 */, 8 | AMapGeoFenceActiveActionInside /* 1<<0 */, 9 | AMapGeoFenceActiveActionOutside /* 1<<1 */, 10 | AMapGeoFenceActiveActionStayed /* 1<<2 */ 11 | } 12 | 13 | extension AMapGeoFenceActiveActionToX on AMapGeoFenceActiveAction { 14 | int toValue() { 15 | switch (this) { 16 | case AMapGeoFenceActiveAction.AMapGeoFenceActiveActionNone: return 0; 17 | case AMapGeoFenceActiveAction.AMapGeoFenceActiveActionInside: return 1<<0; 18 | case AMapGeoFenceActiveAction.AMapGeoFenceActiveActionOutside: return 1<<1; 19 | case AMapGeoFenceActiveAction.AMapGeoFenceActiveActionStayed: return 1<<2; 20 | default: return 0; 21 | } 22 | } 23 | } 24 | 25 | extension AMapGeoFenceActiveActionFromX on int { 26 | AMapGeoFenceActiveAction toAMapGeoFenceActiveAction() { 27 | switch (this) { 28 | case 0: return AMapGeoFenceActiveAction.AMapGeoFenceActiveActionNone; 29 | case 1<<0: return AMapGeoFenceActiveAction.AMapGeoFenceActiveActionInside; 30 | case 1<<1: return AMapGeoFenceActiveAction.AMapGeoFenceActiveActionOutside; 31 | case 1<<2: return AMapGeoFenceActiveAction.AMapGeoFenceActiveActionStayed; 32 | default: return AMapGeoFenceActiveAction.values[this + 0]; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceCircleRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapGeoFenceCircleRegion extends AMapGeoFenceRegion with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapGeoFenceCircleRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapGeoFenceCircleRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapGeoFenceCircleRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_center() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceCircleRegion::get_center", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | Future get_radius() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceCircleRegion::get_radius", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | //endregion 51 | 52 | //region setters 53 | 54 | //endregion 55 | 56 | //region methods 57 | 58 | //endregion 59 | 60 | @override 61 | String toString() { 62 | return 'AMapGeoFenceCircleRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 63 | } 64 | } 65 | 66 | extension AMapGeoFenceCircleRegion_Batch on List { 67 | //region getters 68 | Future> get_center_batch() async { 69 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceCircleRegion::get_center_batch", [for (final __item__ in this) {'__this__': __item__}]); 70 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 71 | } 72 | 73 | Future> get_radius_batch() async { 74 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceCircleRegion::get_radius_batch", [for (final __item__ in this) {'__this__': __item__}]); 75 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 76 | } 77 | 78 | //endregion 79 | 80 | //region setters 81 | 82 | //endregion 83 | 84 | //region methods 85 | 86 | //endregion 87 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceDistrictRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapGeoFenceDistrictRegion extends AMapGeoFenceRegion with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapGeoFenceDistrictRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapGeoFenceDistrictRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapGeoFenceDistrictRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_districtItem() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceDistrictRegion::get_districtItem", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | //endregion 46 | 47 | //region setters 48 | 49 | //endregion 50 | 51 | //region methods 52 | 53 | //endregion 54 | 55 | @override 56 | String toString() { 57 | return 'AMapGeoFenceDistrictRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 58 | } 59 | } 60 | 61 | extension AMapGeoFenceDistrictRegion_Batch on List { 62 | //region getters 63 | Future> get_districtItem_batch() async { 64 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceDistrictRegion::get_districtItem_batch", [for (final __item__ in this) {'__this__': __item__}]); 65 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 66 | } 67 | 68 | //endregion 69 | 70 | //region setters 71 | 72 | //endregion 73 | 74 | //region methods 75 | 76 | //endregion 77 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceErrorCode.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapGeoFenceErrorCode { 7 | AMapGeoFenceErrorUnknown /* 1 */, 8 | AMapGeoFenceErrorInvalidParameter /* 2 */, 9 | AMapGeoFenceErrorFailureConnection /* 3 */, 10 | AMapGeoFenceErrorFailureAuth /* 4 */, 11 | AMapGeoFenceErrorNoValidFence /* 5 */, 12 | AMapGeoFenceErroFailureLocating /* 6 */ 13 | } 14 | 15 | extension AMapGeoFenceErrorCodeToX on AMapGeoFenceErrorCode { 16 | int toValue() { 17 | switch (this) { 18 | case AMapGeoFenceErrorCode.AMapGeoFenceErrorUnknown: return 1; 19 | case AMapGeoFenceErrorCode.AMapGeoFenceErrorInvalidParameter: return 2; 20 | case AMapGeoFenceErrorCode.AMapGeoFenceErrorFailureConnection: return 3; 21 | case AMapGeoFenceErrorCode.AMapGeoFenceErrorFailureAuth: return 4; 22 | case AMapGeoFenceErrorCode.AMapGeoFenceErrorNoValidFence: return 5; 23 | case AMapGeoFenceErrorCode.AMapGeoFenceErroFailureLocating: return 6; 24 | default: return 0; 25 | } 26 | } 27 | } 28 | 29 | extension AMapGeoFenceErrorCodeFromX on int { 30 | AMapGeoFenceErrorCode toAMapGeoFenceErrorCode() { 31 | switch (this) { 32 | case 1: return AMapGeoFenceErrorCode.AMapGeoFenceErrorUnknown; 33 | case 2: return AMapGeoFenceErrorCode.AMapGeoFenceErrorInvalidParameter; 34 | case 3: return AMapGeoFenceErrorCode.AMapGeoFenceErrorFailureConnection; 35 | case 4: return AMapGeoFenceErrorCode.AMapGeoFenceErrorFailureAuth; 36 | case 5: return AMapGeoFenceErrorCode.AMapGeoFenceErrorNoValidFence; 37 | case 6: return AMapGeoFenceErrorCode.AMapGeoFenceErroFailureLocating; 38 | default: return AMapGeoFenceErrorCode.values[this + 1]; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceManagerDelegate.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | 16 | 17 | mixin AMapGeoFenceManagerDelegate on NSObject { 18 | 19 | 20 | 21 | 22 | @override 23 | final String tag__ = 'amap_location_fluttify'; 24 | 25 | 26 | 27 | 28 | 29 | @mustCallSuper 30 | Future amapGeoFenceManager_doRequireLocationAuth(AMapGeoFenceManager manager, CLLocationManager locationManager) {} 31 | 32 | @mustCallSuper 33 | Future amapGeoFenceManager_didAddRegionForMonitoringFinished_customID_error(AMapGeoFenceManager manager, List regions, String customID, NSError error) {} 34 | 35 | @mustCallSuper 36 | Future amapGeoFenceManager_didGeoFencesStatusChangedForRegion_customID_error(AMapGeoFenceManager manager, AMapGeoFenceRegion region, String customID, NSError error) {} 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFencePOIRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapGeoFencePOIRegion extends AMapGeoFenceCircleRegion with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapGeoFencePOIRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapGeoFencePOIRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapGeoFencePOIRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_POIItem() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFencePOIRegion::get_POIItem", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | //endregion 46 | 47 | //region setters 48 | 49 | //endregion 50 | 51 | //region methods 52 | 53 | //endregion 54 | 55 | @override 56 | String toString() { 57 | return 'AMapGeoFencePOIRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 58 | } 59 | } 60 | 61 | extension AMapGeoFencePOIRegion_Batch on List { 62 | //region getters 63 | Future> get_POIItem_batch() async { 64 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFencePOIRegion::get_POIItem_batch", [for (final __item__ in this) {'__this__': __item__}]); 65 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 66 | } 67 | 68 | //endregion 69 | 70 | //region setters 71 | 72 | //endregion 73 | 74 | //region methods 75 | 76 | //endregion 77 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFencePolygonRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapGeoFencePolygonRegion extends AMapGeoFenceRegion with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapGeoFencePolygonRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapGeoFencePolygonRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapGeoFencePolygonRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future> get_coordinates() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFencePolygonRegion::get_coordinates", {'__this__': this}); 42 | return (__result__ as List)?.cast(); 43 | } 44 | 45 | Future get_count() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFencePolygonRegion::get_count", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | //endregion 51 | 52 | //region setters 53 | 54 | //endregion 55 | 56 | //region methods 57 | 58 | //endregion 59 | 60 | @override 61 | String toString() { 62 | return 'AMapGeoFencePolygonRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 63 | } 64 | } 65 | 66 | extension AMapGeoFencePolygonRegion_Batch on List { 67 | //region getters 68 | Future>> get_coordinates_batch() async { 69 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFencePolygonRegion::get_coordinates_batch", [for (final __item__ in this) {'__this__': __item__}]); 70 | return (resultBatch as List).cast>().map((__result__) => (__result__ as List)?.cast()).toList(); 71 | } 72 | 73 | Future> get_count_batch() async { 74 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFencePolygonRegion::get_count_batch", [for (final __item__ in this) {'__this__': __item__}]); 75 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 76 | } 77 | 78 | //endregion 79 | 80 | //region setters 81 | 82 | //endregion 83 | 84 | //region methods 85 | 86 | //endregion 87 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapGeoFenceRegion extends NSObject with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapGeoFenceRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapGeoFenceRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapGeoFenceRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_identifier() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_identifier", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | Future get_customID() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_customID", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | Future get_fenceStatus() async { 51 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_fenceStatus", {'__this__': this}); 52 | return (__result__ as int).toAMapGeoFenceRegionStatus(); 53 | } 54 | 55 | Future get_regionType() async { 56 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_regionType", {'__this__': this}); 57 | return (__result__ as int).toAMapGeoFenceRegionType(); 58 | } 59 | 60 | Future get_currentLocation() async { 61 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_currentLocation", {'__this__': this}); 62 | return __result__; 63 | } 64 | 65 | //endregion 66 | 67 | //region setters 68 | Future set_fenceStatus(AMapGeoFenceRegionStatus fenceStatus) async { 69 | await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceRegion::set_fenceStatus', {'__this__': this, "fenceStatus": fenceStatus.toValue()}); 70 | 71 | 72 | } 73 | 74 | Future set_regionType(AMapGeoFenceRegionType regionType) async { 75 | await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceRegion::set_regionType', {'__this__': this, "regionType": regionType.toValue()}); 76 | 77 | 78 | } 79 | 80 | Future set_currentLocation(CLLocation currentLocation) async { 81 | await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceRegion::set_currentLocation', {'__this__': this, "currentLocation": currentLocation}); 82 | 83 | 84 | } 85 | 86 | //endregion 87 | 88 | //region methods 89 | 90 | //endregion 91 | 92 | @override 93 | String toString() { 94 | return 'AMapGeoFenceRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 95 | } 96 | } 97 | 98 | extension AMapGeoFenceRegion_Batch on List { 99 | //region getters 100 | Future> get_identifier_batch() async { 101 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_identifier_batch", [for (final __item__ in this) {'__this__': __item__}]); 102 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 103 | } 104 | 105 | Future> get_customID_batch() async { 106 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_customID_batch", [for (final __item__ in this) {'__this__': __item__}]); 107 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 108 | } 109 | 110 | Future> get_fenceStatus_batch() async { 111 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_fenceStatus_batch", [for (final __item__ in this) {'__this__': __item__}]); 112 | return (resultBatch as List).cast().map((__result__) => (__result__ as int).toAMapGeoFenceRegionStatus()).toList(); 113 | } 114 | 115 | Future> get_regionType_batch() async { 116 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_regionType_batch", [for (final __item__ in this) {'__this__': __item__}]); 117 | return (resultBatch as List).cast().map((__result__) => (__result__ as int).toAMapGeoFenceRegionType()).toList(); 118 | } 119 | 120 | Future> get_currentLocation_batch() async { 121 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapGeoFenceRegion::get_currentLocation_batch", [for (final __item__ in this) {'__this__': __item__}]); 122 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 123 | } 124 | 125 | //endregion 126 | 127 | //region setters 128 | Future set_fenceStatus_batch(List fenceStatus) async { 129 | await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceRegion::set_fenceStatus_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "fenceStatus": fenceStatus[__i__].toValue()}]); 130 | 131 | 132 | } 133 | 134 | Future set_regionType_batch(List regionType) async { 135 | await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceRegion::set_regionType_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "regionType": regionType[__i__].toValue()}]); 136 | 137 | 138 | } 139 | 140 | Future set_currentLocation_batch(List currentLocation) async { 141 | await kAmapLocationFluttifyChannel.invokeMethod('AMapGeoFenceRegion::set_currentLocation_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "currentLocation": currentLocation[__i__]}]); 142 | 143 | 144 | } 145 | 146 | //endregion 147 | 148 | //region methods 149 | 150 | //endregion 151 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceRegionActiveStatus.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapGeoFenceRegionActiveStatus { 7 | AMapGeoFenceRegionActiveUNMonitor /* 0 */, 8 | AMapGeoFenceRegionActiveMonitoring /* 1<<0 */, 9 | AMapGeoFenceRegionActivePaused /* 1<<1 */ 10 | } 11 | 12 | extension AMapGeoFenceRegionActiveStatusToX on AMapGeoFenceRegionActiveStatus { 13 | int toValue() { 14 | switch (this) { 15 | case AMapGeoFenceRegionActiveStatus.AMapGeoFenceRegionActiveUNMonitor: return 0; 16 | case AMapGeoFenceRegionActiveStatus.AMapGeoFenceRegionActiveMonitoring: return 1<<0; 17 | case AMapGeoFenceRegionActiveStatus.AMapGeoFenceRegionActivePaused: return 1<<1; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension AMapGeoFenceRegionActiveStatusFromX on int { 24 | AMapGeoFenceRegionActiveStatus toAMapGeoFenceRegionActiveStatus() { 25 | switch (this) { 26 | case 0: return AMapGeoFenceRegionActiveStatus.AMapGeoFenceRegionActiveUNMonitor; 27 | case 1<<0: return AMapGeoFenceRegionActiveStatus.AMapGeoFenceRegionActiveMonitoring; 28 | case 1<<1: return AMapGeoFenceRegionActiveStatus.AMapGeoFenceRegionActivePaused; 29 | default: return AMapGeoFenceRegionActiveStatus.values[this + 0]; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceRegionStatus.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapGeoFenceRegionStatus { 7 | AMapGeoFenceRegionStatusUnknown /* 0 */, 8 | AMapGeoFenceRegionStatusInside /* 1 */, 9 | AMapGeoFenceRegionStatusOutside /* 2 */, 10 | AMapGeoFenceRegionStatusStayed /* 3 */ 11 | } 12 | 13 | extension AMapGeoFenceRegionStatusToX on AMapGeoFenceRegionStatus { 14 | int toValue() { 15 | switch (this) { 16 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusUnknown: return 0; 17 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusInside: return 1; 18 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusOutside: return 2; 19 | case AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusStayed: return 3; 20 | default: return 0; 21 | } 22 | } 23 | } 24 | 25 | extension AMapGeoFenceRegionStatusFromX on int { 26 | AMapGeoFenceRegionStatus toAMapGeoFenceRegionStatus() { 27 | switch (this) { 28 | case 0: return AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusUnknown; 29 | case 1: return AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusInside; 30 | case 2: return AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusOutside; 31 | case 3: return AMapGeoFenceRegionStatus.AMapGeoFenceRegionStatusStayed; 32 | default: return AMapGeoFenceRegionStatus.values[this + 0]; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapGeoFenceRegionType.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapGeoFenceRegionType { 7 | AMapGeoFenceRegionTypeCircle /* 0 */, 8 | AMapGeoFenceRegionTypePolygon /* 1 */, 9 | AMapGeoFenceRegionTypePOI /* 2 */, 10 | AMapGeoFenceRegionTypeDistrict /* 3 */ 11 | } 12 | 13 | extension AMapGeoFenceRegionTypeToX on AMapGeoFenceRegionType { 14 | int toValue() { 15 | switch (this) { 16 | case AMapGeoFenceRegionType.AMapGeoFenceRegionTypeCircle: return 0; 17 | case AMapGeoFenceRegionType.AMapGeoFenceRegionTypePolygon: return 1; 18 | case AMapGeoFenceRegionType.AMapGeoFenceRegionTypePOI: return 2; 19 | case AMapGeoFenceRegionType.AMapGeoFenceRegionTypeDistrict: return 3; 20 | default: return 0; 21 | } 22 | } 23 | } 24 | 25 | extension AMapGeoFenceRegionTypeFromX on int { 26 | AMapGeoFenceRegionType toAMapGeoFenceRegionType() { 27 | switch (this) { 28 | case 0: return AMapGeoFenceRegionType.AMapGeoFenceRegionTypeCircle; 29 | case 1: return AMapGeoFenceRegionType.AMapGeoFenceRegionTypePolygon; 30 | case 2: return AMapGeoFenceRegionType.AMapGeoFenceRegionTypePOI; 31 | case 3: return AMapGeoFenceRegionType.AMapGeoFenceRegionTypeDistrict; 32 | default: return AMapGeoFenceRegionType.values[this + 0]; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationCircleRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapLocationCircleRegion extends AMapLocationRegion with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapLocationCircleRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapLocationCircleRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapLocationCircleRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_center() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationCircleRegion::get_center", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | Future get_radius() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationCircleRegion::get_radius", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | //endregion 51 | 52 | //region setters 53 | 54 | //endregion 55 | 56 | //region methods 57 | 58 | Future initWithCenter_radius_identifier(CLLocationCoordinate2D center, double radius, String identifier) async { 59 | // print log 60 | if (fluttifyLogEnabled) { 61 | debugPrint('fluttify-dart: AMapLocationCircleRegion@$refId::initWithCenter([\'radius\':$radius, \'identifier\':$identifier])'); 62 | } 63 | 64 | // invoke native method 65 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationCircleRegion::initWithCenter_radius_identifier', {"center": center, "radius": radius, "identifier": identifier, "__this__": this}); 66 | 67 | 68 | // handle native call 69 | 70 | 71 | return __result__; 72 | } 73 | 74 | //endregion 75 | 76 | @override 77 | String toString() { 78 | return 'AMapLocationCircleRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 79 | } 80 | } 81 | 82 | extension AMapLocationCircleRegion_Batch on List { 83 | //region getters 84 | Future> get_center_batch() async { 85 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationCircleRegion::get_center_batch", [for (final __item__ in this) {'__this__': __item__}]); 86 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 87 | } 88 | 89 | Future> get_radius_batch() async { 90 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationCircleRegion::get_radius_batch", [for (final __item__ in this) {'__this__': __item__}]); 91 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 92 | } 93 | 94 | //endregion 95 | 96 | //region setters 97 | 98 | //endregion 99 | 100 | //region methods 101 | 102 | Future> initWithCenter_radius_identifier_batch(List center, List radius, List identifier) async { 103 | if (center.length != radius.length || radius.length != identifier.length) { 104 | return Future.error('all args must have same length!'); 105 | } 106 | 107 | // invoke native method 108 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationCircleRegion::initWithCenter_radius_identifier_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"center": center[__i__], "radius": radius[__i__], "identifier": identifier[__i__], "__this__": this[__i__]}]); 109 | 110 | 111 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 112 | } 113 | 114 | //endregion 115 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationCoordinateType.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapLocationCoordinateType { 7 | AMapLocationCoordinateTypeBaidu /* 0 */, 8 | AMapLocationCoordinateTypeMapBar /* null */, 9 | AMapLocationCoordinateTypeMapABC /* null */, 10 | AMapLocationCoordinateTypeSoSoMap /* null */, 11 | AMapLocationCoordinateTypeAliYun /* null */, 12 | AMapLocationCoordinateTypeGoogle /* null */, 13 | AMapLocationCoordinateTypeGPS /* null */ 14 | } 15 | 16 | extension AMapLocationCoordinateTypeToX on AMapLocationCoordinateType { 17 | int toValue() { 18 | switch (this) { 19 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeBaidu: return 0; 20 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeMapBar: return AMapLocationCoordinateType.AMapLocationCoordinateTypeMapBar.index + 0; 21 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeMapABC: return AMapLocationCoordinateType.AMapLocationCoordinateTypeMapABC.index + 0; 22 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeSoSoMap: return AMapLocationCoordinateType.AMapLocationCoordinateTypeSoSoMap.index + 0; 23 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeAliYun: return AMapLocationCoordinateType.AMapLocationCoordinateTypeAliYun.index + 0; 24 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeGoogle: return AMapLocationCoordinateType.AMapLocationCoordinateTypeGoogle.index + 0; 25 | case AMapLocationCoordinateType.AMapLocationCoordinateTypeGPS: return AMapLocationCoordinateType.AMapLocationCoordinateTypeGPS.index + 0; 26 | default: return 0; 27 | } 28 | } 29 | } 30 | 31 | extension AMapLocationCoordinateTypeFromX on int { 32 | AMapLocationCoordinateType toAMapLocationCoordinateType() { 33 | switch (this) { 34 | case 0: return AMapLocationCoordinateType.AMapLocationCoordinateTypeBaidu; 35 | default: return AMapLocationCoordinateType.values[this + 0]; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationDistrictItem.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapLocationDistrictItem extends NSObject with NSCoding, NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapLocationDistrictItem'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapLocationDistrictItem', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapLocationDistrictItem', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_cityCode() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationDistrictItem::get_cityCode", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | //endregion 46 | 47 | //region setters 48 | Future set_cityCode(String cityCode) async { 49 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationDistrictItem::set_cityCode', {'__this__': this, "cityCode": cityCode}); 50 | 51 | 52 | } 53 | 54 | //endregion 55 | 56 | //region methods 57 | 58 | //endregion 59 | 60 | @override 61 | String toString() { 62 | return 'AMapLocationDistrictItem{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 63 | } 64 | } 65 | 66 | extension AMapLocationDistrictItem_Batch on List { 67 | //region getters 68 | Future> get_cityCode_batch() async { 69 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationDistrictItem::get_cityCode_batch", [for (final __item__ in this) {'__this__': __item__}]); 70 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 71 | } 72 | 73 | //endregion 74 | 75 | //region setters 76 | Future set_cityCode_batch(List cityCode) async { 77 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationDistrictItem::set_cityCode_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "cityCode": cityCode[__i__]}]); 78 | 79 | 80 | } 81 | 82 | //endregion 83 | 84 | //region methods 85 | 86 | //endregion 87 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationErrorCode.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapLocationErrorCode { 7 | AMapLocationErrorUnknown /* 1 */, 8 | AMapLocationErrorLocateFailed /* 2 */, 9 | AMapLocationErrorReGeocodeFailed /* 3 */, 10 | AMapLocationErrorTimeOut /* 4 */, 11 | AMapLocationErrorCanceled /* 5 */, 12 | AMapLocationErrorCannotFindHost /* 6 */, 13 | AMapLocationErrorBadURL /* 7 */, 14 | AMapLocationErrorNotConnectedToInternet /* 8 */, 15 | AMapLocationErrorCannotConnectToHost /* 9 */, 16 | AMapLocationErrorRegionMonitoringFailure /* 10 */, 17 | AMapLocationErrorRiskOfFakeLocation /* 11 */ 18 | } 19 | 20 | extension AMapLocationErrorCodeToX on AMapLocationErrorCode { 21 | int toValue() { 22 | switch (this) { 23 | case AMapLocationErrorCode.AMapLocationErrorUnknown: return 1; 24 | case AMapLocationErrorCode.AMapLocationErrorLocateFailed: return 2; 25 | case AMapLocationErrorCode.AMapLocationErrorReGeocodeFailed: return 3; 26 | case AMapLocationErrorCode.AMapLocationErrorTimeOut: return 4; 27 | case AMapLocationErrorCode.AMapLocationErrorCanceled: return 5; 28 | case AMapLocationErrorCode.AMapLocationErrorCannotFindHost: return 6; 29 | case AMapLocationErrorCode.AMapLocationErrorBadURL: return 7; 30 | case AMapLocationErrorCode.AMapLocationErrorNotConnectedToInternet: return 8; 31 | case AMapLocationErrorCode.AMapLocationErrorCannotConnectToHost: return 9; 32 | case AMapLocationErrorCode.AMapLocationErrorRegionMonitoringFailure: return 10; 33 | case AMapLocationErrorCode.AMapLocationErrorRiskOfFakeLocation: return 11; 34 | default: return 0; 35 | } 36 | } 37 | } 38 | 39 | extension AMapLocationErrorCodeFromX on int { 40 | AMapLocationErrorCode toAMapLocationErrorCode() { 41 | switch (this) { 42 | case 1: return AMapLocationErrorCode.AMapLocationErrorUnknown; 43 | case 2: return AMapLocationErrorCode.AMapLocationErrorLocateFailed; 44 | case 3: return AMapLocationErrorCode.AMapLocationErrorReGeocodeFailed; 45 | case 4: return AMapLocationErrorCode.AMapLocationErrorTimeOut; 46 | case 5: return AMapLocationErrorCode.AMapLocationErrorCanceled; 47 | case 6: return AMapLocationErrorCode.AMapLocationErrorCannotFindHost; 48 | case 7: return AMapLocationErrorCode.AMapLocationErrorBadURL; 49 | case 8: return AMapLocationErrorCode.AMapLocationErrorNotConnectedToInternet; 50 | case 9: return AMapLocationErrorCode.AMapLocationErrorCannotConnectToHost; 51 | case 10: return AMapLocationErrorCode.AMapLocationErrorRegionMonitoringFailure; 52 | case 11: return AMapLocationErrorCode.AMapLocationErrorRiskOfFakeLocation; 53 | default: return AMapLocationErrorCode.values[this + 1]; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationManagerDelegate.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | 16 | 17 | mixin AMapLocationManagerDelegate on NSObject { 18 | 19 | 20 | 21 | 22 | @override 23 | final String tag__ = 'amap_location_fluttify'; 24 | 25 | 26 | 27 | 28 | 29 | @mustCallSuper 30 | Future amapLocationManager_doRequireLocationAuth(AMapLocationManager manager, CLLocationManager locationManager) {} 31 | 32 | @mustCallSuper 33 | Future amapLocationManager_didFailWithError(AMapLocationManager manager, NSError error) {} 34 | 35 | @mustCallSuper 36 | Future amapLocationManager_didUpdateLocation(AMapLocationManager manager, CLLocation location) {} 37 | 38 | @mustCallSuper 39 | Future amapLocationManager_didUpdateLocation_reGeocode(AMapLocationManager manager, CLLocation location, AMapLocationReGeocode reGeocode) {} 40 | 41 | @mustCallSuper 42 | Future amapLocationManager_didChangeAuthorizationStatus(AMapLocationManager manager, CLAuthorizationStatus status) {} 43 | 44 | @mustCallSuper 45 | Future amapLocationManagerShouldDisplayHeadingCalibration(AMapLocationManager manager) {} 46 | 47 | @mustCallSuper 48 | Future amapLocationManager_didUpdateHeading(AMapLocationManager manager, CLHeading newHeading) {} 49 | 50 | @mustCallSuper 51 | Future amapLocationManager_didStartMonitoringForRegion(AMapLocationManager manager, AMapLocationRegion region) {} 52 | 53 | @mustCallSuper 54 | Future amapLocationManager_didEnterRegion(AMapLocationManager manager, AMapLocationRegion region) {} 55 | 56 | @mustCallSuper 57 | Future amapLocationManager_didExitRegion(AMapLocationManager manager, AMapLocationRegion region) {} 58 | 59 | @mustCallSuper 60 | Future amapLocationManager_didDetermineState_forRegion(AMapLocationManager manager, AMapLocationRegionState state, AMapLocationRegion region) {} 61 | 62 | @mustCallSuper 63 | Future amapLocationManager_monitoringDidFailForRegion_withError(AMapLocationManager manager, AMapLocationRegion region, NSError error) {} 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationPoint.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapLocationPoint extends NSObject with NSCoding, NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapLocationPoint'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapLocationPoint', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapLocationPoint', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_latitude() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPoint::get_latitude", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | Future get_longitude() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPoint::get_longitude", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | //endregion 51 | 52 | //region setters 53 | Future set_latitude(double latitude) async { 54 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPoint::set_latitude', {'__this__': this, "latitude": latitude}); 55 | 56 | 57 | } 58 | 59 | Future set_longitude(double longitude) async { 60 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPoint::set_longitude', {'__this__': this, "longitude": longitude}); 61 | 62 | 63 | } 64 | 65 | //endregion 66 | 67 | //region methods 68 | 69 | static Future locationWithLatitude_longitude(double lat, double lon) async { 70 | // print log 71 | if (fluttifyLogEnabled) { 72 | debugPrint('fluttify-dart: AMapLocationPoint::locationWithLatitude([\'lat\':$lat, \'lon\':$lon])'); 73 | } 74 | 75 | // invoke native method 76 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPoint::locationWithLatitude_longitude', {"lat": lat, "lon": lon}); 77 | 78 | 79 | // handle native call 80 | 81 | 82 | return __result__; 83 | } 84 | 85 | //endregion 86 | 87 | @override 88 | String toString() { 89 | return 'AMapLocationPoint{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 90 | } 91 | } 92 | 93 | extension AMapLocationPoint_Batch on List { 94 | //region getters 95 | Future> get_latitude_batch() async { 96 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPoint::get_latitude_batch", [for (final __item__ in this) {'__this__': __item__}]); 97 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 98 | } 99 | 100 | Future> get_longitude_batch() async { 101 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPoint::get_longitude_batch", [for (final __item__ in this) {'__this__': __item__}]); 102 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 103 | } 104 | 105 | //endregion 106 | 107 | //region setters 108 | Future set_latitude_batch(List latitude) async { 109 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPoint::set_latitude_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "latitude": latitude[__i__]}]); 110 | 111 | 112 | } 113 | 114 | Future set_longitude_batch(List longitude) async { 115 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPoint::set_longitude_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "longitude": longitude[__i__]}]); 116 | 117 | 118 | } 119 | 120 | //endregion 121 | 122 | //region methods 123 | 124 | static Future> locationWithLatitude_longitude_batch(List lat, List lon) async { 125 | if (lat.length != lon.length) { 126 | return Future.error('all args must have same length!'); 127 | } 128 | 129 | // invoke native method 130 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPoint::locationWithLatitude_longitude_batch', [for (int __i__ = 0; __i__ < lat.length; __i__++) {"lat": lat[__i__], "lon": lon[__i__]}]); 131 | 132 | 133 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 134 | } 135 | 136 | //endregion 137 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationPolygonRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapLocationPolygonRegion extends AMapLocationRegion with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapLocationPolygonRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapLocationPolygonRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapLocationPolygonRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future> get_coordinates() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPolygonRegion::get_coordinates", {'__this__': this}); 42 | return (__result__ as List)?.cast(); 43 | } 44 | 45 | Future get_count() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPolygonRegion::get_count", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | //endregion 51 | 52 | //region setters 53 | 54 | //endregion 55 | 56 | //region methods 57 | 58 | Future initWithCoordinates_count_identifier(List coordinates, int count, String identifier) async { 59 | // print log 60 | if (fluttifyLogEnabled) { 61 | debugPrint('fluttify-dart: AMapLocationPolygonRegion@$refId::initWithCoordinates([\'count\':$count, \'identifier\':$identifier])'); 62 | } 63 | 64 | // invoke native method 65 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPolygonRegion::initWithCoordinates_count_identifier', {"coordinates": coordinates, "count": count, "identifier": identifier, "__this__": this}); 66 | 67 | 68 | // handle native call 69 | 70 | 71 | return __result__; 72 | } 73 | 74 | //endregion 75 | 76 | @override 77 | String toString() { 78 | return 'AMapLocationPolygonRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 79 | } 80 | } 81 | 82 | extension AMapLocationPolygonRegion_Batch on List { 83 | //region getters 84 | Future>> get_coordinates_batch() async { 85 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPolygonRegion::get_coordinates_batch", [for (final __item__ in this) {'__this__': __item__}]); 86 | return (resultBatch as List).cast>().map((__result__) => (__result__ as List)?.cast()).toList(); 87 | } 88 | 89 | Future> get_count_batch() async { 90 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationPolygonRegion::get_count_batch", [for (final __item__ in this) {'__this__': __item__}]); 91 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 92 | } 93 | 94 | //endregion 95 | 96 | //region setters 97 | 98 | //endregion 99 | 100 | //region methods 101 | 102 | Future> initWithCoordinates_count_identifier_batch(List> coordinates, List count, List identifier) async { 103 | if (coordinates.length != count.length || count.length != identifier.length) { 104 | return Future.error('all args must have same length!'); 105 | } 106 | 107 | // invoke native method 108 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationPolygonRegion::initWithCoordinates_count_identifier_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"coordinates": coordinates[__i__], "count": count[__i__], "identifier": identifier[__i__], "__this__": this[__i__]}]); 109 | 110 | 111 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 112 | } 113 | 114 | //endregion 115 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationReGeocodeLanguage.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapLocationReGeocodeLanguage { 7 | AMapLocationReGeocodeLanguageDefault /* 0 */, 8 | AMapLocationReGeocodeLanguageChinse /* 1 */, 9 | AMapLocationReGeocodeLanguageEnglish /* 2 */ 10 | } 11 | 12 | extension AMapLocationReGeocodeLanguageToX on AMapLocationReGeocodeLanguage { 13 | int toValue() { 14 | switch (this) { 15 | case AMapLocationReGeocodeLanguage.AMapLocationReGeocodeLanguageDefault: return 0; 16 | case AMapLocationReGeocodeLanguage.AMapLocationReGeocodeLanguageChinse: return 1; 17 | case AMapLocationReGeocodeLanguage.AMapLocationReGeocodeLanguageEnglish: return 2; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension AMapLocationReGeocodeLanguageFromX on int { 24 | AMapLocationReGeocodeLanguage toAMapLocationReGeocodeLanguage() { 25 | switch (this) { 26 | case 0: return AMapLocationReGeocodeLanguage.AMapLocationReGeocodeLanguageDefault; 27 | case 1: return AMapLocationReGeocodeLanguage.AMapLocationReGeocodeLanguageChinse; 28 | case 2: return AMapLocationReGeocodeLanguage.AMapLocationReGeocodeLanguageEnglish; 29 | default: return AMapLocationReGeocodeLanguage.values[this + 0]; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationRegion.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class AMapLocationRegion extends NSObject with NSCopying { 16 | //region constants 17 | static const String name__ = 'AMapLocationRegion'; 18 | 19 | @override 20 | final String tag__ = 'amap_location_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | return kAmapLocationFluttifyChannel.invokeMethod('ObjectFactory::createAMapLocationRegion', {'init': init}); 28 | } 29 | 30 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 31 | if (false) { 32 | return Future.error('all args must have same length!'); 33 | } 34 | return kAmapLocationFluttifyChannel.invokeListMethod('ObjectFactory::create_batchAMapLocationRegion', {'length': length, 'init': init}); 35 | } 36 | 37 | //endregion 38 | 39 | //region getters 40 | Future get_identifier() async { 41 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationRegion::get_identifier", {'__this__': this}); 42 | return __result__; 43 | } 44 | 45 | Future get_notifyOnEntry() async { 46 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationRegion::get_notifyOnEntry", {'__this__': this}); 47 | return __result__; 48 | } 49 | 50 | Future get_notifyOnExit() async { 51 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationRegion::get_notifyOnExit", {'__this__': this}); 52 | return __result__; 53 | } 54 | 55 | //endregion 56 | 57 | //region setters 58 | Future set_notifyOnEntry(bool notifyOnEntry) async { 59 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::set_notifyOnEntry', {'__this__': this, "notifyOnEntry": notifyOnEntry}); 60 | 61 | 62 | } 63 | 64 | Future set_notifyOnExit(bool notifyOnExit) async { 65 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::set_notifyOnExit', {'__this__': this, "notifyOnExit": notifyOnExit}); 66 | 67 | 68 | } 69 | 70 | //endregion 71 | 72 | //region methods 73 | 74 | Future initWithIdentifier(String identifier) async { 75 | // print log 76 | if (fluttifyLogEnabled) { 77 | debugPrint('fluttify-dart: AMapLocationRegion@$refId::initWithIdentifier([\'identifier\':$identifier])'); 78 | } 79 | 80 | // invoke native method 81 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::initWithIdentifier', {"identifier": identifier, "__this__": this}); 82 | 83 | 84 | // handle native call 85 | 86 | 87 | return __result__; 88 | } 89 | 90 | 91 | Future containsCoordinate(CLLocationCoordinate2D coordinate) async { 92 | // print log 93 | if (fluttifyLogEnabled) { 94 | debugPrint('fluttify-dart: AMapLocationRegion@$refId::containsCoordinate([])'); 95 | } 96 | 97 | // invoke native method 98 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::containsCoordinate', {"coordinate": coordinate, "__this__": this}); 99 | 100 | 101 | // handle native call 102 | 103 | 104 | return __result__; 105 | } 106 | 107 | //endregion 108 | 109 | @override 110 | String toString() { 111 | return 'AMapLocationRegion{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 112 | } 113 | } 114 | 115 | extension AMapLocationRegion_Batch on List { 116 | //region getters 117 | Future> get_identifier_batch() async { 118 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationRegion::get_identifier_batch", [for (final __item__ in this) {'__this__': __item__}]); 119 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 120 | } 121 | 122 | Future> get_notifyOnEntry_batch() async { 123 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationRegion::get_notifyOnEntry_batch", [for (final __item__ in this) {'__this__': __item__}]); 124 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 125 | } 126 | 127 | Future> get_notifyOnExit_batch() async { 128 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod("AMapLocationRegion::get_notifyOnExit_batch", [for (final __item__ in this) {'__this__': __item__}]); 129 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 130 | } 131 | 132 | //endregion 133 | 134 | //region setters 135 | Future set_notifyOnEntry_batch(List notifyOnEntry) async { 136 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::set_notifyOnEntry_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "notifyOnEntry": notifyOnEntry[__i__]}]); 137 | 138 | 139 | } 140 | 141 | Future set_notifyOnExit_batch(List notifyOnExit) async { 142 | await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::set_notifyOnExit_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "notifyOnExit": notifyOnExit[__i__]}]); 143 | 144 | 145 | } 146 | 147 | //endregion 148 | 149 | //region methods 150 | 151 | Future> initWithIdentifier_batch(List identifier) async { 152 | if (false) { 153 | return Future.error('all args must have same length!'); 154 | } 155 | 156 | // invoke native method 157 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::initWithIdentifier_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"identifier": identifier[__i__], "__this__": this[__i__]}]); 158 | 159 | 160 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 161 | } 162 | 163 | 164 | Future> containsCoordinate_batch(List coordinate) async { 165 | if (false) { 166 | return Future.error('all args must have same length!'); 167 | } 168 | 169 | // invoke native method 170 | final resultBatch = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationRegion::containsCoordinate_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"coordinate": coordinate[__i__], "__this__": this[__i__]}]); 171 | 172 | 173 | return (resultBatch as List).cast().map((__result__) => __result__).toList(); 174 | } 175 | 176 | //endregion 177 | } -------------------------------------------------------------------------------- /lib/src/ios/AMapLocationRegionState.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum AMapLocationRegionState { 7 | AMapLocationRegionStateUnknow /* 0 */, 8 | AMapLocationRegionStateInside /* 1 */, 9 | AMapLocationRegionStateOutside /* 2 */ 10 | } 11 | 12 | extension AMapLocationRegionStateToX on AMapLocationRegionState { 13 | int toValue() { 14 | switch (this) { 15 | case AMapLocationRegionState.AMapLocationRegionStateUnknow: return 0; 16 | case AMapLocationRegionState.AMapLocationRegionStateInside: return 1; 17 | case AMapLocationRegionState.AMapLocationRegionStateOutside: return 2; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension AMapLocationRegionStateFromX on int { 24 | AMapLocationRegionState toAMapLocationRegionState() { 25 | switch (this) { 26 | case 0: return AMapLocationRegionState.AMapLocationRegionStateUnknow; 27 | case 1: return AMapLocationRegionState.AMapLocationRegionStateInside; 28 | case 2: return AMapLocationRegionState.AMapLocationRegionStateOutside; 29 | default: return AMapLocationRegionState.values[this + 0]; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /lib/src/ios/constants.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | import 'package:flutter/services.dart'; 6 | import '../facade/objects.g.dart'; 7 | 8 | Future get AMapGeoFenceErrorDomain async { 9 | return kAmapLocationFluttifyChannel.invokeMethod('getAMapGeoFenceErrorDomain'); 10 | } 11 | 12 | Future get AMapLocationErrorDomain async { 13 | return kAmapLocationFluttifyChannel.invokeMethod('getAMapLocationErrorDomain'); 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/ios/functions.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:amap_location_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:amap_location_fluttify/src/android/android.export.g.dart'; 10 | import 'package:flutter/foundation.dart'; 11 | import 'package:flutter/services.dart'; 12 | 13 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 14 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 15 | 16 | Future AMapLocationCoordinateConvert(CLLocationCoordinate2D coordinate, AMapLocationCoordinateType type) async { 17 | // print log 18 | if (fluttifyLogEnabled) { 19 | debugPrint('fluttify-dart: AMapLocationCoordinateConvert::AMapLocationCoordinateConvert([])'); 20 | } 21 | 22 | // invoke native method 23 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationCoordinateConvert::AMapLocationCoordinateConvert', {"coordinate": coordinate, "type": type.toValue()}); 24 | 25 | 26 | // handle native call 27 | 28 | 29 | return __result__; 30 | } 31 | 32 | Future AMapLocationDataAvailableForCoordinate(CLLocationCoordinate2D coordinate) async { 33 | // print log 34 | if (fluttifyLogEnabled) { 35 | debugPrint('fluttify-dart: AMapLocationDataAvailableForCoordinate::AMapLocationDataAvailableForCoordinate([])'); 36 | } 37 | 38 | // invoke native method 39 | final __result__ = await kAmapLocationFluttifyChannel.invokeMethod('AMapLocationDataAvailableForCoordinate::AMapLocationDataAvailableForCoordinate', {"coordinate": coordinate}); 40 | 41 | 42 | // handle native call 43 | 44 | 45 | return __result__; 46 | } 47 | -------------------------------------------------------------------------------- /lib/src/ios/ios.export.g.dart: -------------------------------------------------------------------------------- 1 | export 'AMapLocationPoint.g.dart'; 2 | export 'AMapGeoFencePolygonRegion.g.dart'; 3 | export 'AMapLocationManagerDelegate.g.dart'; 4 | export 'AMapLocationRegion.g.dart'; 5 | export 'AMapGeoFenceRegionStatus.g.dart'; 6 | export 'AMapGeoFenceActiveAction.g.dart'; 7 | export 'AMapLocationRegionState.g.dart'; 8 | export 'AMapGeoFencePOIRegion.g.dart'; 9 | export 'AMapGeoFenceCircleRegion.g.dart'; 10 | export 'type_op.g.dart'; 11 | export 'AMapLocationErrorCode.g.dart'; 12 | export 'constants.g.dart'; 13 | export 'AMapGeoFenceRegion.g.dart'; 14 | export 'AMapGeoFenceManagerDelegate.g.dart'; 15 | export 'AMapLocationPolygonRegion.g.dart'; 16 | export 'AMapLocationReGeocodeLanguage.g.dart'; 17 | export 'AMapGeoFenceRegionType.g.dart'; 18 | export 'functions.g.dart'; 19 | export 'AMapLocationCoordinateType.g.dart'; 20 | export 'AMapGeoFenceErrorCode.g.dart'; 21 | export 'AMapLocationDistrictItem.g.dart'; 22 | export 'AMapGeoFenceDistrictRegion.g.dart'; 23 | export 'AMapLocationManager.g.dart'; 24 | export 'AMapLocationPOIItem.g.dart'; 25 | export 'AMapGeoFenceRegionActiveStatus.g.dart'; 26 | export 'AMapGeoFenceManager.g.dart'; 27 | export 'AMapLocationCircleRegion.g.dart'; 28 | export 'AMapLocationReGeocode.g.dart'; 29 | export 'package:amap_core_fluttify/amap_core_fluttify.dart'; 30 | export '../facade/objects.g.dart'; 31 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | amap_core_fluttify: 5 | dependency: "direct main" 6 | description: 7 | name: amap_core_fluttify 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.14.0-dev.2" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.5.0-nullsafety.1" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0-nullsafety.1" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.0-nullsafety.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.2.0-nullsafety.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0-nullsafety.1" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0-nullsafety.3" 53 | core_location_fluttify: 54 | dependency: "direct main" 55 | description: 56 | name: core_location_fluttify 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.6.0-dev.1" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.2.0-nullsafety.1" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | foundation_fluttify: 78 | dependency: "direct main" 79 | description: 80 | name: foundation_fluttify 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.11.0-dev.8" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.12.10-nullsafety.1" 91 | meta: 92 | dependency: transitive 93 | description: 94 | name: meta 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.3.0-nullsafety.3" 98 | path: 99 | dependency: transitive 100 | description: 101 | name: path 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.8.0-nullsafety.1" 105 | pedantic: 106 | dependency: "direct dev" 107 | description: 108 | name: pedantic 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.9.2" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.8.0-nullsafety.2" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.10.0-nullsafety.1" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.1.0-nullsafety.1" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.1.0-nullsafety.1" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.2.0-nullsafety.1" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.2.19-nullsafety.2" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.3.0-nullsafety.3" 166 | vector_math: 167 | dependency: transitive 168 | description: 169 | name: vector_math 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.1.0-nullsafety.3" 173 | sdks: 174 | dart: ">=2.10.0-110 <2.11.0" 175 | flutter: ">=1.12.13 <2.0.0" 176 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: amap_location_fluttify 2 | description: An `Amap` Location Component, Powered By `Fluttify`, A Compiler Generating Dart Bindings For Native SDK. 3 | version: 0.20.0-dev.1 4 | author: yohom 5 | homepage: https://github.com/fluttify-project/amap_location_fluttify 6 | 7 | environment: 8 | sdk: ">=2.6.0 <3.0.0" 9 | flutter: ">=1.12.13 <2.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | amap_core_fluttify: ^0.14.0-dev.2 15 | 16 | foundation_fluttify: ^0.11.0-dev.8 17 | core_location_fluttify: ^0.6.0-dev.1 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | pedantic: ^1.0.0 23 | 24 | flutter: 25 | plugin: 26 | platforms: 27 | android: 28 | package: me.yohom.amap_location_fluttify 29 | pluginClass: AmapLocationFluttifyPlugin 30 | ios: 31 | pluginClass: AmapLocationFluttifyPlugin -------------------------------------------------------------------------------- /test/amap_location_fluttify_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | --------------------------------------------------------------------------------