Browse Source

Merge branch 'master' into dev

# Conflicts:
#	lib/union/union_page.dart
null_safety
w-R 4 years ago
parent
commit
e881aca08a
  1. 6
      android/app/build.gradle
  2. 5
      android/app/proguard-rules.pro
  3. 10
      android/app/src/main/AndroidManifest.xml
  4. 3
      android/app/src/main/kotlin/com/zsw/huixiang/HxApplication.kt
  5. 7
      android/build.gradle
  6. BIN
      assets/map_style/chatian.sty
  7. BIN
      assets/map_style/style.data
  8. BIN
      assets/map_style/style_extra.data
  9. 63
      ios/Podfile.lock
  10. 139
      ios/Runner.xcodeproj/project.pbxproj
  11. 2
      ios/Runner/AppDelegate.m
  12. 1
      ios/Runner/Info.plist
  13. 4
      ios/Runner/Runner-Bridging-Header.h
  14. 2
      ios/Runner/Runner.entitlements
  15. BIN
      ios/Runner/baidu/BMKLocationKit
  16. BIN
      ios/Runner/baidu/BMKLocationKit.framework/BMKLocationKit
  17. 141
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKGeoFenceManager.h
  18. 114
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKGeoFenceRegion.h
  19. 97
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocation.h
  20. 56
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationAuth.h
  21. 16
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationComponent.h
  22. 30
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationKitVersion.h
  23. 296
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationManager.h
  24. 42
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationPoi.h
  25. 35
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationPoiRegion.h
  26. 67
      ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationReGeocode.h
  27. 11
      ios/Runner/baidu/BMKLocationKit.framework/readme.txt
  28. 141
      ios/Runner/baidu/Headers/BMKGeoFenceManager.h
  29. 114
      ios/Runner/baidu/Headers/BMKGeoFenceRegion.h
  30. 97
      ios/Runner/baidu/Headers/BMKLocation.h
  31. 56
      ios/Runner/baidu/Headers/BMKLocationAuth.h
  32. 16
      ios/Runner/baidu/Headers/BMKLocationComponent.h
  33. 30
      ios/Runner/baidu/Headers/BMKLocationKitVersion.h
  34. 296
      ios/Runner/baidu/Headers/BMKLocationManager.h
  35. 42
      ios/Runner/baidu/Headers/BMKLocationPoi.h
  36. 35
      ios/Runner/baidu/Headers/BMKLocationPoiRegion.h
  37. 67
      ios/Runner/baidu/Headers/BMKLocationReGeocode.h
  38. 241
      lib/address/address_map_page.dart
  39. 12
      lib/main.dart
  40. 149
      lib/order/store_selector_page.dart
  41. 12
      lib/union/store_details_page.dart
  42. 343
      lib/union/union_page.dart
  43. 10
      lib/view_widget/mine_vip_view.dart
  44. 51
      pubspec.lock
  45. 10
      pubspec.yaml

6
android/app/build.gradle

@ -138,12 +138,18 @@ android {
buildTypes { buildTypes {
release { release {
signingConfig signingConfigs.config signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
} }
debug { debug {
signingConfig signingConfigs.config signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
} }
profile { profile {
signingConfig signingConfigs.config signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
} }
} }

5
android/app/proguard-android.txt → android/app/proguard-rules.pro vendored

@ -15,7 +15,10 @@
-dontwarn com.sina.** -dontwarn com.sina.**
-dontwarn com.mob.** -dontwarn com.mob.**
-keep class com.baidu.** {*;}
-keep class vi.com.** {*;}
-keep class com.baidu.vi.** {*;}
-dontwarn com.baidu.**
#andResGuard { #andResGuard {
# whiteList = [ # whiteList = [

10
android/app/src/main/AndroidManifest.xml

@ -119,11 +119,11 @@
<meta-data <meta-data
android:name="com.amap.api.v2.apikey" android:name="com.amap.api.v2.apikey"
android:value="f39d1daa020a56f208eb2519f63e9534"/> android:value="f39d1daa020a56f208eb2519f63e9534"/>
<!-- <meta-data-->
<!-- android:name="com.baidu.lbsapi.API_KEY"--> <meta-data
<!-- android:value="开发者申请的AK" />--> android:name="com.baidu.lbsapi.API_KEY"
<!-- Don't delete the meta-data below. android:value="cdM5EPFACARrrHRjCwUEoYuzIlfFWdYP" />
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />

3
android/app/src/main/kotlin/com/zsw/huixiang/HxApplication.kt

@ -1,8 +1,9 @@
package com.zsw.huixiang package com.zsw.huixiang
import android.app.Application import android.app.Application
import com.baidu.mapapi.base.BmfMapApplication
class HxApplication : Application() { class HxApplication : BmfMapApplication() {
override fun onCreate() { override fun onCreate() {

7
android/build.gradle

@ -10,8 +10,11 @@ buildscript {
maven { maven {
url 'http://maven.aliyun.com/nexus/content/groups/public' url 'http://maven.aliyun.com/nexus/content/groups/public'
} }
google() // google()
// jcenter() // jcenter()
jcenter(){
url "http://jcenter.bintray.com/"
}
maven { maven {
url "http://mvn.mob.com/android" url "http://mvn.mob.com/android"
} }
@ -38,7 +41,7 @@ allprojects {
maven { maven {
url 'http://maven.aliyun.com/nexus/content/groups/public' url 'http://maven.aliyun.com/nexus/content/groups/public'
} }
google() // google()
// jcenter() // jcenter()
maven { maven {
url "http://mvn.mob.com/android" url "http://mvn.mob.com/android"

BIN
assets/map_style/chatian.sty

Binary file not shown.

BIN
assets/map_style/style.data

Binary file not shown.

BIN
assets/map_style/style_extra.data

Binary file not shown.

63
ios/Podfile.lock

@ -1,16 +1,27 @@
PODS: PODS:
- AMap3DMap (7.9.0): - BaiduMapKit/Base (6.2.0)
- AMapFoundation (~> 1.6.6) - BaiduMapKit/Map (6.2.0):
- amap_flutter_location (0.0.1): - BaiduMapKit/Base
- AMapLocation (~> 2.6.7) - BaiduMapKit/Search (6.2.0):
- BaiduMapKit/Base
- BaiduMapKit/Utils (6.2.0):
- BaiduMapKit/Base
- Flutter (1.0.0)
- flutter_baidu_mapapi_base (2.0.0):
- BaiduMapKit/Utils (= 6.2.0)
- Flutter - Flutter
- amap_flutter_map (0.0.1): - flutter_baidu_mapapi_map (2.0.0):
- AMap3DMap - BaiduMapKit/Map (= 6.2.0)
- Flutter - Flutter
- AMapFoundation (1.6.7) - flutter_baidu_mapapi_base
- AMapLocation (2.6.8): - flutter_baidu_mapapi_search (0.0.1):
- AMapFoundation (~> 1.6.4) - BaiduMapKit/Search (= 6.2.0)
- Flutter (1.0.0) - Flutter
- flutter_baidu_mapapi_base
- flutter_baidu_mapapi_utils (2.0.0):
- BaiduMapKit/Utils (= 6.2.0)
- Flutter
- flutter_baidu_mapapi_base
- fluwx (0.0.1): - fluwx (0.0.1):
- Flutter - Flutter
- WechatOpenSDK (= 1.8.7.1) - WechatOpenSDK (= 1.8.7.1)
@ -82,9 +93,11 @@ PODS:
- WechatOpenSDK (1.8.7.1) - WechatOpenSDK (1.8.7.1)
DEPENDENCIES: DEPENDENCIES:
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_baidu_mapapi_base (from `.symlinks/plugins/flutter_baidu_mapapi_base/ios`)
- flutter_baidu_mapapi_map (from `.symlinks/plugins/flutter_baidu_mapapi_map/ios`)
- flutter_baidu_mapapi_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`)
- flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`)
@ -102,9 +115,7 @@ DEPENDENCIES:
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- AMap3DMap - BaiduMapKit
- AMapFoundation
- AMapLocation
- FMDB - FMDB
- mob_sharesdk - mob_sharesdk
- MOBFoundation - MOBFoundation
@ -113,12 +124,16 @@ SPEC REPOS:
- WechatOpenSDK - WechatOpenSDK
EXTERNAL SOURCES: EXTERNAL SOURCES:
amap_flutter_location:
:path: ".symlinks/plugins/amap_flutter_location/ios"
amap_flutter_map:
:path: ".symlinks/plugins/amap_flutter_map/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_baidu_mapapi_base:
:path: ".symlinks/plugins/flutter_baidu_mapapi_base/ios"
flutter_baidu_mapapi_map:
:path: ".symlinks/plugins/flutter_baidu_mapapi_map/ios"
flutter_baidu_mapapi_search:
:path: ".symlinks/plugins/flutter_baidu_mapapi_search/ios"
flutter_baidu_mapapi_utils:
:path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios"
fluwx: fluwx:
:path: ".symlinks/plugins/fluwx/ios" :path: ".symlinks/plugins/fluwx/ios"
image_cropper: image_cropper:
@ -149,12 +164,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter/ios" :path: ".symlinks/plugins/webview_flutter/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
AMap3DMap: 4ff760f011b89aec85edd8b5fcf90d384aae1202 BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8
amap_flutter_location: 3e33b57f1aad80b0dfb4b399de857a1a9f071e62
amap_flutter_map: 979e54d227cedac6c7504a2151bfbf3bcf96760a
AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b
AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db
flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16
flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d
flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb

139
ios/Runner.xcodeproj/project.pbxproj

@ -8,6 +8,9 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
05C5426026BB9CEB00D26AC2 /* liblibIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33A2695816000237A5E /* liblibIO.a */; }; 05C5426026BB9CEB00D26AC2 /* liblibIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33A2695816000237A5E /* liblibIO.a */; };
05C5426F26BBE8FE00D26AC2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F373269581F600237A5E /* CoreLocation.framework */; };
05C5427126BBE93600D26AC2 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05C5427026BBE93600D26AC2 /* AdSupport.framework */; };
05C5427426BCE3AC00D26AC2 /* BMKLocationKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05C5427326BCE3AC00D26AC2 /* BMKLocationKit.framework */; };
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
6EE8F3452695816000237A5E /* __uniappes6.js in Resources */ = {isa = PBXBuildFile; fileRef = 6EE8F2E62695815A00237A5E /* __uniappes6.js */; }; 6EE8F3452695816000237A5E /* __uniappes6.js in Resources */ = {isa = PBXBuildFile; fileRef = 6EE8F2E62695815A00237A5E /* __uniappes6.js */; };
@ -87,6 +90,10 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
05C5427026BBE93600D26AC2 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
05C5427326BCE3AC00D26AC2 /* BMKLocationKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = BMKLocationKit.framework; sourceTree = "<group>"; };
05C5427526BCFA9000D26AC2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
05C5427726BCFCBB00D26AC2 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
@ -255,20 +262,22 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
05C5427126BBE93600D26AC2 /* AdSupport.framework in Frameworks */,
6EE8F36C269581D500237A5E /* libc++.tbd in Frameworks */,
6EE8F370269581EC00237A5E /* CoreTelephony.framework in Frameworks */,
89A626A526A7F71A0004A8F0 /* libsqlite3.0.tbd in Frameworks */,
89AEFA9326A69A3600DD2817 /* Security.framework in Frameworks */,
89AEFA9526A69A4800DD2817 /* SystemConfiguration.framework in Frameworks */,
05C5426F26BBE8FE00D26AC2 /* CoreLocation.framework in Frameworks */,
05C5426026BB9CEB00D26AC2 /* liblibIO.a in Frameworks */, 05C5426026BB9CEB00D26AC2 /* liblibIO.a in Frameworks */,
89A626B026A80E520004A8F0 /* AMapFoundationKit.framework in Frameworks */, 89A626B026A80E520004A8F0 /* AMapFoundationKit.framework in Frameworks */,
89A626B126A80E520004A8F0 /* AMapLocationKit.framework in Frameworks */, 89A626B126A80E520004A8F0 /* AMapLocationKit.framework in Frameworks */,
89A626B226A80E520004A8F0 /* libAMapLocationPlugin.a in Frameworks */, 89A626B226A80E520004A8F0 /* libAMapLocationPlugin.a in Frameworks */,
89A626B326A80E520004A8F0 /* liblibGeolocation.a in Frameworks */, 89A626B326A80E520004A8F0 /* liblibGeolocation.a in Frameworks */,
89AEFA9526A69A4800DD2817 /* SystemConfiguration.framework in Frameworks */,
6EE8F370269581EC00237A5E /* CoreTelephony.framework in Frameworks */,
89AEFA8F26A699DE00DD2817 /* libz.tbd in Frameworks */, 89AEFA8F26A699DE00DD2817 /* libz.tbd in Frameworks */,
89A626A526A7F71A0004A8F0 /* libsqlite3.0.tbd in Frameworks */,
89A6269F26A7F6D30004A8F0 /* liblibPayment.a in Frameworks */, 89A6269F26A7F6D30004A8F0 /* liblibPayment.a in Frameworks */,
89AEFA9326A69A3600DD2817 /* Security.framework in Frameworks */,
6EE8F362269581AF00237A5E /* GLKit.framework in Frameworks */, 6EE8F362269581AF00237A5E /* GLKit.framework in Frameworks */,
89AEFA9126A69A2200DD2817 /* ExternalAccessory.framework in Frameworks */, 89AEFA9126A69A2200DD2817 /* ExternalAccessory.framework in Frameworks */,
6EE8F36C269581D500237A5E /* libc++.tbd in Frameworks */,
89AEFA4526A6802000DD2817 /* MapKit.framework in Frameworks */, 89AEFA4526A6802000DD2817 /* MapKit.framework in Frameworks */,
89AEFA3D26A67FB100DD2817 /* DCUniVideoPublic.framework in Frameworks */, 89AEFA3D26A67FB100DD2817 /* DCUniVideoPublic.framework in Frameworks */,
6EE8F3782695820600237A5E /* libiconv.tbd in Frameworks */, 6EE8F3782695820600237A5E /* libiconv.tbd in Frameworks */,
@ -296,6 +305,7 @@
6EE8F34D2695816000237A5E /* liblibWeex.a in Frameworks */, 6EE8F34D2695816000237A5E /* liblibWeex.a in Frameworks */,
6EE8F3552695816000237A5E /* storage.framework in Frameworks */, 6EE8F3552695816000237A5E /* storage.framework in Frameworks */,
6EE8F3512695816000237A5E /* libcoreSupport.a in Frameworks */, 6EE8F3512695816000237A5E /* libcoreSupport.a in Frameworks */,
05C5427426BCE3AC00D26AC2 /* BMKLocationKit.framework in Frameworks */,
89A626A726A7FF910004A8F0 /* libWeChatSDK.a in Frameworks */, 89A626A726A7FF910004A8F0 /* libWeChatSDK.a in Frameworks */,
89A626AC26A8002F0004A8F0 /* libWeChatSDK.a in Frameworks */, 89A626AC26A8002F0004A8F0 /* libWeChatSDK.a in Frameworks */,
6EE8F3562695816000237A5E /* liblibNativeObj.a in Frameworks */, 6EE8F3562695816000237A5E /* liblibNativeObj.a in Frameworks */,
@ -309,9 +319,19 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
05C5426126BBE82E00D26AC2 /* baidu */ = {
isa = PBXGroup;
children = (
05C5427326BCE3AC00D26AC2 /* BMKLocationKit.framework */,
);
path = baidu;
sourceTree = "<group>";
};
4ACDDAD1B437E297D1948602 /* Frameworks */ = { 4ACDDAD1B437E297D1948602 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
05C5427526BCFA9000D26AC2 /* SwiftUI.framework */,
05C5427026BBE93600D26AC2 /* AdSupport.framework */,
89A626A426A7F71A0004A8F0 /* libsqlite3.0.tbd */, 89A626A426A7F71A0004A8F0 /* libsqlite3.0.tbd */,
89AEFA9626A69D8E00DD2817 /* Foundation.framework */, 89AEFA9626A69D8E00DD2817 /* Foundation.framework */,
89AEFA9426A69A4800DD2817 /* SystemConfiguration.framework */, 89AEFA9426A69A4800DD2817 /* SystemConfiguration.framework */,
@ -565,6 +585,7 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
05C5426126BBE82E00D26AC2 /* baidu */,
89A626A826A7FFF30004A8F0 /* wx */, 89A626A826A7FFF30004A8F0 /* wx */,
89847A4826A14482008C8077 /* Runner.entitlements */, 89847A4826A14482008C8077 /* Runner.entitlements */,
6EE8F2E42695813500237A5E /* UniMPSDK */, 6EE8F2E42695813500237A5E /* UniMPSDK */,
@ -578,6 +599,7 @@
97C146F11CF9000F007C117D /* Supporting Files */, 97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
05C5427726BCFCBB00D26AC2 /* Runner-Bridging-Header.h */,
); );
path = Runner; path = Runner;
sourceTree = "<group>"; sourceTree = "<group>";
@ -626,6 +648,7 @@
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1250;
}; };
}; };
}; };
@ -845,6 +868,8 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 32; CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
@ -853,11 +878,15 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/flutter_bmflocation\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", "\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_utils\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_search\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_map\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_base\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"",
@ -868,7 +897,7 @@
"\"${PODS_ROOT}/Headers/Public/wakelock\"", "\"${PODS_ROOT}/Headers/Public/wakelock\"",
"\"${PODS_ROOT}/Headers/Public/webview_flutter\"", "\"${PODS_ROOT}/Headers/Public/webview_flutter\"",
"$(PROJECT_DIR)/UniMPSDK/Headers", "$(PROJECT_DIR)/UniMPSDK/Headers",
"//$(PROJECT_DIR)/wx/Headers", "$(PROJECT_DIR)/wx/Headers",
"\"${PODS_ROOT}/Headers/Private/fluwx\"", "\"${PODS_ROOT}/Headers/Private/fluwx\"",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -880,18 +909,23 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs", "$(PROJECT_DIR)/wx/Libs",
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 1.0.32; MARKETING_VERSION = 1.0.32;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
"-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"",
"-l\"c++\"", "-l\"c++\"",
"-l\"image_cropper\"", "-l\"image_cropper\"",
"-l\"image_picker\"", "-l\"image_picker\"",
"-l\"path_provider\"", "-l\"path_provider\"",
"-l\"flutter_bmflocation\"",
"-l\"flutter_baidu_mapapi_utils\"",
"-l\"flutter_baidu_mapapi_search\"",
"-l\"flutter_baidu_mapapi_map\"",
"-l\"flutter_baidu_mapapi_base\"",
"-l\"permission_handler\"", "-l\"permission_handler\"",
"-l\"shared_preferences\"", "-l\"shared_preferences\"",
"-l\"sqflite\"", "-l\"sqflite\"",
@ -926,10 +960,24 @@
"\"Security\"", "\"Security\"",
"-framework", "-framework",
"\"SystemConfiguration\"", "\"SystemConfiguration\"",
"-framework",
"\"BMKLocationKit\"",
"-framework",
"\"BaiduMapAPI_Base\"",
"-framework",
"\"BaiduMapAPI_Map\"",
"-framework",
"\"BaiduMapAPI_Utils\"",
"-framework",
"\"BaiduMapAPI_Search\"",
"-fcxx-modules",
"-fmodules",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx; PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Profile; name = Profile;
@ -1046,6 +1094,8 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 32; CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
@ -1054,11 +1104,15 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/flutter_bmflocation\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", "\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_utils\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_search\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_map\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_base\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"",
@ -1069,7 +1123,7 @@
"\"${PODS_ROOT}/Headers/Public/wakelock\"", "\"${PODS_ROOT}/Headers/Public/wakelock\"",
"\"${PODS_ROOT}/Headers/Public/webview_flutter\"", "\"${PODS_ROOT}/Headers/Public/webview_flutter\"",
"$(PROJECT_DIR)/UniMPSDK/Headers", "$(PROJECT_DIR)/UniMPSDK/Headers",
"//$(PROJECT_DIR)/wx/Headers", "$(PROJECT_DIR)/wx/Headers",
"\"${PODS_ROOT}/Headers/Private/fluwx\"", "\"${PODS_ROOT}/Headers/Private/fluwx\"",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -1081,18 +1135,23 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs", "$(PROJECT_DIR)/wx/Libs",
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 1.0.32; MARKETING_VERSION = 1.0.32;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
"-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"",
"-l\"c++\"", "-l\"c++\"",
"-l\"image_cropper\"", "-l\"image_cropper\"",
"-l\"image_picker\"", "-l\"image_picker\"",
"-l\"path_provider\"", "-l\"path_provider\"",
"-l\"flutter_bmflocation\"",
"-l\"flutter_baidu_mapapi_utils\"",
"-l\"flutter_baidu_mapapi_search\"",
"-l\"flutter_baidu_mapapi_map\"",
"-l\"flutter_baidu_mapapi_base\"",
"-l\"permission_handler\"", "-l\"permission_handler\"",
"-l\"shared_preferences\"", "-l\"shared_preferences\"",
"-l\"sqflite\"", "-l\"sqflite\"",
@ -1127,9 +1186,24 @@
"\"Security\"", "\"Security\"",
"-framework", "-framework",
"\"SystemConfiguration\"", "\"SystemConfiguration\"",
"-framework",
"\"BMKLocationKit\"",
"-framework",
"\"BaiduMapAPI_Base\"",
"-framework",
"\"BaiduMapAPI_Map\"",
"-framework",
"\"BaiduMapAPI_Utils\"",
"-framework",
"\"BaiduMapAPI_Search\"",
"-fcxx-modules",
"-fmodules",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx; PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Debug; name = Debug;
@ -1139,6 +1213,8 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 32; CURRENT_PROJECT_VERSION = 32;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
@ -1147,11 +1223,15 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_location\"", "\"${PODS_ROOT}/Headers/Public/flutter_bmflocation\"",
"\"${PODS_ROOT}/Headers/Public/amap_flutter_map\"", "\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_utils\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_search\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_map\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_base\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"", "\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"", "\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"", "\"${PODS_ROOT}/Headers/Public/path_provider\"",
@ -1162,7 +1242,7 @@
"\"${PODS_ROOT}/Headers/Public/wakelock\"", "\"${PODS_ROOT}/Headers/Public/wakelock\"",
"\"${PODS_ROOT}/Headers/Public/webview_flutter\"", "\"${PODS_ROOT}/Headers/Public/webview_flutter\"",
"$(PROJECT_DIR)/UniMPSDK/Headers", "$(PROJECT_DIR)/UniMPSDK/Headers",
"//$(PROJECT_DIR)/wx/Headers", "$(PROJECT_DIR)/wx/Headers",
"\"${PODS_ROOT}/Headers/Private/fluwx\"", "\"${PODS_ROOT}/Headers/Private/fluwx\"",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -1174,18 +1254,23 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs", "$(PROJECT_DIR)/wx/Libs",
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 1.0.32; MARKETING_VERSION = 1.0.32;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
"-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"",
"-l\"c++\"", "-l\"c++\"",
"-l\"image_cropper\"", "-l\"image_cropper\"",
"-l\"image_picker\"", "-l\"image_picker\"",
"-l\"path_provider\"", "-l\"path_provider\"",
"-l\"flutter_bmflocation\"",
"-l\"flutter_baidu_mapapi_utils\"",
"-l\"flutter_baidu_mapapi_search\"",
"-l\"flutter_baidu_mapapi_map\"",
"-l\"flutter_baidu_mapapi_base\"",
"-l\"permission_handler\"", "-l\"permission_handler\"",
"-l\"shared_preferences\"", "-l\"shared_preferences\"",
"-l\"sqflite\"", "-l\"sqflite\"",
@ -1220,10 +1305,24 @@
"\"Security\"", "\"Security\"",
"-framework", "-framework",
"\"SystemConfiguration\"", "\"SystemConfiguration\"",
"-framework",
"\"BMKLocationKit\"",
"-framework",
"\"BaiduMapAPI_Base\"",
"-framework",
"\"BaiduMapAPI_Map\"",
"-framework",
"\"BaiduMapAPI_Utils\"",
"-framework",
"\"BaiduMapAPI_Search\"",
"-fcxx-modules",
"-fmodules",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx; PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Release; name = Release;

2
ios/Runner/AppDelegate.m

@ -19,7 +19,7 @@
[DCUniMPSDKEngine initSDKEnvironmentWithLaunchOptions:options ]; [DCUniMPSDKEngine initSDKEnvironmentWithLaunchOptions:options ];
FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController; FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;
FlutterMethodChannel* uniAppChannel = [FlutterMethodChannel methodChannelWithName:@"min" binaryMessenger:controller]; FlutterMethodChannel* uniAppChannel = [FlutterMethodChannel methodChannelWithName:@"min" binaryMessenger:(NSObject<FlutterBinaryMessenger> *)controller];
UniappPlugin * plugin = [[UniappPlugin alloc] init]; UniappPlugin * plugin = [[UniappPlugin alloc] init];
[DCUniMPSDKEngine setDelegate:plugin]; [DCUniMPSDKEngine setDelegate:plugin];
[uniAppChannel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) { [uniAppChannel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) {

1
ios/Runner/Info.plist

@ -151,5 +151,6 @@
<string>https://hx.lotus-wallet.com/app/</string> <string>https://hx.lotus-wallet.com/app/</string>
<key>io.flutter.embedded_views_preview</key> <key>io.flutter.embedded_views_preview</key>
<string>YES</string> <string>YES</string>
</dict> </dict>
</plist> </plist>

4
ios/Runner/Runner-Bridging-Header.h

@ -0,0 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

2
ios/Runner/Runner.entitlements

@ -7,8 +7,8 @@
<key>com.apple.developer.associated-domains</key> <key>com.apple.developer.associated-domains</key>
<array> <array>
<string>applinks:demo.dcloud.net.cn</string> <string>applinks:demo.dcloud.net.cn</string>
<string>hx.lotus-wallet.com</string>
<string>applinks:hx.lotus-wallet.com</string> <string>applinks:hx.lotus-wallet.com</string>
<string>applinks:huixiang.lotus-wallet.com</string>
</array> </array>
</dict> </dict>
</plist> </plist>

BIN
ios/Runner/baidu/BMKLocationKit

Binary file not shown.

BIN
ios/Runner/baidu/BMKLocationKit.framework/BMKLocationKit

Binary file not shown.

141
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKGeoFenceManager.h

@ -0,0 +1,141 @@
//
// BMKGeoFenceManager.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import "BMKGeoFenceRegion.h"
@protocol BMKGeoFenceManagerDelegate;
///地理围栏监听状态类型
typedef NS_OPTIONS(NSUInteger, BMKGeoFenceActiveAction)
{
BMKGeoFenceActiveActionNone = 0, ///< 不进行监听
BMKGeoFenceActiveActionInside = 1 << 0, ///< 在范围内
BMKGeoFenceActiveActionOutside = 1 << 1, ///< 在范围外
BMKGeoFenceActiveActionStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
};
///BMKGeoFence errorDomain
FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKGeoFenceErrorDomain;
///地理围栏错误码
typedef NS_ENUM(NSInteger, BMKGeoFenceErrorCode) {
BMKGeoFenceErrorUnknown = 1, ///< 未知错误
BMKGeoFenceErrorInvalidParameter = 2, ///< 参数错误
BMKGeoFenceErrorFailureConnection = 3, ///< 网络连接异常
BMKGeoFenceErrorFailureAuth = 4, ///< 鉴权失败
BMKGeoFenceErrorNoValidFence = 5, ///< 无可用围栏
BMKGeoFenceErroFailureLocating = 6, ///< 定位错误
};
///地理围栏管理类
@interface BMKGeoFenceManager : NSObject
///实现了 BMKGeoFenceManagerDelegate 协议的类指针。
@property (nonatomic, weak, nullable) id<BMKGeoFenceManagerDelegate> delegate;
///需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。
@property (nonatomic, assign) BMKGeoFenceActiveAction activeAction;
///指定定位是否会被系统自动暂停。默认为NO。
@property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
@property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
/**
* @brief
* @param center
* @param radius 0
* @param type
* @param customID IDSDK原值返回
*/
- (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
/**
* @brief ,
* @param coordinates ,coordinates对应的内存会拷贝,
* @param count 3
* @param type
* @param customID IDSDK原值返回
*/
- (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D * _Nonnull)coordinates count:(NSInteger)count coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
/**
* @brief customID获得指定的围栏customID传nil
* @param customID customID
* @return nil
*/
- (NSArray * _Nullable)geoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
/**
* @brief
* @param region
*/
- (void)removeTheGeoFenceRegion:(BMKGeoFenceRegion * _Nonnull)region;
/**
* @brief customID的围栏
* @param customID customID
*/
- (void)removeGeoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
/**
* @brief
*/
- (void)removeAllGeoFenceRegions;
@end
///地理围栏代理协议,该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。
@protocol BMKGeoFenceManagerDelegate <NSObject>
@optional
/**
* @brief app store关于新的后台定位的审核机制app store要求如果开发者只配置了使用期间定位plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时delegate中调用后台定位api[locationManager requestAlwaysAuthorization]NSLocationWhenInUseUsageDescription使delegate中实现逻辑
* @param manager BMKGeoFenceManager
* @param locationManager CLLocationManager
* @since 1.7.0
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager doRequestAlwaysAuthorization:(CLLocationManager * _Nonnull)locationManager;
/**
* @brief
* @param manager
* @param regions
* @param customID customID
* @param error
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didAddRegionForMonitoringFinished:(NSArray <BMKGeoFenceRegion *> * _Nullable)regions customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
/**
* @brief
* @param manager
* @param region
* @param customID customID
* @param error
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didGeoFencesStatusChangedForRegion:(BMKGeoFenceRegion * _Nullable)region customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
@end

114
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKGeoFenceRegion.h

@ -0,0 +1,114 @@
//
// BMKGeoFenceRegion.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationManager.h"
///BMKGeoFence Region State
typedef NS_ENUM(NSInteger, BMKGeoFenceRegionStatus)
{
BMKGeoFenceRegionStatusUnknown = 0, ///< 未知
BMKGeoFenceRegionStatusInside = 1, ///< 在范围内
BMKGeoFenceRegionStatusOutside = 1 << 1, ///< 在范围外
BMKGeoFenceRegionStatusStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
};
#pragma mark - BMKGeoFenceRegion
///地理围栏基类,不可直接使用
@interface BMKGeoFenceRegion : NSObject<NSCopying>
///BMKGeoFenceRegion的唯一标识符
@property (nonatomic, copy, readonly) NSString *identifier;
///用户自定义ID,可为nil。
@property (nonatomic, copy, readonly) NSString *customID;
///坐标点和围栏的关系,比如用户的位置和围栏的关系
@property (nonatomic, assign) BMKGeoFenceRegionStatus fenceStatus;
///设定围栏坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
@property(nonatomic, readonly) BMKLocationCoordinateType coordinateType;
///上次发生状态变化的时间
@property(nonatomic, assign)NSTimeInterval lastEventTime;
/**
* @brief
* @param CLLocationCoordinate2D
* @return BMKGeoFenceRegionStatus状态
*/
-(BMKGeoFenceRegionStatus)judgeStatusWithCoor:(CLLocationCoordinate2D)coor;
@end
#pragma mark - BMKLocationCircleRegion
///圆形地理围栏
@interface BMKGeoFenceCircleRegion : BMKGeoFenceRegion
///中心点的经纬度坐标
@property (nonatomic, readonly) CLLocationCoordinate2D center;
///半径,单位:米
@property (nonatomic, readonly) CLLocationDistance radius;
/**
* @brief
* @param customid ID
* @param identityid id
* @param center
* @param radius
* @param type
* @return BMKGeoFenceCircleRegion id
*/
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid center:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coor:(BMKLocationCoordinateType)type;
@end
#pragma mark -BMKGeoFencePolygonRegion
///多边形地理围栏
@interface BMKGeoFencePolygonRegion : BMKGeoFenceRegion
///经纬度坐标点数据
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates;
///经纬度坐标点的个数
@property (nonatomic, readonly) NSInteger count;
/**
* @brief
* @param customid ID
* @param identityid id
* @param coor
* @param count
* @param type
* @return BMKGeoFencePolygonRegion id
*/
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid coor:(CLLocationCoordinate2D *)coor count:(NSInteger)count coor:(BMKLocationCoordinateType)type;
@end

97
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocation.h

@ -0,0 +1,97 @@
//
// BMKLocation.h
// LocationComponent
//
// Created by baidu on 2017/8/16.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocation_h
#define BMKLocation_h
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationReGeocode.h"
/**
* BMKLocationProvider iOS系统定位和其他定位服务结果两种iOS系统定位服务
*
*/
typedef NS_ENUM(int, BMKLocationProvider) {
BMKLocationProviderIOS = 0, //!<位置来源于iOS本身定位
BMKLocationProviderOther //!<位置来源于其他定位服务
};
///描述百度iOS 定位数据
@interface BMKLocation : NSObject
///BMKLocation 位置数据
@property(nonatomic, copy, readonly) CLLocation * _Nullable location;
///BMKLocation 地址数据
@property(nonatomic, copy) BMKLocationReGeocode * _Nullable rgcData;
///BMKLocation 位置来源
@property(nonatomic, assign) BMKLocationProvider provider;
///BMKLocation 位置ID
@property(nonatomic, retain) NSString * _Nullable locationID;
/*
* floorString
*
* Discussion:
* ex:f1
*/
@property(readonly, nonatomic, copy, nullable) NSString *floorString;
/*
* buildingID
*
* Discussion:
* ID
*/
@property(readonly, nonatomic, copy, nullable) NSString *buildingID;
/*
* buildingName
*
* Discussion:
*
*/
@property(readonly, nonatomic, copy, nullable) NSString *buildingName;
/*
* extraInfo
*
* Discussion:
* code识别结果code示例vdr推算结果置信度等
*/
@property(readonly, nonatomic, copy, nullable) NSDictionary * extraInfo;
/**
* @brief BMKLocation实例
* @param loc CLLocation对象
* @param rgc BMKLocationReGeocode对象
* @return BMKLocation id
*/
- (id _Nonnull)initWithLocation:(CLLocation * _Nullable)loc withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
/**
* @brief BMKLocation
* @param location CLLocation
* @param floorString
* @param buildingID ID
* @param buildingName
* @param info
* @return BMKLocation id
*/
-(id _Nonnull)initWithLocation:(CLLocation * _Nullable)location floorString:(NSString * _Nullable)floorString buildingID:(NSString * _Nullable)buildingID
buildingName:(NSString * _Nullable)buildingName extraInfo:(NSDictionary * _Nullable)info withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
@end
#endif /* BMKLocation_h */

56
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationAuth.h

@ -0,0 +1,56 @@
//
// BMKLocationAuth.h
// LocationComponent
//
// Created by baidu on 2017/4/10.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationAuth_h
#define BMKLocationAuth_h
///定位鉴权错误码
typedef NS_ENUM(NSInteger, BMKLocationAuthErrorCode) {
BMKLocationAuthErrorUnknown = -1, ///< 未知错误
BMKLocationAuthErrorSuccess = 0, ///< 鉴权成功
BMKLocationAuthErrorNetworkFailed = 1, ///< 因网络鉴权失败
BMKLocationAuthErrorFailed = 2, ///< KEY非法鉴权失败
};
///通知Delegate
@protocol BMKLocationAuthDelegate <NSObject>
@optional
/**
*@brief
*@param iError : 0BMKLocationAuthErrorCode
*/
- (void)onCheckPermissionState:(BMKLocationAuthErrorCode)iError;
@end
///BMKLocationAuth类。用于鉴权
@interface BMKLocationAuth : NSObject
///鉴权状态0:成功; 1:网络错误; 2:授权失败
@property(nonatomic, readonly, assign) BMKLocationAuthErrorCode permisionState;
/**
* @brief BMKLocationAuth的单例
*/
+ (BMKLocationAuth*)sharedInstance;
/**
*@brief
*@param key key
*@param delegate
*/
-(void)checkPermisionWithKey:(NSString*)key authDelegate:(id<BMKLocationAuthDelegate>)delegate;
@end
#endif /* BMKLocationAuth_h */

16
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationComponent.h

@ -0,0 +1,16 @@
//
// BMKLocationComponent.h
// LocationComponent
//
// Created by Baidu on 3/31/14.
// Copyright (c) 2014 baidu. All rights reserved.
//
#import "BMKLocationManager.h"
#import "BMKLocationKitVersion.h"
#import "BMKLocationPoi.h"
#import "BMKLocation.h"
#import "BMKGeoFenceRegion.h"
#import "BMKGeoFenceManager.h"
#import "BMKLocationReGeocode.h"
#import "BMKLocationAuth.h"

30
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationKitVersion.h

@ -0,0 +1,30 @@
//
// BMKLocationKitVersion.h
// BMKLocationKit
//
// Created by baidu on 17/9/9.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationKitVersion_h
#define BMKLocationKitVersion_h
#import <UIKit/UIKit.h>
/**
*sdk
*sdk版本 : 2.0.0
*@return sdk
*/
UIKIT_EXTERN NSString* BMKLocationKitVersion();
/**
*sdk float版本号
*sdk版本 : 2.0
*@return sdk float版本号
*/
UIKIT_EXTERN float BMKLocationKitFloatVersion();
#endif /* BMKLocationKitVersion_h */

296
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationManager.h

@ -0,0 +1,296 @@
//
// BMKLocationManager.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Availability.h>
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationReGeocode.h"
#import "BMKLocation.h"
/** BMKLocationCoordinateType 枚举坐标系类型
*
*/
typedef NS_ENUM(NSUInteger, BMKLocationCoordinateType)
{
BMKLocationCoordinateTypeBMK09LL = 0, ///<BMK09LL
BMKLocationCoordinateTypeBMK09MC, ///<BMK09MC
BMKLocationCoordinateTypeWGS84, ///<WGS84
BMKLocationCoordinateTypeGCJ02 ///<GCJ02
};
/** BMKLocationNetworkState 枚举识别网络状态类型
*
*/
typedef NS_ENUM(int, BMKLocationNetworkState) {
BMKLocationNetworkStateUnknown = 0, ///<网络状态未知
BMKLocationNetworkStateWifi, ///<网络状态wifi
BMKLocationNetworkStateWifiHotSpot, ///<网络状态连接WIFI移动热点
BMKLocationNetworkStateMobile2G, ///<网络状态移动2G
BMKLocationNetworkStateMobile3G, ///<网络状态移动3G
BMKLocationNetworkStateMobile4G ///<网络状态移动4G
};
///BMKLocation errorDomain
FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKLocationErrorDomain;
///BMKLocation errorCode
typedef NS_ENUM(NSInteger, BMKLocationErrorCode)
{
BMKLocationErrorUnKnown = 0, ///<未知异常
BMKLocationErrorLocFailed = 1, ///<位置未知,持续定位中
BMKLocationErrorDenied = 2, ///<手机不允许定位,请确认用户授予定位权限或者手机是否打开定位开关
BMKLocationErrorNetWork = 3, ///<因为网络原因导致系统定位失败
BMKLocationErrorHeadingFailed = 4, ///<获取手机方向信息失败
BMKLocationErrorGetExtraNetworkFailed = 5, ///<网络原因导致获取额外信息(地址、网络状态等信息)失败
BMKLocationErrorGetExtraParseFailed = 6, ///<网络返回数据解析失败导致获取额外信息(地址、网络状态等信息)失败
BMKLocationErrorFailureAuth = 7, ///<鉴权失败导致无法返回定位、地址等信息
};
/** BMKLAccuracyAuthorization 枚举返回定位精度等级
*
*/
typedef NS_ENUM(NSInteger, BMKLAccuracyAuthorization) {
BMKLAccuracyAuthorizationFullAccuracy, ///<全量定位精度等级,该等级下定位返回结果会尽可能精准
BMKLAccuracyAuthorizationReducedAccuracy, ///<降级定位精度等级,该等级下定位会返回大概5km精度范围的点,定位频率、实时性上也会变慢,比如可能是20分钟之前的点,适用于那些只要求城市级别精度的app使用;ios14之后,该等级受用户控制,需要高等级权限的app需要对应做好适配工作
};
/**
* @brief Block
* @param location CLLocation BMKLocationReGeocode BMKLocation
* @param state
* @param error BMKLocationErrorCode
*/
typedef void (^BMKLocatingCompletionBlock)(BMKLocation * _Nullable location, BMKLocationNetworkState state , NSError * _Nullable error);
@protocol BMKLocationManagerDelegate;
#pragma mark - BMKLocationManager
///BMKLocationManager类。初始化之前请设置 BMKLocationAuth 中的APIKey,否则将无法正常使用服务.
@interface BMKLocationManager : NSObject
///实现了 BMKLocationManagerDelegate 协议的类指针。
@property (nonatomic, weak, nullable) id<BMKLocationManagerDelegate> delegate;
///设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
@property(nonatomic, assign) CLLocationDistance distanceFilter;
///设定定位精度。默认为 kCLLocationAccuracyBest。
@property(nonatomic, assign) CLLocationAccuracy desiredAccuracy;
///设定定位类型。默认为 CLActivityTypeAutomotiveNavigation。
@property(nonatomic, assign) CLActivityType activityType;
///设定定位坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
@property(nonatomic, assign) BMKLocationCoordinateType coordinateType;
///指定定位是否会被系统自动暂停。默认为NO。
@property(nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。由于iOS系统限制,需要在定位未开始之前或定位停止之后,修改该属性的值才会有效果。
@property(nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
///指定单次定位超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。注意: 单次定位超时时间从确定了定位权限(非kCLAuthorizationStatusNotDetermined状态)后开始计算。
@property(nonatomic, assign) NSInteger locationTimeout;
///指定单次定位逆地理超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。
@property(nonatomic, assign) NSInteger reGeocodeTimeout;
///连续定位是否返回逆地理信息,默认YES。
@property (nonatomic, assign) BOOL locatingWithReGeocode;
///定位sdk-v1.3之后,开发者可以选择是否需要最新版本rgc数据,1.9之后默认是需要YES;YES的情况下,定位sdk会实时返回最新的rgc数据,如城市变更等数据都会实时更新
@property (nonatomic, assign) BOOL isNeedNewVersionReGeocode;
///开发者可以指定该用户的id,用于后续统一识别用户,便于查找问题
@property(nonatomic, copy, nullable) NSString * userID;
///返回定位精度等级,IOS14之后用户可以直接控制返回定位的精度等级,开发者可以通过这个值适配不同定位等级下的产品逻辑
@property (nonatomic, readonly) BMKLAccuracyAuthorization accuracyAuthorization;
/**
* @brief NO\n该方法将会根据设定的 desiredAccuracy desiredAccuracy completionBlock返回精度最高的定位信息\n可以通过 stopUpdatingLocation
* @param withReGeocode ()
* @param withNetWorkState ()
* @param completionBlock Block
* @return Request
*/
- (BOOL)requestLocationWithReGeocode:(BOOL)withReGeocode withNetworkState:(BOOL)withNetWorkState completionBlock:(BMKLocatingCompletionBlock _Nonnull)completionBlock;
/**
* @brief cancel掉所有的单次定位请求
*/
- (void)startUpdatingLocation;
/**
* @brief cancel掉所有的单次定位请求
*/
- (void)stopUpdatingLocation;
/**
* @brief
*/
- (void)requestNetworkState;
/**
* @brief
* @return
*/
+ (BOOL)headingAvailable;
/**
* @brief BMKLocationManager开始设备朝向事件回调
*/
- (void)startUpdatingHeading;
/**
* @brief BMKLocationManager停止设备朝向事件回调
*/
- (void)stopUpdatingHeading;
/**
* @brief BMKLocationManager尝试使用高精度室内定位
*/
- (void)tryIndoorLocation;
/**
* @brief BMKLocationManager会关闭高精度室内定位
*/
- (void)stopIndoorLocation;
/**
* @brief
* @param coordinate
* @param srctype
* @param destype bd09ll,bd09mc
* @return
*/
+ (CLLocationCoordinate2D) BMKLocationCoordinateConvert:(CLLocationCoordinate2D) coordinate SrcType:(BMKLocationCoordinateType)srctype DesType:(BMKLocationCoordinateType)destype;
/**
* @brief
* @param coordinate
* @param coortype
* @return
*/
+ (BOOL) BMKLocationDataAvailableForCoordinate:(CLLocationCoordinate2D)coordinate withCoorType:(BMKLocationCoordinateType)coortype;
/**
* @brief
* @return CLAuthorizationStatus
*/
- (CLAuthorizationStatus)authorizationStatus;
/**
* @brief app授予相应权限
* @param purposeKey info.plist中NSLocationTemporaryUsageDescriptionDictionary定义的keyvalue可以详细描述申请全量定位精度等级的原因
* @param completion
* @return
*/
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString * _Nonnull)purposeKey completion:(void(^ _Nullable)(NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
/**
* @brief
* @param purposeKey info.plist中NSLocationTemporaryUsageDescriptionDictionary定义的key
* @return
*/
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString * _Nonnull)purposeKey API_AVAILABLE(ios(14.0));
@end
#pragma mark - BMKLocationManagerDelegate
///BMKLocationManagerDelegate 协议定义了发生错误时的错误回调方法,连续定位的回调方法等。
@protocol BMKLocationManagerDelegate <NSObject>
@optional
/**
* @brief app store关于新的后台定位的审核机制app store要求如果开发者只配置了使用期间定位plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时delegate中调用后台定位api[locationManager requestAlwaysAuthorization]NSLocationWhenInUseUsageDescription使delegate中实现逻辑
* @param manager BMKLocationManager
* @param locationManager CLLocationManager
* @since 1.6.0
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager doRequestAlwaysAuthorization:(CLLocationManager * _Nonnull)locationManager;
/**
* @brief
* @param manager BMKLocationManager
* @param error CLError
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager didFailWithError:(NSError * _Nullable)error;
/**
* @brief
* @param manager BMKLocationManager
* @param location BMKLocation
* @param error
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager didUpdateLocation:(BMKLocation * _Nullable)location orError:(NSError * _Nullable)error;
/**
* @brief
* @param manager BMKLocationManager
* @param status
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status API_DEPRECATED_WITH_REPLACEMENT("-BMKLocationManagerDidChangeAuthorization", ios(4.2, 14.0));
/**
* @brief authorizationStatus或者accuracyAuthorization有变化时回调函数
* @param manager BMKLocationManager
*/
- (void)BMKLocationManagerDidChangeAuthorization:(BMKLocationManager * _Nonnull)manager;
/**
* @brief BMKLocationManager提示需要设备校正回调方法
* @param manager BMKLocationManager类的实例
*/
- (BOOL)BMKLocationManagerShouldDisplayHeadingCalibration:(BMKLocationManager * _Nonnull)manager;
/**
* @brief BMKLocationManager提供设备朝向的回调方法
* @param manager BMKLocationManager类的实例
* @param heading
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager
didUpdateHeading:(CLHeading * _Nullable)heading;
/**
* @brief BMKLocationManager所在App系统网络状态改变的回调事件
* @param manager BMKLocationManager类的实例
* @param state
* @param error
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager
didUpdateNetworkState:(BMKLocationNetworkState)state orError:(NSError * _Nullable)error;
@end

42
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationPoi.h

@ -0,0 +1,42 @@
//
// BMKLocationPoi.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
///描述Poi各属性
@interface BMKLocationPoi : NSObject
///BMKLocationPoi的id属性
@property(nonatomic, copy, readonly) NSString *uid;
///BMKLocationPoi的名字属性
@property(nonatomic, copy, readonly) NSString *name;
///BMKLocationPoi的标签属性
@property(nonatomic, copy, readonly) NSString *tags;
///BMKLocationPoi的地址属性
@property(nonatomic, copy, readonly) NSString *addr;
///BMKLocationPoi的可信度
@property(nonatomic, assign, readonly) float relaiability;
/**
* @brief NSDictionary初始化方法一
*/
- (id)initWithDictionary:(NSDictionary *)dictionary;
/**
* @brief NSDictionary初始化方法二
*/
- (id)initWithTwoDictionary:(NSDictionary *)dictionary;
@end

35
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationPoiRegion.h

@ -0,0 +1,35 @@
//
// BMKLocationPoiRegion.h
// LocationComponent
//
// Created by Jiang,Fangsheng on 2019/9/4.
// Copyright © 2019 baidu. All rights reserved.
//
#ifndef BMKLocationPoiRegion_h
#define BMKLocationPoiRegion_h
///描述PoiRegion各属性
@interface BMKLocationPoiRegion : NSObject
///BMKLocationPoiRegion的方向属性,如『内』、『外』
@property(nonatomic, copy, readonly) NSString *directionDesc;
///BMKLocationPoiRegion的名字属性
@property(nonatomic, copy, readonly) NSString *name;
///BMKLocationPoiRegion的标签属性
@property(nonatomic, copy, readonly) NSString *tags;
/**
* @brief NSDictionary初始化方法一
*/
- (id)initWithDictionary:(NSDictionary *)dictionary;
@end
#endif /* BMKLocationPoiRegion_h */

67
ios/Runner/baidu/BMKLocationKit.framework/Headers/BMKLocationReGeocode.h

@ -0,0 +1,67 @@
//
// BMKLocationReGeocode.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BMKLocationPoi.h"
#import "BMKLocationPoiRegion.h"
///BMKLocationReGeocode类。描述跟地址有关的信息.
@interface BMKLocationReGeocode : NSObject
///国家名字属性
@property(nonatomic, copy, readonly) NSString *country;
///国家编码属性
@property(nonatomic, copy, readonly) NSString *countryCode;
///省份名字属性
@property(nonatomic, copy, readonly) NSString *province;
///城市名字属性
@property(nonatomic, copy, readonly) NSString *city;
///区名字属性
@property(nonatomic, copy, readonly) NSString *district;
///乡镇名字属性
@property(nonatomic, copy, readonly) NSString *town;
///街道名字属性
@property(nonatomic, copy, readonly) NSString *street;
///街道号码属性
@property(nonatomic, copy, readonly) NSString *streetNumber;
///城市编码属性
@property(nonatomic, copy, readonly) NSString *cityCode;
///行政区划编码属性
@property(nonatomic, copy, readonly) NSString *adCode;
///位置语义化结果的定位点在什么地方周围的描述信息
@property(nonatomic, copy, readonly) NSString *locationDescribe;
///位置语义化结果的属性,该定位点周围的poi列表信息
@property(nonatomic, retain, readonly) NSArray<BMKLocationPoi *> *poiList;
///位置语义化结果的定位点在什么地方周围的描述信息
@property(nonatomic, strong, readonly) BMKLocationPoiRegion *poiRegion;
/**
* @brief NSData初始化方法
*/
- (id)initWithReGeocodeString:(NSData *)reGeocodeString;
/**
* @brief JSON初始化方法
*/
- (id)initWithJsonString:(NSData *)jsonString withHighAccuracy:(BOOL)highAcc;
@end

11
ios/Runner/baidu/BMKLocationKit.framework/readme.txt

@ -0,0 +1,11 @@
1、版本:
百度地图iOS定位SDK v2.0.0
2、是否带IDFA:
3、是否为Bitcode:
4、集成方法:
http://lbsyun.baidu.com/index.php?title=ios-locsdk

141
ios/Runner/baidu/Headers/BMKGeoFenceManager.h

@ -0,0 +1,141 @@
//
// BMKGeoFenceManager.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import "BMKGeoFenceRegion.h"
@protocol BMKGeoFenceManagerDelegate;
///地理围栏监听状态类型
typedef NS_OPTIONS(NSUInteger, BMKGeoFenceActiveAction)
{
BMKGeoFenceActiveActionNone = 0, ///< 不进行监听
BMKGeoFenceActiveActionInside = 1 << 0, ///< 在范围内
BMKGeoFenceActiveActionOutside = 1 << 1, ///< 在范围外
BMKGeoFenceActiveActionStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
};
///BMKGeoFence errorDomain
FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKGeoFenceErrorDomain;
///地理围栏错误码
typedef NS_ENUM(NSInteger, BMKGeoFenceErrorCode) {
BMKGeoFenceErrorUnknown = 1, ///< 未知错误
BMKGeoFenceErrorInvalidParameter = 2, ///< 参数错误
BMKGeoFenceErrorFailureConnection = 3, ///< 网络连接异常
BMKGeoFenceErrorFailureAuth = 4, ///< 鉴权失败
BMKGeoFenceErrorNoValidFence = 5, ///< 无可用围栏
BMKGeoFenceErroFailureLocating = 6, ///< 定位错误
};
///地理围栏管理类
@interface BMKGeoFenceManager : NSObject
///实现了 BMKGeoFenceManagerDelegate 协议的类指针。
@property (nonatomic, weak, nullable) id<BMKGeoFenceManagerDelegate> delegate;
///需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。
@property (nonatomic, assign) BMKGeoFenceActiveAction activeAction;
///指定定位是否会被系统自动暂停。默认为NO。
@property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
@property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
/**
* @brief
* @param center
* @param radius 0
* @param type
* @param customID IDSDK原值返回
*/
- (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
/**
* @brief ,
* @param coordinates ,coordinates对应的内存会拷贝,
* @param count 3
* @param type
* @param customID IDSDK原值返回
*/
- (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D * _Nonnull)coordinates count:(NSInteger)count coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
/**
* @brief customID获得指定的围栏customID传nil
* @param customID customID
* @return nil
*/
- (NSArray * _Nullable)geoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
/**
* @brief
* @param region
*/
- (void)removeTheGeoFenceRegion:(BMKGeoFenceRegion * _Nonnull)region;
/**
* @brief customID的围栏
* @param customID customID
*/
- (void)removeGeoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
/**
* @brief
*/
- (void)removeAllGeoFenceRegions;
@end
///地理围栏代理协议,该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。
@protocol BMKGeoFenceManagerDelegate <NSObject>
@optional
/**
* @brief app store关于新的后台定位的审核机制app store要求如果开发者只配置了使用期间定位plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时delegate中调用后台定位api[locationManager requestAlwaysAuthorization]NSLocationWhenInUseUsageDescription使delegate中实现逻辑
* @param manager BMKGeoFenceManager
* @param locationManager CLLocationManager
* @since 1.7.0
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager doRequestAlwaysAuthorization:(CLLocationManager * _Nonnull)locationManager;
/**
* @brief
* @param manager
* @param regions
* @param customID customID
* @param error
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didAddRegionForMonitoringFinished:(NSArray <BMKGeoFenceRegion *> * _Nullable)regions customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
/**
* @brief
* @param manager
* @param region
* @param customID customID
* @param error
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didGeoFencesStatusChangedForRegion:(BMKGeoFenceRegion * _Nullable)region customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
@end

114
ios/Runner/baidu/Headers/BMKGeoFenceRegion.h

@ -0,0 +1,114 @@
//
// BMKGeoFenceRegion.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationManager.h"
///BMKGeoFence Region State
typedef NS_ENUM(NSInteger, BMKGeoFenceRegionStatus)
{
BMKGeoFenceRegionStatusUnknown = 0, ///< 未知
BMKGeoFenceRegionStatusInside = 1, ///< 在范围内
BMKGeoFenceRegionStatusOutside = 1 << 1, ///< 在范围外
BMKGeoFenceRegionStatusStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
};
#pragma mark - BMKGeoFenceRegion
///地理围栏基类,不可直接使用
@interface BMKGeoFenceRegion : NSObject<NSCopying>
///BMKGeoFenceRegion的唯一标识符
@property (nonatomic, copy, readonly) NSString *identifier;
///用户自定义ID,可为nil。
@property (nonatomic, copy, readonly) NSString *customID;
///坐标点和围栏的关系,比如用户的位置和围栏的关系
@property (nonatomic, assign) BMKGeoFenceRegionStatus fenceStatus;
///设定围栏坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
@property(nonatomic, readonly) BMKLocationCoordinateType coordinateType;
///上次发生状态变化的时间
@property(nonatomic, assign)NSTimeInterval lastEventTime;
/**
* @brief
* @param CLLocationCoordinate2D
* @return BMKGeoFenceRegionStatus状态
*/
-(BMKGeoFenceRegionStatus)judgeStatusWithCoor:(CLLocationCoordinate2D)coor;
@end
#pragma mark - BMKLocationCircleRegion
///圆形地理围栏
@interface BMKGeoFenceCircleRegion : BMKGeoFenceRegion
///中心点的经纬度坐标
@property (nonatomic, readonly) CLLocationCoordinate2D center;
///半径,单位:米
@property (nonatomic, readonly) CLLocationDistance radius;
/**
* @brief
* @param customid ID
* @param identityid id
* @param center
* @param radius
* @param type
* @return BMKGeoFenceCircleRegion id
*/
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid center:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coor:(BMKLocationCoordinateType)type;
@end
#pragma mark -BMKGeoFencePolygonRegion
///多边形地理围栏
@interface BMKGeoFencePolygonRegion : BMKGeoFenceRegion
///经纬度坐标点数据
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates;
///经纬度坐标点的个数
@property (nonatomic, readonly) NSInteger count;
/**
* @brief
* @param customid ID
* @param identityid id
* @param coor
* @param count
* @param type
* @return BMKGeoFencePolygonRegion id
*/
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid coor:(CLLocationCoordinate2D *)coor count:(NSInteger)count coor:(BMKLocationCoordinateType)type;
@end

97
ios/Runner/baidu/Headers/BMKLocation.h

@ -0,0 +1,97 @@
//
// BMKLocation.h
// LocationComponent
//
// Created by baidu on 2017/8/16.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocation_h
#define BMKLocation_h
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationReGeocode.h"
/**
* BMKLocationProvider iOS系统定位和其他定位服务结果两种iOS系统定位服务
*
*/
typedef NS_ENUM(int, BMKLocationProvider) {
BMKLocationProviderIOS = 0, //!<位置来源于iOS本身定位
BMKLocationProviderOther //!<位置来源于其他定位服务
};
///描述百度iOS 定位数据
@interface BMKLocation : NSObject
///BMKLocation 位置数据
@property(nonatomic, copy, readonly) CLLocation * _Nullable location;
///BMKLocation 地址数据
@property(nonatomic, copy) BMKLocationReGeocode * _Nullable rgcData;
///BMKLocation 位置来源
@property(nonatomic, assign) BMKLocationProvider provider;
///BMKLocation 位置ID
@property(nonatomic, retain) NSString * _Nullable locationID;
/*
* floorString
*
* Discussion:
* ex:f1
*/
@property(readonly, nonatomic, copy, nullable) NSString *floorString;
/*
* buildingID
*
* Discussion:
* ID
*/
@property(readonly, nonatomic, copy, nullable) NSString *buildingID;
/*
* buildingName
*
* Discussion:
*
*/
@property(readonly, nonatomic, copy, nullable) NSString *buildingName;
/*
* extraInfo
*
* Discussion:
* code识别结果code示例vdr推算结果置信度等
*/
@property(readonly, nonatomic, copy, nullable) NSDictionary * extraInfo;
/**
* @brief BMKLocation实例
* @param loc CLLocation对象
* @param rgc BMKLocationReGeocode对象
* @return BMKLocation id
*/
- (id _Nonnull)initWithLocation:(CLLocation * _Nullable)loc withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
/**
* @brief BMKLocation
* @param location CLLocation
* @param floorString
* @param buildingID ID
* @param buildingName
* @param info
* @return BMKLocation id
*/
-(id _Nonnull)initWithLocation:(CLLocation * _Nullable)location floorString:(NSString * _Nullable)floorString buildingID:(NSString * _Nullable)buildingID
buildingName:(NSString * _Nullable)buildingName extraInfo:(NSDictionary * _Nullable)info withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
@end
#endif /* BMKLocation_h */

56
ios/Runner/baidu/Headers/BMKLocationAuth.h

@ -0,0 +1,56 @@
//
// BMKLocationAuth.h
// LocationComponent
//
// Created by baidu on 2017/4/10.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationAuth_h
#define BMKLocationAuth_h
///定位鉴权错误码
typedef NS_ENUM(NSInteger, BMKLocationAuthErrorCode) {
BMKLocationAuthErrorUnknown = -1, ///< 未知错误
BMKLocationAuthErrorSuccess = 0, ///< 鉴权成功
BMKLocationAuthErrorNetworkFailed = 1, ///< 因网络鉴权失败
BMKLocationAuthErrorFailed = 2, ///< KEY非法鉴权失败
};
///通知Delegate
@protocol BMKLocationAuthDelegate <NSObject>
@optional
/**
*@brief
*@param iError : 0BMKLocationAuthErrorCode
*/
- (void)onCheckPermissionState:(BMKLocationAuthErrorCode)iError;
@end
///BMKLocationAuth类。用于鉴权
@interface BMKLocationAuth : NSObject
///鉴权状态0:成功; 1:网络错误; 2:授权失败
@property(nonatomic, readonly, assign) BMKLocationAuthErrorCode permisionState;
/**
* @brief BMKLocationAuth的单例
*/
+ (BMKLocationAuth*)sharedInstance;
/**
*@brief
*@param key key
*@param delegate
*/
-(void)checkPermisionWithKey:(NSString*)key authDelegate:(id<BMKLocationAuthDelegate>)delegate;
@end
#endif /* BMKLocationAuth_h */

16
ios/Runner/baidu/Headers/BMKLocationComponent.h

@ -0,0 +1,16 @@
//
// BMKLocationComponent.h
// LocationComponent
//
// Created by Baidu on 3/31/14.
// Copyright (c) 2014 baidu. All rights reserved.
//
#import "BMKLocationManager.h"
#import "BMKLocationKitVersion.h"
#import "BMKLocationPoi.h"
#import "BMKLocation.h"
#import "BMKGeoFenceRegion.h"
#import "BMKGeoFenceManager.h"
#import "BMKLocationReGeocode.h"
#import "BMKLocationAuth.h"

30
ios/Runner/baidu/Headers/BMKLocationKitVersion.h

@ -0,0 +1,30 @@
//
// BMKLocationKitVersion.h
// BMKLocationKit
//
// Created by baidu on 17/9/9.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationKitVersion_h
#define BMKLocationKitVersion_h
#import <UIKit/UIKit.h>
/**
*sdk
*sdk版本 : 2.0.0
*@return sdk
*/
UIKIT_EXTERN NSString* BMKLocationKitVersion();
/**
*sdk float版本号
*sdk版本 : 2.0
*@return sdk float版本号
*/
UIKIT_EXTERN float BMKLocationKitFloatVersion();
#endif /* BMKLocationKitVersion_h */

296
ios/Runner/baidu/Headers/BMKLocationManager.h

@ -0,0 +1,296 @@
//
// BMKLocationManager.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Availability.h>
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationReGeocode.h"
#import "BMKLocation.h"
/** BMKLocationCoordinateType 枚举坐标系类型
*
*/
typedef NS_ENUM(NSUInteger, BMKLocationCoordinateType)
{
BMKLocationCoordinateTypeBMK09LL = 0, ///<BMK09LL
BMKLocationCoordinateTypeBMK09MC, ///<BMK09MC
BMKLocationCoordinateTypeWGS84, ///<WGS84
BMKLocationCoordinateTypeGCJ02 ///<GCJ02
};
/** BMKLocationNetworkState 枚举识别网络状态类型
*
*/
typedef NS_ENUM(int, BMKLocationNetworkState) {
BMKLocationNetworkStateUnknown = 0, ///<网络状态未知
BMKLocationNetworkStateWifi, ///<网络状态wifi
BMKLocationNetworkStateWifiHotSpot, ///<网络状态连接WIFI移动热点
BMKLocationNetworkStateMobile2G, ///<网络状态移动2G
BMKLocationNetworkStateMobile3G, ///<网络状态移动3G
BMKLocationNetworkStateMobile4G ///<网络状态移动4G
};
///BMKLocation errorDomain
FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKLocationErrorDomain;
///BMKLocation errorCode
typedef NS_ENUM(NSInteger, BMKLocationErrorCode)
{
BMKLocationErrorUnKnown = 0, ///<未知异常
BMKLocationErrorLocFailed = 1, ///<位置未知,持续定位中
BMKLocationErrorDenied = 2, ///<手机不允许定位,请确认用户授予定位权限或者手机是否打开定位开关
BMKLocationErrorNetWork = 3, ///<因为网络原因导致系统定位失败
BMKLocationErrorHeadingFailed = 4, ///<获取手机方向信息失败
BMKLocationErrorGetExtraNetworkFailed = 5, ///<网络原因导致获取额外信息(地址、网络状态等信息)失败
BMKLocationErrorGetExtraParseFailed = 6, ///<网络返回数据解析失败导致获取额外信息(地址、网络状态等信息)失败
BMKLocationErrorFailureAuth = 7, ///<鉴权失败导致无法返回定位、地址等信息
};
/** BMKLAccuracyAuthorization 枚举返回定位精度等级
*
*/
typedef NS_ENUM(NSInteger, BMKLAccuracyAuthorization) {
BMKLAccuracyAuthorizationFullAccuracy, ///<全量定位精度等级,该等级下定位返回结果会尽可能精准
BMKLAccuracyAuthorizationReducedAccuracy, ///<降级定位精度等级,该等级下定位会返回大概5km精度范围的点,定位频率、实时性上也会变慢,比如可能是20分钟之前的点,适用于那些只要求城市级别精度的app使用;ios14之后,该等级受用户控制,需要高等级权限的app需要对应做好适配工作
};
/**
* @brief Block
* @param location CLLocation BMKLocationReGeocode BMKLocation
* @param state
* @param error BMKLocationErrorCode
*/
typedef void (^BMKLocatingCompletionBlock)(BMKLocation * _Nullable location, BMKLocationNetworkState state , NSError * _Nullable error);
@protocol BMKLocationManagerDelegate;
#pragma mark - BMKLocationManager
///BMKLocationManager类。初始化之前请设置 BMKLocationAuth 中的APIKey,否则将无法正常使用服务.
@interface BMKLocationManager : NSObject
///实现了 BMKLocationManagerDelegate 协议的类指针。
@property (nonatomic, weak, nullable) id<BMKLocationManagerDelegate> delegate;
///设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
@property(nonatomic, assign) CLLocationDistance distanceFilter;
///设定定位精度。默认为 kCLLocationAccuracyBest。
@property(nonatomic, assign) CLLocationAccuracy desiredAccuracy;
///设定定位类型。默认为 CLActivityTypeAutomotiveNavigation。
@property(nonatomic, assign) CLActivityType activityType;
///设定定位坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
@property(nonatomic, assign) BMKLocationCoordinateType coordinateType;
///指定定位是否会被系统自动暂停。默认为NO。
@property(nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。由于iOS系统限制,需要在定位未开始之前或定位停止之后,修改该属性的值才会有效果。
@property(nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
///指定单次定位超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。注意: 单次定位超时时间从确定了定位权限(非kCLAuthorizationStatusNotDetermined状态)后开始计算。
@property(nonatomic, assign) NSInteger locationTimeout;
///指定单次定位逆地理超时时间,默认为10s。最小值是2s。注意单次定位请求前设置。
@property(nonatomic, assign) NSInteger reGeocodeTimeout;
///连续定位是否返回逆地理信息,默认YES。
@property (nonatomic, assign) BOOL locatingWithReGeocode;
///定位sdk-v1.3之后,开发者可以选择是否需要最新版本rgc数据,1.9之后默认是需要YES;YES的情况下,定位sdk会实时返回最新的rgc数据,如城市变更等数据都会实时更新
@property (nonatomic, assign) BOOL isNeedNewVersionReGeocode;
///开发者可以指定该用户的id,用于后续统一识别用户,便于查找问题
@property(nonatomic, copy, nullable) NSString * userID;
///返回定位精度等级,IOS14之后用户可以直接控制返回定位的精度等级,开发者可以通过这个值适配不同定位等级下的产品逻辑
@property (nonatomic, readonly) BMKLAccuracyAuthorization accuracyAuthorization;
/**
* @brief NO\n该方法将会根据设定的 desiredAccuracy desiredAccuracy completionBlock返回精度最高的定位信息\n可以通过 stopUpdatingLocation
* @param withReGeocode ()
* @param withNetWorkState ()
* @param completionBlock Block
* @return Request
*/
- (BOOL)requestLocationWithReGeocode:(BOOL)withReGeocode withNetworkState:(BOOL)withNetWorkState completionBlock:(BMKLocatingCompletionBlock _Nonnull)completionBlock;
/**
* @brief cancel掉所有的单次定位请求
*/
- (void)startUpdatingLocation;
/**
* @brief cancel掉所有的单次定位请求
*/
- (void)stopUpdatingLocation;
/**
* @brief
*/
- (void)requestNetworkState;
/**
* @brief
* @return
*/
+ (BOOL)headingAvailable;
/**
* @brief BMKLocationManager开始设备朝向事件回调
*/
- (void)startUpdatingHeading;
/**
* @brief BMKLocationManager停止设备朝向事件回调
*/
- (void)stopUpdatingHeading;
/**
* @brief BMKLocationManager尝试使用高精度室内定位
*/
- (void)tryIndoorLocation;
/**
* @brief BMKLocationManager会关闭高精度室内定位
*/
- (void)stopIndoorLocation;
/**
* @brief
* @param coordinate
* @param srctype
* @param destype bd09ll,bd09mc
* @return
*/
+ (CLLocationCoordinate2D) BMKLocationCoordinateConvert:(CLLocationCoordinate2D) coordinate SrcType:(BMKLocationCoordinateType)srctype DesType:(BMKLocationCoordinateType)destype;
/**
* @brief
* @param coordinate
* @param coortype
* @return
*/
+ (BOOL) BMKLocationDataAvailableForCoordinate:(CLLocationCoordinate2D)coordinate withCoorType:(BMKLocationCoordinateType)coortype;
/**
* @brief
* @return CLAuthorizationStatus
*/
- (CLAuthorizationStatus)authorizationStatus;
/**
* @brief app授予相应权限
* @param purposeKey info.plist中NSLocationTemporaryUsageDescriptionDictionary定义的keyvalue可以详细描述申请全量定位精度等级的原因
* @param completion
* @return
*/
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString * _Nonnull)purposeKey completion:(void(^ _Nullable)(NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
/**
* @brief
* @param purposeKey info.plist中NSLocationTemporaryUsageDescriptionDictionary定义的key
* @return
*/
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString * _Nonnull)purposeKey API_AVAILABLE(ios(14.0));
@end
#pragma mark - BMKLocationManagerDelegate
///BMKLocationManagerDelegate 协议定义了发生错误时的错误回调方法,连续定位的回调方法等。
@protocol BMKLocationManagerDelegate <NSObject>
@optional
/**
* @brief app store关于新的后台定位的审核机制app store要求如果开发者只配置了使用期间定位plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时delegate中调用后台定位api[locationManager requestAlwaysAuthorization]NSLocationWhenInUseUsageDescription使delegate中实现逻辑
* @param manager BMKLocationManager
* @param locationManager CLLocationManager
* @since 1.6.0
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager doRequestAlwaysAuthorization:(CLLocationManager * _Nonnull)locationManager;
/**
* @brief
* @param manager BMKLocationManager
* @param error CLError
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager didFailWithError:(NSError * _Nullable)error;
/**
* @brief
* @param manager BMKLocationManager
* @param location BMKLocation
* @param error
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager didUpdateLocation:(BMKLocation * _Nullable)location orError:(NSError * _Nullable)error;
/**
* @brief
* @param manager BMKLocationManager
* @param status
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status API_DEPRECATED_WITH_REPLACEMENT("-BMKLocationManagerDidChangeAuthorization", ios(4.2, 14.0));
/**
* @brief authorizationStatus或者accuracyAuthorization有变化时回调函数
* @param manager BMKLocationManager
*/
- (void)BMKLocationManagerDidChangeAuthorization:(BMKLocationManager * _Nonnull)manager;
/**
* @brief BMKLocationManager提示需要设备校正回调方法
* @param manager BMKLocationManager类的实例
*/
- (BOOL)BMKLocationManagerShouldDisplayHeadingCalibration:(BMKLocationManager * _Nonnull)manager;
/**
* @brief BMKLocationManager提供设备朝向的回调方法
* @param manager BMKLocationManager类的实例
* @param heading
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager
didUpdateHeading:(CLHeading * _Nullable)heading;
/**
* @brief BMKLocationManager所在App系统网络状态改变的回调事件
* @param manager BMKLocationManager类的实例
* @param state
* @param error
*/
- (void)BMKLocationManager:(BMKLocationManager * _Nonnull)manager
didUpdateNetworkState:(BMKLocationNetworkState)state orError:(NSError * _Nullable)error;
@end

42
ios/Runner/baidu/Headers/BMKLocationPoi.h

@ -0,0 +1,42 @@
//
// BMKLocationPoi.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
///描述Poi各属性
@interface BMKLocationPoi : NSObject
///BMKLocationPoi的id属性
@property(nonatomic, copy, readonly) NSString *uid;
///BMKLocationPoi的名字属性
@property(nonatomic, copy, readonly) NSString *name;
///BMKLocationPoi的标签属性
@property(nonatomic, copy, readonly) NSString *tags;
///BMKLocationPoi的地址属性
@property(nonatomic, copy, readonly) NSString *addr;
///BMKLocationPoi的可信度
@property(nonatomic, assign, readonly) float relaiability;
/**
* @brief NSDictionary初始化方法一
*/
- (id)initWithDictionary:(NSDictionary *)dictionary;
/**
* @brief NSDictionary初始化方法二
*/
- (id)initWithTwoDictionary:(NSDictionary *)dictionary;
@end

35
ios/Runner/baidu/Headers/BMKLocationPoiRegion.h

@ -0,0 +1,35 @@
//
// BMKLocationPoiRegion.h
// LocationComponent
//
// Created by Jiang,Fangsheng on 2019/9/4.
// Copyright © 2019 baidu. All rights reserved.
//
#ifndef BMKLocationPoiRegion_h
#define BMKLocationPoiRegion_h
///描述PoiRegion各属性
@interface BMKLocationPoiRegion : NSObject
///BMKLocationPoiRegion的方向属性,如『内』、『外』
@property(nonatomic, copy, readonly) NSString *directionDesc;
///BMKLocationPoiRegion的名字属性
@property(nonatomic, copy, readonly) NSString *name;
///BMKLocationPoiRegion的标签属性
@property(nonatomic, copy, readonly) NSString *tags;
/**
* @brief NSDictionary初始化方法一
*/
- (id)initWithDictionary:(NSDictionary *)dictionary;
@end
#endif /* BMKLocationPoiRegion_h */

67
ios/Runner/baidu/Headers/BMKLocationReGeocode.h

@ -0,0 +1,67 @@
//
// BMKLocationReGeocode.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BMKLocationPoi.h"
#import "BMKLocationPoiRegion.h"
///BMKLocationReGeocode类。描述跟地址有关的信息.
@interface BMKLocationReGeocode : NSObject
///国家名字属性
@property(nonatomic, copy, readonly) NSString *country;
///国家编码属性
@property(nonatomic, copy, readonly) NSString *countryCode;
///省份名字属性
@property(nonatomic, copy, readonly) NSString *province;
///城市名字属性
@property(nonatomic, copy, readonly) NSString *city;
///区名字属性
@property(nonatomic, copy, readonly) NSString *district;
///乡镇名字属性
@property(nonatomic, copy, readonly) NSString *town;
///街道名字属性
@property(nonatomic, copy, readonly) NSString *street;
///街道号码属性
@property(nonatomic, copy, readonly) NSString *streetNumber;
///城市编码属性
@property(nonatomic, copy, readonly) NSString *cityCode;
///行政区划编码属性
@property(nonatomic, copy, readonly) NSString *adCode;
///位置语义化结果的定位点在什么地方周围的描述信息
@property(nonatomic, copy, readonly) NSString *locationDescribe;
///位置语义化结果的属性,该定位点周围的poi列表信息
@property(nonatomic, retain, readonly) NSArray<BMKLocationPoi *> *poiList;
///位置语义化结果的定位点在什么地方周围的描述信息
@property(nonatomic, strong, readonly) BMKLocationPoiRegion *poiRegion;
/**
* @brief NSData初始化方法
*/
- (id)initWithReGeocodeString:(NSData *)reGeocodeString;
/**
* @brief JSON初始化方法
*/
- (id)initWithJsonString:(NSData *)jsonString withHighAccuracy:(BOOL)highAcc;
@end

241
lib/address/address_map_page.dart

@ -1,16 +1,20 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:android_intent_plus/android_intent.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -23,28 +27,15 @@ class AddressMapPage extends StatefulWidget {
} }
class _AddressMapPage extends State<AddressMapPage> { class _AddressMapPage extends State<AddressMapPage> {
//使true
CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
// //
void _loadCustomData() async { void _loadCustomData() async {
if (null == _customStyleOptions) {
_customStyleOptions = CustomStyleOptions(false);
}
ByteData styleByteData =
await rootBundle.load('assets/map_style/style.data');
_customStyleOptions.styleData = styleByteData.buffer.asUint8List();
ByteData styleExtraByteData =
await rootBundle.load('assets/map_style/style_extra.data');
_customStyleOptions.styleExtraData =
styleExtraByteData.buffer.asUint8List();
//setState修改CustomStyleOptions的enable为true
setState(() { setState(() {
_customStyleOptions.enabled = true; _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0);
}); });
} }
AMapFlutterLocation aMapFlutterLocation; LocationFlutterPlugin aMapFlutterLocation;
String city = "武汉市"; String city = "武汉市";
String keyWord = ""; String keyWord = "";
@ -52,7 +43,6 @@ class _AddressMapPage extends State<AddressMapPage> {
void dispose() { void dispose() {
super.dispose(); super.dispose();
aMapFlutterLocation.stopLocation(); aMapFlutterLocation.stopLocation();
aMapFlutterLocation.destroy();
} }
ApiService apiService; ApiService apiService;
@ -67,44 +57,53 @@ class _AddressMapPage extends State<AddressMapPage> {
}); });
if (aMapFlutterLocation == null) { if (aMapFlutterLocation == null) {
AMapFlutterLocation.setApiKey("f39d1daa020a56f208eb2519f63e9534",
"feaae7986201b571cace1b83728be5bb"); aMapFlutterLocation = LocationFlutterPlugin();
aMapFlutterLocation = AMapFlutterLocation(); aMapFlutterLocation.onResultCallback().listen((event) {
aMapFlutterLocation.onLocationChanged().listen((event) {
print("event: ${jsonEncode(event)}"); print("event: ${jsonEncode(event)}");
if (event != null && if (event != null &&
event["latitude"] != null && event["latitude"] != null &&
event["longitude"] != null) { event["longitude"] != null) {
city = event["city"]; city = event["city"];
LatLng latLng; BMFCoordinate latLng;
if (event["latitude"] is String && event["longitude"] is String) { if (event["latitude"] is String && event["longitude"] is String) {
latLng = LatLng(double.tryParse(event["latitude"]), latLng = BMFCoordinate(double.tryParse(event["latitude"]),
double.tryParse(event["longitude"])); double.tryParse(event["longitude"]));
} else { } else {
latLng = LatLng(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"], event["longitude"]);
} }
saveLatLng(latLng); saveLatLng(latLng);
if (_mapController != null) if (_mapController != null)
_mapController.moveCamera( _mapController.updateMapOptions(
CameraUpdate.newCameraPosition( BMFMapOptions(
CameraPosition( center: latLng,
target: latLng, zoomLevel: 15,
zoom: 15.0,
),
), ),
); );
searchPoi(latLng); searchPoi(latLng);
} }
}); });
} }
aMapFlutterLocation.setLocationOption(
AMapLocationOption( aMapFlutterLocation.prepareLoc({
needAddress: true, "coorType": "bd09ll",
onceLocation: true, "isNeedAddres": false,
locationMode: AMapLocationMode.Hight_Accuracy, "isNeedAltitude": false,
pausesLocationUpdatesAutomatically: true, "isNeedLocationPoiList": false,
), "isNeedLocationDescribe": false,
); "isNeedNewVersionRgc": false,
"scanspan": 0,
"openGps": true,
"locationMode": 2,
}, {
"locationMode": "kCLLocationAccuracyBest",
"locationTimeout": 10,
"reGeocodeTimeout": 10,
"activityType": "CLActivityTypeAutomotiveNavigation",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"isNeedNewVersionRgc": false,
});
_loadCustomData(); _loadCustomData();
@ -114,7 +113,7 @@ class _AddressMapPage extends State<AddressMapPage> {
List<Address> poiList; List<Address> poiList;
searchPoi(LatLng latLng) async { searchPoi(BMFCoordinate latLng) async {
keyWord = textEditingController.text; keyWord = textEditingController.text;
var addressPoi = await apiService.searchPoi( var addressPoi = await apiService.searchPoi(
"${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1); "${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1);
@ -139,45 +138,87 @@ class _AddressMapPage extends State<AddressMapPage> {
setState(() {}); setState(() {});
} }
//{"parent":[],"distance":"7","pcode":"420000","importance":[],
// "recommend":"0","type":"商务住宅;住宅区;住宅区","photos":[],"discount_num":"0","gridcode":"4514626711",
// "typecode":"120300","shopinfo":"0","poiweight":[],"citycode":"027","adname":"武昌区","children":[],
// "alias":[],"tel":[],"id":"B0G2YMOFHL","tag":[],"event":[],"entr_location":[],"indoor_map":"0",
// "email":[],"timestamp":"2021-06-02 00:19:39","website":[],"address":"中北路86号","adcode":"420106",
// "pname":"湖北省","biz_type":[],"cityname":"武汉市","postcode":[],"match":"0","business_area":"中北路",
// "indoor_data":,"childtype":[],"exit_location":[],
// "name":"万象春天","location":"114.343968,30.554595","shopid":[],"navi_poiid":[],"groupbuy_num":"0"}
startLocation() async { startLocation() async {
// await AmapCore.init('feaae7986201b571cace1b83728be5bb'); if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { enableLocation();
// bool isShown = await Permission.contacts.shouldShowRequestRationale; return;
// if (isShown) { }
// SmartDialog.showToast("shouldShowRequest");
// } if (await Permission.location.isPermanentlyDenied) {
if (await Permission.location.isPermanentlyDenied) { requestDialog();
//openAppSettings } else if (await Permission.location.isGranted) {
} else if (await Permission.location.isGranted) { SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
aMapFlutterLocation.startLocation(); aMapFlutterLocation.startLocation();
Future.delayed(Duration(seconds: 6), () {
SmartDialog.dismiss();
});
} else if (await Permission.location.isUndetermined) {
await Permission.location.request();
} else {
if (Platform.isIOS) {
//
requestDialog();
} else { } else {
await Permission.location.request(); await Permission.location.request();
startLocation();
} }
} else {
//enabledLocation
// _mapController.getMapContentApprovalNumber()
// _mapController
} }
} }
AMapController _mapController; enableLocation() {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_permission_location_bg.png",
S.of(context).nindingweigongnengweikaiqi,
S.of(context).weilexiangnintuijianfujindemendianxinxi,
S.of(context).dakaidingwei,
(result) async {
if (result) {
final AndroidIntent intent = AndroidIntent(
action: 'action_location_source_settings',
package: "com.zsw.huixiang");
await intent.launch();
// startLocation();
}
},
heightRatioWithWidth: 0.82,
);
},
);
}
void onMapCreated(AMapController controller) { requestDialog() {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_permission_location_bg.png",
S.of(context).nindingweiquanxianweiyunxu,
S.of(context).weilexiangnintuijianfujindemendianxinxi,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await openAppSettings();
if (await Permission.location.isGranted) {
startLocation();
}
}
},
heightRatioWithWidth: 0.82,
);
});
}
BMFMapController _mapController;
void onMapCreated(BMFMapController controller) {
setState(() { setState(() {
_mapController = controller; _mapController = controller;
}); });
} }
saveLatLng(LatLng latLng) async { saveLatLng(BMFCoordinate latLng) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}"); await prefs.setString("longitude", "${latLng.longitude}");
@ -187,25 +228,24 @@ class _AddressMapPage extends State<AddressMapPage> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
setState(() { setState(() {
if (_mapController != null) { if (_mapController != null) {
_mapController _mapController.updateMapOptions(
.moveCamera(CameraUpdate.newCameraPosition(CameraPosition( BMFMapOptions(
target: LatLng(double.tryParse(value.getString("latitude")), center: BMFCoordinate(
double.tryParse(value.getString("longitude"))), double.tryParse(value.getString("latitude")),
zoom: 15.0, double.tryParse(value.getString("longitude"))),
))); zoomLevel: 15,
),
);
} }
}) })
}); });
} }
AMapWidget map; BMFMapWidget map;
LatLng center = LatLng(30.553111, 114.342366); BMFCoordinate center = BMFCoordinate(30.553111, 114.342366);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AMapApiKey aMapApiKeys = AMapApiKey(
androidKey: 'f39d1daa020a56f208eb2519f63e9534',
iosKey: 'feaae7986201b571cace1b83728be5bb');
return Scaffold( return Scaffold(
body: Column( body: Column(
children: [ children: [
@ -213,29 +253,28 @@ class _AddressMapPage extends State<AddressMapPage> {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
child: AMapWidget( child: BMFMapWidget(
initialCameraPosition: CameraPosition( mapOptions: BMFMapOptions(
target: LatLng(30.553111, 114.342366), center: BMFCoordinate(30.553111, 114.342366),
zoom: 12.0, zoomLevel: 12,
), ),
onMapCreated: onMapCreated, onBMFMapCreated: onMapCreated,
onCameraMoveEnd: (cameraPosition) { // onCameraMoveEnd: (cameraPosition) {
center = cameraPosition.target; // center = cameraPosition.target;
searchPoi(center); // searchPoi(center);
}, // },
onCameraMove: (cameraPosition) { // onCameraMove: (cameraPosition) {
center = cameraPosition.target; // center = cameraPosition.target;
setState(() {}); // setState(() {});
}, // },
apiKey: aMapApiKeys,
// markers: [Marker(position: center)].toSet(), // markers: [Marker(position: center)].toSet(),
touchPoiEnabled: true, // touchPoiEnabled: true,
scrollGesturesEnabled: true, // scrollGesturesEnabled: true,
customStyleOptions: _customStyleOptions, // customStyleOptions: _customStyleOptions,
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[ // gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
Factory<OneSequenceGestureRecognizer>( // Factory<OneSequenceGestureRecognizer>(
() => EagerGestureRecognizer()) // () => EagerGestureRecognizer())
].toSet(), // ].toSet(),
), ),
), ),
Center( Center(

12
lib/main.dart

@ -5,6 +5,7 @@ import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/address/address_map_page.dart'; import 'package:huixiang/address/address_map_page.dart';
import 'package:huixiang/address/edit_address_page.dart'; import 'package:huixiang/address/edit_address_page.dart';
@ -57,6 +58,7 @@ import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_register.dart'; import 'package:sharesdk_plugin/sharesdk_register.dart';
import 'package:tpns_flutter_plugin/android/xg_android_api.dart'; import 'package:tpns_flutter_plugin/android/xg_android_api.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'home/guide_page.dart'; import 'home/guide_page.dart';
import 'main_page.dart'; import 'main_page.dart';
@ -112,8 +114,16 @@ initSdk() async {
"64020361b8ec4c99936c0e3999a9f249", "https://hx.lotus-wallet.com/app/"); "64020361b8ec4c99936c0e3999a9f249", "https://hx.lotus-wallet.com/app/");
shareSDKRegister.setupFacebook( shareSDKRegister.setupFacebook(
"523308712059457", "d3a1b6377100871799d8973fbe84794a", "回乡"); "523308712059457", "d3a1b6377100871799d8973fbe84794a", "回乡");
SharesdkPlugin.regist(shareSDKRegister); SharesdkPlugin.regist(shareSDKRegister);
if(Platform.isIOS){
LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR");
BMFMapSDK.setApiKeyAndCoordType(
'7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.BD09LL);
} else if(Platform.isAndroid) {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL);
}
} }
EventBus eventBus = EventBus(sync: true); EventBus eventBus = EventBus(sync: true);

149
lib/order/store_selector_page.dart

@ -1,8 +1,11 @@
import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'dart:io';
import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:android_intent_plus/android_intent.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -11,9 +14,9 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/loading_view.dart'; import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class StoreSelectorPage extends StatefulWidget { class StoreSelectorPage extends StatefulWidget {
@ -26,13 +29,12 @@ class StoreSelectorPage extends StatefulWidget {
class _StoreSelectorPage extends State<StoreSelectorPage> { class _StoreSelectorPage extends State<StoreSelectorPage> {
ApiService apiService; ApiService apiService;
AMapFlutterLocation aMapFlutterLocation; LocationFlutterPlugin aMapFlutterLocation;
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
aMapFlutterLocation.stopLocation(); aMapFlutterLocation.stopLocation();
aMapFlutterLocation.destroy();
} }
@override @override
@ -45,20 +47,18 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
}); });
if (aMapFlutterLocation == null) { if (aMapFlutterLocation == null) {
AMapFlutterLocation.setApiKey("f39d1daa020a56f208eb2519f63e9534", aMapFlutterLocation = LocationFlutterPlugin();
"feaae7986201b571cace1b83728be5bb"); aMapFlutterLocation.onResultCallback().listen((event) {
aMapFlutterLocation = AMapFlutterLocation();
aMapFlutterLocation.onLocationChanged().listen((event) {
if (event != null && if (event != null &&
event["latitude"] != null && event["latitude"] != null &&
event["longitude"] != null) { event["longitude"] != null) {
print("location: $event"); print("location: $event");
aMapFlutterLocation.stopLocation(); aMapFlutterLocation.stopLocation();
if (event["latitude"] is String && event["longitude"] is String) { if (event["latitude"] is String && event["longitude"] is String) {
latLng = LatLng(double.tryParse(event["latitude"]), latLng = BMFCoordinate(double.tryParse(event["latitude"]),
double.tryParse(event["longitude"])); double.tryParse(event["longitude"]));
} else { } else {
latLng = LatLng(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"], event["longitude"]);
} }
if (Navigator.of(context).canPop()) { if (Navigator.of(context).canPop()) {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -70,18 +70,31 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
} }
}); });
} }
aMapFlutterLocation.setLocationOption(AMapLocationOption(
needAddress: true, aMapFlutterLocation.prepareLoc({
onceLocation: true, "coorType": "bd09ll",
locationInterval: 100000, "isNeedAddres": false,
locationMode: AMapLocationMode.Hight_Accuracy, "isNeedAltitude": false,
desiredAccuracy: DesiredAccuracy.ThreeKilometers, "isNeedLocationPoiList": false,
pausesLocationUpdatesAutomatically: true, "isNeedLocationDescribe": false,
)); "isNeedNewVersionRgc": false,
"scanspan": 0,
"openGps": true,
"locationMode": 2,
}, {
"locationMode": "kCLLocationAccuracyBest",
"locationTimeout": 10,
"reGeocodeTimeout": 10,
"activityType": "CLActivityTypeAutomotiveNavigation",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"isNeedNewVersionRgc": false,
});
startLocation(); startLocation();
} }
saveLatLng(LatLng latLng, province, city, district) async { saveLatLng(BMFCoordinate latLng, province, city, district) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}"); await prefs.setString("longitude", "${latLng.longitude}");
@ -91,40 +104,80 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
} }
List<Store> storeList; List<Store> storeList;
LatLng latLng; BMFCoordinate latLng;
startLocation() async { startLocation() async {
if (await Permission.locationWhenInUse.serviceStatus.isEnabled) { if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
// bool isShown = await Permission.contacts.shouldShowRequestRationale; enableLocation();
// if (isShown) { return;
// SmartDialog.showToast("shouldShowRequestRationale"); }
// }
if (await Permission.location.isPermanentlyDenied) { if (await Permission.location.isPermanentlyDenied) {
openAppSettings(); requestDialog();
getLatLng(); } else if (await Permission.location.isGranted) {
} else if (await Permission.location.isGranted) { SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
showCupertinoDialog( aMapFlutterLocation.startLocation();
context: context, Future.delayed(Duration(seconds: 6), () {
barrierDismissible: true, SmartDialog.dismiss();
builder: (context) { });
return LoadingView(); } else if (await Permission.location.isUndetermined) {
}); await Permission.location.request();
aMapFlutterLocation.startLocation(); } else {
if (Platform.isIOS) {
//
requestDialog();
} else { } else {
PermissionStatus permissionStatus = await Permission.location.request(); await Permission.location.request();
if (permissionStatus.isGranted) {
startLocation();
} else {
openAppSettings();
getLatLng();
}
} }
} else {
//enabledLocation
getLatLng();
} }
} }
enableLocation() {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_permission_location_bg.png",
S.of(context).nindingweigongnengweikaiqi,
S.of(context).weilexiangnintuijianfujindemendianxinxi,
S.of(context).dakaidingwei,
(result) async {
if (result) {
final AndroidIntent intent = AndroidIntent(
action: 'action_location_source_settings',
package: "com.zsw.huixiang");
await intent.launch();
// startLocation();
}
},
heightRatioWithWidth: 0.82,
);
},
);
}
requestDialog() {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_permission_location_bg.png",
S.of(context).nindingweiquanxianweiyunxu,
S.of(context).weilexiangnintuijianfujindemendianxinxi,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await openAppSettings();
if (await Permission.location.isGranted) {
startLocation();
}
}
},
heightRatioWithWidth: 0.82,
);
});
}
getLatLng() async { getLatLng() async {
SharedPreferences.getInstance().then( SharedPreferences.getInstance().then(
(value) => { (value) => {
@ -134,7 +187,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
value.containsKey("city") && value.containsKey("city") &&
value.containsKey("district")) value.containsKey("district"))
{ {
latLng = LatLng(double.tryParse(value.getString("latitude")), latLng = BMFCoordinate(double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))), double.tryParse(value.getString("longitude"))),
queryStore( queryStore(
value.getString("latitude"), value.getString("latitude"),

12
lib/union/store_details_page.dart

@ -119,11 +119,6 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
SharesdkPlugin.share(platform, params, SharesdkPlugin.share(platform, params,
(state, userData, contentEntity, error) { (state, userData, contentEntity, error) {
print("share!$state"); print("share!$state");
print("share!$platform");
print("share!$userData");
print("share!$contentEntity");
print("share!$error");
print("share!");
}); });
}); });
}); });
@ -239,11 +234,6 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
}, },
customRender: { customRender: {
"video": (context, parsedChild, attributes, element) { "video": (context, parsedChild, attributes, element) {
print("video attributes: ${element.attributes}");
print("video attributes: ${element.attributeSpans}");
print(
"video attributes: ${element.children.first.attributes["src"]}");
print("video attributes: $parsedChild");
return videoWidget( return videoWidget(
double.tryParse(attributes['width'] ?? ""), double.tryParse(attributes['width'] ?? ""),
double.tryParse(element.attributes['height'] ?? ""), double.tryParse(element.attributes['height'] ?? ""),
@ -251,8 +241,6 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
element.attributes["sandbox"]); element.attributes["sandbox"]);
}, },
"iframe": (context, parsedChild, attributes, element) { "iframe": (context, parsedChild, attributes, element) {
print("iframe attributes: ${element.toString()}");
print("iframe attributes: $parsedChild");
return videoWidget( return videoWidget(
double.tryParse(attributes['width'] ?? ""), double.tryParse(attributes['width'] ?? ""),
double.tryParse(element.attributes['height'] ?? ""), double.tryParse(element.attributes['height'] ?? ""),

343
lib/union/union_page.dart

@ -1,15 +1,14 @@
import 'dart:io'; import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:amap_flutter_location/amap_flutter_location.dart';
import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:android_intent_plus/android_intent.dart'; import 'package:android_intent_plus/android_intent.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
@ -21,15 +20,13 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/item_title.dart'; import 'package:huixiang/view_widget/item_title.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'dart:typed_data';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
class UnionPage extends StatefulWidget { class UnionPage extends StatefulWidget {
@override @override
@ -41,27 +38,15 @@ class UnionPage extends StatefulWidget {
class _UnionPage extends State<UnionPage> class _UnionPage extends State<UnionPage>
with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { with AutomaticKeepAliveClientMixin, WidgetsBindingObserver {
//使true //使true
CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
// //
void _loadCustomData() async { void _loadCustomData() async {
if (null == _customStyleOptions) {
_customStyleOptions = CustomStyleOptions(false);
}
ByteData styleByteData =
await rootBundle.load('assets/map_style/style.data');
_customStyleOptions.styleData = styleByteData.buffer.asUint8List();
ByteData styleExtraByteData =
await rootBundle.load('assets/map_style/style_extra.data');
_customStyleOptions.styleExtraData =
styleExtraByteData.buffer.asUint8List();
//setState修改CustomStyleOptions的enable为true
setState(() { setState(() {
_customStyleOptions.enabled = true; _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0);
}); });
} }
AMapFlutterLocation aMapFlutterLocation; LocationFlutterPlugin aMapFlutterLocation;
RefreshController refreshController = RefreshController refreshController =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
@ -70,7 +55,6 @@ class _UnionPage extends State<UnionPage>
super.dispose(); super.dispose();
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
aMapFlutterLocation.stopLocation(); aMapFlutterLocation.stopLocation();
aMapFlutterLocation.destroy();
refreshController.dispose(); refreshController.dispose();
} }
@ -105,19 +89,17 @@ class _UnionPage extends State<UnionPage>
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
if (aMapFlutterLocation == null) { if (aMapFlutterLocation == null) {
AMapFlutterLocation.setApiKey("f39d1daa020a56f208eb2519f63e9534", aMapFlutterLocation = LocationFlutterPlugin();
"feaae7986201b571cace1b83728be5bb"); aMapFlutterLocation.onResultCallback().listen((event) {
aMapFlutterLocation = AMapFlutterLocation();
aMapFlutterLocation.onLocationChanged().listen((event) {
if (event != null && if (event != null &&
event["latitude"] != null && event["latitude"] != null &&
event["longitude"] != null) { event["longitude"] != null) {
print("location: $event"); print("location: $event");
if (event["latitude"] is String && event["longitude"] is String) { if (event["latitude"] is String && event["longitude"] is String) {
latLng = LatLng(double.tryParse(event["latitude"]), latLng = BMFCoordinate(double.tryParse(event["latitude"]),
double.tryParse(event["longitude"])); double.tryParse(event["longitude"]));
} else { } else {
latLng = LatLng(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"], event["longitude"]);
} }
saveLatLng( saveLatLng(
latLng, event["province"], event["city"], event["district"]); latLng, event["province"], event["city"], event["district"]);
@ -129,12 +111,10 @@ class _UnionPage extends State<UnionPage>
event["district"], event["district"],
editingController.text); editingController.text);
if (_mapController != null) if (_mapController != null)
_mapController.moveCamera( _mapController.updateMapOptions(BMFMapOptions(
CameraUpdate.newCameraPosition(CameraPosition( center: latLng,
target: latLng, zoomLevel: 15,
zoom: 15.0, ));
)),
);
} }
}); });
@ -146,15 +126,25 @@ class _UnionPage extends State<UnionPage>
}); });
} }
aMapFlutterLocation.setLocationOption(AMapLocationOption( aMapFlutterLocation.prepareLoc({
needAddress: true, "coorType": "bd09ll",
onceLocation: true, "isNeedAddres": false,
locationMode: AMapLocationMode.Hight_Accuracy, "isNeedAltitude": false,
desiredAccuracy: DesiredAccuracy.HundredMeters, "isNeedLocationPoiList": false,
desiredLocationAccuracyAuthorizationMode: "isNeedLocationDescribe": false,
AMapLocationAccuracyAuthorizationMode.FullAndReduceAccuracy, "isNeedNewVersionRgc": false,
pausesLocationUpdatesAutomatically: true, "scanspan": 0,
)); "openGps": true,
"locationMode": 2,
}, {
"locationMode": "kCLLocationAccuracyBest",
"locationTimeout": 10,
"reGeocodeTimeout": 10,
"activityType": "CLActivityTypeAutomotiveNavigation",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"isNeedNewVersionRgc": false,
});
_loadCustomData(); _loadCustomData();
@ -162,9 +152,9 @@ class _UnionPage extends State<UnionPage>
startLocation(); startLocation();
} }
LatLng latLng; BMFCoordinate latLng;
saveLatLng(LatLng latLng, province, city, district) async { saveLatLng(BMFCoordinate latLng, province, city, district) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("latitude", "${latLng.latitude}");
await prefs.setString("longitude", "${latLng.longitude}"); await prefs.setString("longitude", "${latLng.longitude}");
@ -186,7 +176,7 @@ class _UnionPage extends State<UnionPage>
value.containsKey("city") && value.containsKey("city") &&
value.containsKey("district")) value.containsKey("district"))
{ {
latLng = LatLng(double.tryParse(value.getString("latitude")), latLng = BMFCoordinate(double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))), double.tryParse(value.getString("longitude"))),
queryStore( queryStore(
value.getString("latitude"), value.getString("latitude"),
@ -198,14 +188,10 @@ class _UnionPage extends State<UnionPage>
), ),
setState(() { setState(() {
if (_mapController != null) { if (_mapController != null) {
_mapController.moveCamera( _mapController.updateMapOptions(BMFMapOptions(
CameraUpdate.newCameraPosition( center: latLng,
CameraPosition( zoomLevel: 15,
target: latLng, ));
zoom: 15.0,
),
),
);
} }
}) })
} }
@ -235,7 +221,7 @@ class _UnionPage extends State<UnionPage>
storeList = (baseData.data as List<dynamic>) storeList = (baseData.data as List<dynamic>)
.map((e) => Store.fromJson(e)) .map((e) => Store.fromJson(e))
.toList(); .toList();
buildMarker(); // buildMarker();
refreshController.refreshCompleted(); refreshController.refreshCompleted();
if (mounted) setState(() {}); if (mounted) setState(() {});
} else { } else {
@ -243,34 +229,20 @@ class _UnionPage extends State<UnionPage>
} }
} }
RepaintBoundary repaintBoundary; // buildMarker() async {
// markers.clear();
buildMarker() async { // markers.addAll(storeList.map((element) => BMFMarker(
markers.clear(); // position: BMFCoordinate(double.tryParse(element.latitude),
// double.tryParse(element.longitude)),
BitmapDescriptor bitmapDescriptor = await BitmapDescriptor.fromAssetImage( // centerOffset: BMFPoint(0.5, 0.9),
ImageConfiguration( // enabled: false,
bundle: DefaultAssetBundle.of(context), // icon: "assets/image/icon_map_marker.png",
devicePixelRatio: MediaQuery.of(context)?.devicePixelRatio ?? 1.0, // draggable: false,
locale: Localizations.localeOf(context), // )));
textDirection: Directionality.of(context), // if (mounted) setState(() {});
size: Size(35.w, 35.h), // }
platform: defaultTargetPlatform, //
), // List<BMFMarker> markers = [];
"assets/image/icon_map_marker.png");
markers.addAll(storeList.map((element) => Marker(
position: LatLng(double.tryParse(element.latitude),
double.tryParse(element.longitude)),
anchor: Offset(0.5, 0.9),
clickable: false,
icon: bitmapDescriptor,
infoWindowEnable: true,
)));
if (mounted) setState(() {});
}
List<Marker> markers = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -290,7 +262,7 @@ class _UnionPage extends State<UnionPage>
PreferredSize( PreferredSize(
preferredSize: Size(double.infinity, 52.h), preferredSize: Size(double.infinity, 52.h),
child: Container( child: Container(
padding: EdgeInsets.only(top: 26.5.h), padding: EdgeInsets.only(top: 6.h),
color: Color(0xFFFAFAFA), color: Color(0xFFFAFAFA),
child: ItemTitle( child: ItemTitle(
text: S.of(context).jingbilianmenghuiyuandian, text: S.of(context).jingbilianmenghuiyuandian,
@ -306,24 +278,17 @@ class _UnionPage extends State<UnionPage>
// headerSliverBuilder: (context, inner) { // headerSliverBuilder: (context, inner) {
// return [ // return [
// SliverOverlapAbsorber( // SliverOverlapAbsorber(
// sliver: buildSliverAppBar(AMapWidget( // sliver: buildSliverAppBar(BMFMapWidget(
// initialCameraPosition: CameraPosition( // mapOptions: BMFMapOptions(
// target: LatLng(30.553111, 114.342366), // center: BMFCoordinate(30.553111, 114.342366),
// zoom: 12.0, // zoomLevel: 12,
// ), // ),
// onMapCreated: onMapCreated, // onBMFMapCreated: onMapCreated,
// apiKey: aMapApiKeys, // // customStyleOptions: _customStyleOptions,
// touchPoiEnabled: true, // // gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
// markers: markers.toSet(), // // Factory<OneSequenceGestureRecognizer>(
// scrollGesturesEnabled: true, // // () => EagerGestureRecognizer()),
// customStyleOptions: _customStyleOptions, // // ].toSet(),
// onPoiTouched: (poiTouch) {
// FocusScope.of(context).requestFocus(FocusNode());
// },
// gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
// Factory<OneSequenceGestureRecognizer>(
// () => EagerGestureRecognizer()),
// ].toSet(),
// )), // )),
// handle: // handle:
// NestedScrollView.sliverOverlapAbsorberHandleFor(context), // NestedScrollView.sliverOverlapAbsorberHandleFor(context),
@ -368,7 +333,7 @@ class _UnionPage extends State<UnionPage>
itemCount: storeList == null ? 0 : storeList.length, itemCount: storeList == null ? 0 : storeList.length,
// padding: EdgeInsets.only(top: 8.h, bottom: 84.h + (375.h - 88.h) + 4.h), // padding: EdgeInsets.only(top: 8.h, bottom: 84.h + (375.h - 88.h) + 4.h),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 17.h, bottom: 84.h /* + (375.h - 88.h) + 4.h*/), top: 8.h, bottom: 84.h /* + (375.h - 88.h) + 4.h*/),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
@ -460,10 +425,10 @@ class _UnionPage extends State<UnionPage>
}); });
} }
AMapController _mapController; BMFMapController _mapController;
TextEditingController editingController = TextEditingController(); TextEditingController editingController = TextEditingController();
void onMapCreated(AMapController controller) { void onMapCreated(BMFMapController controller) {
_mapController = controller; _mapController = controller;
} }
@ -473,16 +438,17 @@ class _UnionPage extends State<UnionPage>
margin: EdgeInsets.fromLTRB(16.w, 40, 16.w, 0), margin: EdgeInsets.fromLTRB(16.w, 40, 16.w, 0),
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h), padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4)), borderRadius: BorderRadius.all(Radius.circular(4)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
) )
]), ],
),
child: TextField( child: TextField(
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
onEditingComplete: () { onEditingComplete: () {
@ -513,81 +479,81 @@ class _UnionPage extends State<UnionPage>
); );
} }
Widget buildSliverAppBar(AMapWidget map) { // Widget buildSliverAppBar(BMFMapWidget map) {
return SliverAppBar( // return SliverAppBar(
// // //
// floating: true, // // floating: true,
// snap: true, // // snap: true,
pinned: true, // pinned: true,
backgroundColor: Color(0xFFFAFAFA), // backgroundColor: Color(0xFFFAFAFA),
elevation: 0, // elevation: 0,
automaticallyImplyLeading: false, // automaticallyImplyLeading: false,
title: Container( // title: Container(
height: 36.h, // height: 36.h,
margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 0), // margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 0),
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h), // padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4)), // borderRadius: BorderRadius.all(Radius.circular(4)),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Colors.black.withAlpha(12), // color: Colors.black.withAlpha(12),
offset: Offset(0, 3), // offset: Offset(0, 3),
blurRadius: 14, // blurRadius: 14,
spreadRadius: 0, // spreadRadius: 0,
) // )
]), // ]),
child: TextField( // child: TextField(
textInputAction: TextInputAction.search, // textInputAction: TextInputAction.search,
onEditingComplete: () { // onEditingComplete: () {
startLocation(); // startLocation();
}, // },
controller: editingController, // controller: editingController,
cursorHeight: 30.h, // cursorHeight: 30.h,
decoration: InputDecoration( // decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 12.h), // contentPadding: EdgeInsets.symmetric(vertical: 12.h),
prefixIcon: Icon( // prefixIcon: Icon(
Icons.search, // Icons.search,
size: 24, // size: 24,
color: Colors.black, // color: Colors.black,
), // ),
suffixIcon: InkWell( // suffixIcon: InkWell(
onTap: () { // onTap: () {
editingController.clear(); // editingController.clear();
}, // },
child: Icon( // child: Icon(
Icons.close, // Icons.close,
size: 19, // size: 19,
color: Colors.grey, // color: Colors.grey,
), // ),
), // ),
border: InputBorder.none, // border: InputBorder.none,
), // ),
), // ),
), // ),
flexibleSpace: FlexibleSpaceBar( // flexibleSpace: FlexibleSpaceBar(
background: Container( // background: Container(
child: map, // child: map,
), // ),
), // ),
expandedHeight: 375.h, // expandedHeight: 375.h,
bottom: PreferredSize( // bottom: PreferredSize(
preferredSize: Size(double.infinity, 52.h), // preferredSize: Size(double.infinity, 52.h),
child: Container( // child: Container(
padding: EdgeInsets.only(top: 6.h), // padding: EdgeInsets.only(top: 6.h),
color: Color(0xFFFAFAFA), // color: Color(0xFFFAFAFA),
child: ItemTitle( // child: ItemTitle(
text: S.of(context).jingbilianmenghuiyuandian, // text: S.of(context).jingbilianmenghuiyuandian,
imgPath: "assets/image/icon_union_store.png", // imgPath: "assets/image/icon_union_store.png",
), // ),
), // ),
), // ),
); // );
} // }
Widget buildStoreItem(Store store, position) { Widget buildStoreItem(Store store, position) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 16.h), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h), padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 20.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -651,6 +617,9 @@ class _UnionPage extends State<UnionPage>
), ),
], ],
), ),
SizedBox(
height: 4.h,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -689,6 +658,10 @@ class _UnionPage extends State<UnionPage>
), ),
], ],
), ),
// Expanded(
// child: Container(),
// flex: 1,
// ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

10
lib/view_widget/mine_vip_view.dart

@ -94,7 +94,7 @@ class MineVipView extends StatelessWidget {
} }
} }
return AspectRatio( return AspectRatio(
aspectRatio: 1.8, aspectRatio: 1.7,
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h), margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -110,7 +110,7 @@ class MineVipView extends StatelessWidget {
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
), ),
child: Column( child: Column(
@ -246,12 +246,12 @@ class MineVipView extends StatelessWidget {
Icons.qr_code, Icons.qr_code,
size: 24, size: 24,
color: Colors.white, color: Colors.white,
) ),
], ],
) ),
], ],
), ),
) ),
], ],
), ),
), ),

51
pubspec.lock

@ -8,27 +8,6 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "14.0.0" version: "14.0.0"
amap_flutter_base:
dependency: transitive
description:
name: amap_flutter_base
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
amap_flutter_location:
dependency: "direct main"
description:
name: amap_flutter_location
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
amap_flutter_map:
dependency: "direct main"
description:
name: amap_flutter_map
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
@ -300,6 +279,34 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_baidu_mapapi_base:
dependency: "direct main"
description:
name: flutter_baidu_mapapi_base
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
flutter_baidu_mapapi_map:
dependency: "direct main"
description:
name: flutter_baidu_mapapi_map
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
flutter_baidu_mapapi_search:
dependency: "direct main"
description:
name: flutter_baidu_mapapi_search
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
flutter_baidu_mapapi_utils:
dependency: "direct main"
description:
name: flutter_baidu_mapapi_utils
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
flutter_cache_manager: flutter_cache_manager:
dependency: transitive dependency: transitive
description: description:
@ -851,7 +858,7 @@ packages:
name: stream_transform name: stream_transform
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "2.0.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:

10
pubspec.yaml

@ -43,16 +43,18 @@ dependencies:
flutter_staggered_grid_view: ^0.4.0 # Null safety flutter_staggered_grid_view: ^0.4.0 # Null safety
pull_to_refresh: ^2.0.0 # Null safety pull_to_refresh: ^2.0.0 # Null safety
# permission_handler: ^8.1.3
permission_handler: ^5.0.1+1 permission_handler: ^5.0.1+1
amap_flutter_map: ^1.0.0
amap_flutter_location: ^2.0.0 # Null safety # flutter_bmflocation: ^1.0.4
flutter_baidu_mapapi_base: ^2.0.1
flutter_baidu_mapapi_map: ^2.0.1
flutter_baidu_mapapi_search: ^2.0.1
flutter_baidu_mapapi_utils: ^2.0.1
dio: ^3.0.10 dio: ^3.0.10
rxdart: ^0.26.0 rxdart: ^0.26.0
retrofit: ^1.3.4+1 retrofit: ^1.3.4+1
json_annotation: ^3.1.1 json_annotation: ^3.1.1
# webview_flutter: ^1.0.7
logger: ^1.0.0 logger: ^1.0.0
android_intent_plus: ^1.0.2 android_intent_plus: ^1.0.2

Loading…
Cancel
Save