diff --git a/android/app/build.gradle b/android/app/build.gradle index 9c803f8e..4b22de5a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -106,7 +106,7 @@ android { defaultConfig { applicationId "com.zsw.huixiang" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/app/libs/uniMPSDK-release.aar b/android/app/libs/uniMPSDK-release.aar deleted file mode 100644 index 69dd9631..00000000 Binary files a/android/app/libs/uniMPSDK-release.aar and /dev/null differ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 80c412ed..8fe1f371 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ @@ -36,7 +37,6 @@ - - - - - - - - - - + - - diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/HxApplication.kt b/android/app/src/main/kotlin/com/zsw/huixiang/HxApplication.kt deleted file mode 100644 index e0e33423..00000000 --- a/android/app/src/main/kotlin/com/zsw/huixiang/HxApplication.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.zsw.huixiang - -import android.app.Application -import com.baidu.mapapi.base.BmfMapApplication - -class HxApplication : BmfMapApplication() { - - - override fun onCreate() { - super.onCreate() - - - } - - -} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index a41d8a49..6a39fb30 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,11 +8,13 @@ buildscript { url 'https://maven.aliyun.com/repository/jcenter' } maven { + allowInsecureProtocol = true url 'http://maven.aliyun.com/nexus/content/groups/public' } // google() // jcenter() maven { + allowInsecureProtocol = true url "http://mvn.mob.com/android" } maven { url "https://www.jitpack.io" } @@ -43,11 +45,13 @@ allprojects { url 'https://maven.aliyun.com/repository/jcenter' } maven { + allowInsecureProtocol = true url 'http://maven.aliyun.com/nexus/content/groups/public' } // google() // jcenter() maven { + allowInsecureProtocol = true url "http://mvn.mob.com/android" } maven { url "https://www.jitpack.io" } diff --git a/android/gradle.properties b/android/gradle.properties index 8794949b..c422fd2d 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,6 +1,8 @@ #org.gradle.jvmargs=-Xmx1536M -org.gradle.jvmargs=-Xmx4096m +#org.gradle.jvmargs=-Xmx4096m android.useAndroidX=true android.enableJetifier=true MobSDK.mobEnv=x -MobSDK.spEdition=FP \ No newline at end of file +MobSDK.spEdition=FP +android.injected.testOnly=false +org.gradle.jvmargs=-Xmx4096m --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index b13e191c..a0f7639f 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,10 +1,5 @@ -#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -#distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip -#distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip -systemProp.http.proxyHost=proxy.com -systemProp.http.proxyPort=8080 \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index c5e9bee5..98f4107b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -14,38 +14,14 @@ PODS: - AFNetworking/Serialization (4.0.1) - AFNetworking/UIKit (4.0.1): - AFNetworking/NSURLSession - - BaiduMapKit/Base (6.5.1) - - BaiduMapKit/Map (6.5.1): - - BaiduMapKit/Base - - BaiduMapKit/Search (6.5.1): - - BaiduMapKit/Base - - BaiduMapKit/Utils (6.5.1): - - BaiduMapKit/Base - - BMKLocationKit (2.0.4) - emoji_picker_flutter (0.0.1): - Flutter - Flutter (1.0.0) - - flutter_baidu_mapapi_base (3.1.0): - - BaiduMapKit/Utils (= 6.5.1) - - Flutter - - flutter_baidu_mapapi_map (3.1.0): - - BaiduMapKit/Map (= 6.5.1) - - Flutter - - flutter_baidu_mapapi_base - - flutter_baidu_mapapi_search (3.1.0): - - BaiduMapKit/Search (= 6.5.1) - - Flutter - - flutter_baidu_mapapi_base - - flutter_baidu_mapapi_utils (3.1.0): - - BaiduMapKit/Utils (= 6.5.1) - - Flutter - - flutter_baidu_mapapi_base - - flutter_bmflocation (2.0.1): - - BMKLocationKit (~> 2.0.4) - - Flutter - fluwx (0.0.1): - Flutter - - mob_sharesdk/ShareSDKPlatforms/WeChatFull + - "OpenWeChatSDK (~> 1.9.2+1)" + - geolocator (6.2.0): + - Flutter - image_gallery_saver (1.5.0): - Flutter - image_pickers (0.0.1): @@ -60,103 +36,13 @@ PODS: - mob_sharesdk/ShareSDKExtension (4.4.15): - mob_sharesdk/ShareSDK - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/DingTalk (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Douyin (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Dropbox (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Evernote (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - mob_sharesdk/ShareSDKPlatforms/Facebook (4.4.15): - mob_sharesdk/ShareSDK - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Flickr (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/GooglePlus (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Instagram (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Instapaper (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Kakao (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/KuaiShou (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - mob_sharesdk/ShareSDKPlatforms/Line (4.4.15): - mob_sharesdk/ShareSDK - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/LinkedIn (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Messenger (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/MingDao (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Oasis (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Pinterest (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Pocket (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/QQ (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Reddit (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/SinaWeibo (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/SMS (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/SnapChat (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Telegram (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/TikTok (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Twitter (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/VKontakte (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/WatermelonVideo (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/WeChatFull (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/WeWork (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/WhatsApp (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Yixin (4.4.15): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/YouDaoNote (4.4.15): + - mob_sharesdk/ShareSDKPlatforms/WeChat_Lite (4.4.15): - mob_sharesdk/ShareSDK - MOBFoundation (>= 3.2.9) - mob_sharesdk/ShareSDKUI (4.4.15): @@ -165,6 +51,7 @@ PODS: - MOBFoundation (3.2.49) - number_precision (0.0.1): - Flutter + - "OpenWeChatSDK (1.9.9+1)" - package_info (0.0.1): - Flutter - path_provider (0.0.1): @@ -183,39 +70,9 @@ PODS: - Flutter - mob_sharesdk - mob_sharesdk/ShareSDKExtension - - mob_sharesdk/ShareSDKPlatforms/DingTalk - - mob_sharesdk/ShareSDKPlatforms/Douyin - - mob_sharesdk/ShareSDKPlatforms/Dropbox - - mob_sharesdk/ShareSDKPlatforms/Evernote - mob_sharesdk/ShareSDKPlatforms/Facebook - - mob_sharesdk/ShareSDKPlatforms/Flickr - - mob_sharesdk/ShareSDKPlatforms/GooglePlus - - mob_sharesdk/ShareSDKPlatforms/Instagram - - mob_sharesdk/ShareSDKPlatforms/Instapaper - - mob_sharesdk/ShareSDKPlatforms/Kakao - - mob_sharesdk/ShareSDKPlatforms/KuaiShou - mob_sharesdk/ShareSDKPlatforms/Line - - mob_sharesdk/ShareSDKPlatforms/LinkedIn - - mob_sharesdk/ShareSDKPlatforms/Messenger - - mob_sharesdk/ShareSDKPlatforms/MingDao - - mob_sharesdk/ShareSDKPlatforms/Oasis - - mob_sharesdk/ShareSDKPlatforms/Pinterest - - mob_sharesdk/ShareSDKPlatforms/Pocket - - mob_sharesdk/ShareSDKPlatforms/QQ - - mob_sharesdk/ShareSDKPlatforms/Reddit - - mob_sharesdk/ShareSDKPlatforms/SinaWeibo - - mob_sharesdk/ShareSDKPlatforms/SMS - - mob_sharesdk/ShareSDKPlatforms/SnapChat - - mob_sharesdk/ShareSDKPlatforms/Telegram - - mob_sharesdk/ShareSDKPlatforms/TikTok - - mob_sharesdk/ShareSDKPlatforms/Twitter - - mob_sharesdk/ShareSDKPlatforms/VKontakte - - mob_sharesdk/ShareSDKPlatforms/WatermelonVideo - - mob_sharesdk/ShareSDKPlatforms/WeChatFull - - mob_sharesdk/ShareSDKPlatforms/WeWork - - mob_sharesdk/ShareSDKPlatforms/WhatsApp - - mob_sharesdk/ShareSDKPlatforms/Yixin - - mob_sharesdk/ShareSDKPlatforms/YouDaoNote + - mob_sharesdk/ShareSDKPlatforms/WeChat_Lite - mob_sharesdk/ShareSDKUI - SSZipArchive (2.4.3) - thumbnails (0.0.1): @@ -247,12 +104,8 @@ PODS: DEPENDENCIES: - emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`) - 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`) - - flutter_bmflocation (from `.symlinks/plugins/flutter_bmflocation/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`) + - geolocator (from `.symlinks/plugins/geolocator/ios`) - image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`) - image_pickers (from `.symlinks/plugins/image_pickers/ios`) - number_precision (from `.symlinks/plugins/number_precision/ios`) @@ -275,10 +128,9 @@ DEPENDENCIES: SPEC REPOS: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git: - AFNetworking - - BaiduMapKit - - BMKLocationKit - mob_sharesdk - MOBFoundation + - OpenWeChatSDK - SDWebImage - SSZipArchive - TPNS-iOS @@ -291,18 +143,10 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/emoji_picker_flutter/ios" 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" - flutter_bmflocation: - :path: ".symlinks/plugins/flutter_bmflocation/ios" fluwx: :path: ".symlinks/plugins/fluwx/ios" + geolocator: + :path: ".symlinks/plugins/geolocator/ios" image_gallery_saver: :path: ".symlinks/plugins/image_gallery_saver/ios" image_pickers: @@ -340,28 +184,23 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58 - BaiduMapKit: f227cfb43581e91466fb4f1344f655eab5788777 - BMKLocationKit: 688d8e1194980b96fc9a6585c0eb42e62fbaf780 emoji_picker_flutter: df19dac03a2b39ac667dc8d1da939ef3a9e21347 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - flutter_baidu_mapapi_base: cb406be78c3a949fb58a45dc6627f139d580bd37 - flutter_baidu_mapapi_map: 81c4e6e93dc668e311d9b521421deaf292390434 - flutter_baidu_mapapi_search: 13a360334e91abea0bcf820546b2ef4548e42e08 - flutter_baidu_mapapi_utils: f6a5d23da26b0e58f1ae9908da7ba87fd48384b1 - flutter_bmflocation: 1bd73181196567fe1529f765aa4f8e2615a8a3cf - fluwx: a24006296e7ca601e8544e12bd6269497fae23e6 + fluwx: 79c66b6d795ab8208262ada215d9e60388cfe492 + geolocator: f5e3de65e241caba7ce3e8a618803387bda73384 image_gallery_saver: 259eab68fb271cfd57d599904f7acdc7832e7ef2 image_pickers: 25c8916d358bc9d2707cb470ba3d57497f105773 mob_sharesdk: 0698d60b3c1549a5b0bcfdec6f407439dd2960c0 MOBFoundation: 6df2684b4db4f0f5bd71b0623f82e11271bf7ac8 number_precision: 26fa2be2212f9d1429f92d667d6b0aa4df0058d8 + OpenWeChatSDK: ea48e9db20645f78128db9091893910280b8e4b1 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 scan: aea35bb4aa59ccc8839c576a18cd57c7d492cc86 SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3 shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472 - sharesdk_plugin: b105d82bed39e1d229591999058ab1e12ff95001 + sharesdk_plugin: f29a6f471ae1c253e96636d62106c3f8d793948c SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef thumbnails: bb4f4e9bb4b51c8ae4e6ad9a2fa81373f9b634ad tobias: 2aded9b83e3663b907360a800d8e3c13284f25c5 @@ -378,4 +217,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: f8bac8842dd5d4f36a3709c129ae7a2ccd5be619 -COCOAPODS: 1.13.0 +COCOAPODS: 1.15.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 76034449..fda8700d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 0558860326BD10CA00FB1CFE /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0558860226BD10CA00FB1CFE /* test.swift */; }; 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 */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 6EE8F3582695818800237A5E /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3572695818800237A5E /* JavaScriptCore.framework */; }; @@ -145,7 +144,6 @@ 6EE8F35C2695819500237A5E /* CoreMedia.framework in Frameworks */, 6EE8F3582695818800237A5E /* JavaScriptCore.framework in Frameworks */, C9444B3318AB7FB815E97950 /* libPods-Runner.a in Frameworks */, - 05C5427426BCE3AC00D26AC2 /* BMKLocationKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -358,7 +356,6 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 120EAF7195D9AB3BB1E8FA2B /* [CP] Copy Pods Resources */, - 8C1FAACB8CAD66760F3893D3 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -452,23 +449,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; - 8C1FAACB8CAD66760F3893D3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -657,6 +637,7 @@ "\"${PODS_ROOT}/Headers/Private/fluwx\"", ); INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "海峡姐妹"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -669,7 +650,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.2.28; + MARKETING_VERSION = 3.2.29; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -677,11 +658,6 @@ "-l\"c++\"", "-l\"image_pickers\"", "-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\"sqlite3\"", "-l\"wakelock\"", @@ -860,6 +836,7 @@ "\"${PODS_ROOT}/Headers/Private/fluwx\"", ); INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "海峡姐妹"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -872,7 +849,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.2.28; + MARKETING_VERSION = 3.2.29; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -880,11 +857,6 @@ "-l\"c++\"", "-l\"image_pickers\"", "-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\"sqlite3\"", "-l\"wakelock\"", @@ -954,6 +926,7 @@ "\"${PODS_ROOT}/Headers/Private/fluwx\"", ); INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "海峡姐妹"; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -966,7 +939,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.2.28; + MARKETING_VERSION = 3.2.29; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -974,11 +947,6 @@ "-l\"c++\"", "-l\"image_pickers\"", "-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\"sqlite3\"", "-l\"wakelock\"", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 38b6173c..b4ff2028 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -7,7 +7,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - 一心回鄉 + 海峡姐妹 CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -95,9 +95,9 @@ lineauth line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER) alipay - iosamap - qqmap - baidumap + iosamap + qqmap + baidumap LSRequiresIPhoneOS @@ -136,20 +136,22 @@ 拍视频需要录音权限 NSMotionUsageDescription 是否允许访问运行 + NSPhotoLibraryAddUsageDescription + 请允许App保存图片到相册 NSPhotoLibraryUsageDescription 打开相册 NSSpeechRecognitionUsageDescription 是否允许语音识别 - NSPhotoLibraryAddUsageDescription - 请允许App保存图片到相册 UIApplicationSceneManifest UIApplicationSupportsMultipleScenes + UIApplicationSupportsIndirectInputEvents + UIBackgroundModes - remote-notification + location UILaunchStoryboardName LaunchScreen @@ -178,11 +180,5 @@ https://hx.lotus-wallet.com/app/ io.flutter.embedded_views_preview YES - UIBackgroundModes - - location - - UIApplicationSupportsIndirectInputEvents - diff --git a/lib/address/address_map_page.dart b/lib/address/address_map_page.dart index 1324b146..e8d1d6d1 100644 --- a/lib/address/address_map_page.dart +++ b/lib/address/address_map_page.dart @@ -8,16 +8,14 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.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_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/location.dart'; import 'package:huixiang/view_widget/request_permission.dart'; -import 'package:permission_handler/permission_handler.dart'; +import 'package:permission_handler/permission_handler.dart' as PH; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -29,23 +27,10 @@ class AddressMapPage extends StatefulWidget { } class _AddressMapPage extends State { - //加载自定义地图样式 - void _loadCustomData() async { - setState(() { - _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); - }); - } - LocationFlutterPlugin aMapFlutterLocation; String city = "武汉市"; String keyWord = ""; - @override - void dispose() { - super.dispose(); - aMapFlutterLocation.stopLocation(); - } - ApiService apiService; @override @@ -55,90 +40,33 @@ class _AddressMapPage extends State { SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), context: context, token: value.getString('token')), - }); + },); - if (aMapFlutterLocation == null) { - aMapFlutterLocation = LocationFlutterPlugin(); - } - aMapFlutterLocation.singleLocationCallback(callback: (BaiduLocation result){ + LocationInstance.getInstance().startLocation(context, (Position result) { print("event: $result"); if (result != null && result.latitude != null && result.longitude != null) { - city = result.city; - BMFCoordinate latLng = BMFCoordinate(result.latitude, result.longitude); - BMFCalculateUtils.coordConvert( - coordinate: latLng, - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL) - .then((value) { - saveLatLng(value); - if (_mapController != null) { - this.latLng = Platform.isIOS ? value : latLng; - addMarker(); - _mapController.updateMapOptions( - BMFMapOptions( - center: latLng, - zoomLevel: 15, - showZoomControl: false, - showMapScaleBar: false, - rotateEnabled: false, - ), - ); + latLng = Position(latitude: result.latitude, longitude: result.longitude); + LocationInstance.getInstance().getAddress(result.latitude, result.longitude).then((value) { + if (value != null) { + city = value.city; } - searchPoi(latLng); }); + saveLatLng(result); + searchPoi(latLng); } }); - _setLocOption(); - - getLatLng(); startLocation(); } - /// 设置android端和ios端定位参数 - void _setLocOption() { - /// android 端设置定位参数 - BaiduLocationAndroidOption androidOption = new BaiduLocationAndroidOption(); - androidOption.setCoorType("GCJ02"); // 设置返回的位置坐标系类型 - androidOption.setIsNeedAltitude(true); // 设置是否需要返回海拔高度信息 - androidOption.setIsNeedAddress(true); // 设置是否需要返回地址信息 - androidOption.setIsNeedLocationPoiList(true); // 设置是否需要返回周边poi信息 - androidOption.setIsNeedNewVersionRgc(true); // 设置是否需要返回最新版本rgc信息 - androidOption.setIsNeedLocationDescribe(true); // 设置是否需要返回位置描述 - androidOption.setOpenGps(true); // 设置是否需要使用gps - androidOption.setLocationMode(BMFLocationMode.hightAccuracy); // 设置定位模式 - androidOption.setScanspan(0); // 设置发起定位请求时间间隔 - androidOption.setCoordType(BMFLocationCoordType.gcj02); - - Map androidMap = androidOption.getMap(); - - /// ios 端设置定位参数 - BaiduLocationIOSOption iosOption = new BaiduLocationIOSOption(); - iosOption.setIsNeedNewVersionRgc(true); // 设置是否需要返回最新版本rgc信息 - iosOption.setBMKLocationCoordinateType( - "BMKLocationCoordinateTypeGCJ02"); // 设置返回的位置坐标系类型 - iosOption.setActivityType(BMFActivityType.automotiveNavigation); // 设置应用位置类型 - iosOption.setLocationTimeout(10); // 设置位置获取超时时间 - iosOption.setDesiredAccuracy(BMFDesiredAccuracy.best); // 设置预期精度参数 - iosOption.setReGeocodeTimeout(10); // 设置获取地址信息超时时间 - iosOption.setDistanceFilter(1000); // 设置定位最小更新距离 - iosOption.setAllowsBackgroundLocationUpdates(true); // 是否允许后台定位 - iosOption.setPauseLocUpdateAutomatically(true); // 定位是否会被系统自动暂停 - iosOption.coordType = BMFLocationCoordType.gcj02; - - Map iosMap = iosOption.getMap(); - - aMapFlutterLocation.prepareLoc(androidMap, iosMap); - } - + Position center = Position(); List
poiList; - searchPoi(BMFCoordinate latLng) async { + searchPoi(Position latLng) async { keyWord = textEditingController.text; print("keyWord: ${keyWord}"); - var addressPoi = await apiService.searchPoi( - "${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1); + var addressPoi = await apiService.searchPoi("${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1); //如果定位列表无法显示,可以考虑数据是否不在当前字段里面;例:原数据放在['pois']里面,后改成了数据放在['entrances']里面 List poi = addressPoi['pois']??addressPoi['entrances']; poiList = poi @@ -159,54 +87,31 @@ class _AddressMapPage extends State { })) .toList(); setState(() {}); - - // BMFPoiNearbySearch bmfPoiNearbySearch = BMFPoiNearbySearch(); - // bmfPoiNearbySearch.onGetPoiNearbySearchResult( - // callback: (BMFPoiSearchResult result, BMFSearchErrorCode errorCode) { - // // if ((DateTime.now().millisecondsSinceEpoch - time) > 2000) { - // result.poiInfoList.map((e) => print("sssssssssss:${e.toMap()}")); - // poiList = result.poiInfoList; - // print("object112221: ${poiList.length}"); - // setState(() { - // time = DateTime.now().millisecondsSinceEpoch; - // }); - // // } - // }); - // bmfPoiNearbySearch.poiNearbySearch(BMFPoiNearbySearchOption( - // keywords: [" "], - // tags: ["小区","住宅","地标","建筑"], - // radius: 100000, - // location: latLng, - // pageSize: 20, - // pageIndex: 0, - // isRadiusLimit: true, - // )); } int time = 0; startLocation() async { - if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) { + if (!(await PH.Permission.locationWhenInUse.serviceStatus.isEnabled)) { enableLocation(); return; } - - if (await Permission.location.isPermanentlyDenied) { + if (await PH.Permission.location.isPermanentlyDenied) { requestDialog(); - } else if (await Permission.location.isGranted) { + } else if (await PH.Permission.location.isGranted) { // EasyLoading.show(status: S.of(context).zhengzaijiazai); - aMapFlutterLocation.startLocation(); + center = await Geolocator.getCurrentPosition(); Future.delayed(Duration(seconds: 6), () { EasyLoading.dismiss(); }); - } else if (await Permission.location.isUndetermined) { - await Permission.location.request(); + } else if (await PH.Permission.location.isUndetermined) { + await PH.Permission.location.request(); } else { if (Platform.isIOS) { //去设置中心 requestDialog(); } else { - await Permission.location.request(); + await PH.Permission.location.request(); } } } @@ -222,11 +127,12 @@ class _AddressMapPage extends State { S.of(context).dakaidingwei, (result) async { if (result) { - final AndroidIntent intent = AndroidIntent( - action: 'action_location_source_settings', - package: "com.zsw.huixiang"); - await intent.launch(); + // final AndroidIntent intent = AndroidIntent( + // action: 'action_location_source_settings', + // package: "com.zsw.huixiang"); + // await intent.launch(); // startLocation(); + Geolocator.openLocationSettings(); } }, heightRatioWithWidth: 0.82, @@ -246,8 +152,8 @@ class _AddressMapPage extends State { S.of(context).kaiqiquanxian, (result) async { if (result) { - await openAppSettings(); - if (await Permission.location.isGranted) { + await PH.openAppSettings(); + if (await PH.Permission.location.isGranted) { startLocation(); } } @@ -257,180 +163,45 @@ class _AddressMapPage extends State { }); } - BMFMapController _mapController; - BMFCoordinate bmfCoordinate; - - void onMapCreated(BMFMapController controller) { - controller.setMapRegionDidChangeCallback(callback: (status) { - BMFMapStatus bmfMapStatus = status; - print("status: ${bmfMapStatus.toMap()}"); - if (bmfCoordinate != null && - bmfCoordinate.longitude == status.targetGeoPt.longitude && - bmfCoordinate.latitude == status.targetGeoPt.latitude) { - if ((DateTime.now().millisecondsSinceEpoch - time) > 1000) { - center = status.targetGeoPt; - searchPoi(center); - time = DateTime.now().millisecondsSinceEpoch; - } - } else { - bmfCoordinate = status.targetGeoPt; - } - }); - - setState(() { - _mapController = controller; - _mapController.showUserLocation(true); - _loadCustomData(); - addMarker(); - }); - } - BMFCoordinate latLng; - BMFMarker bmfMarker; - addMarker() { - if (latLng == null) return; - if (bmfMarker == null && _mapController != null) { - print("map_wid: ${MediaQuery.of(context).size.width}"); - print("map_hei: ${MediaQuery.of(context).size.height}"); + Position latLng; - bmfMarker = BMFMarker( - position: latLng, - screenPointToLock: BMFPoint( - (Platform.isIOS - ? MediaQuery.of(context).size.width - : window.physicalSize.width) / - 2, - Platform.isIOS - ? MediaQuery.of(context).size.height - : window.physicalSize.height / 4), - isLockedToScreen: true, - centerOffset: BMFPoint(0.5, 0.7), - enabled: false, - icon: "assets/image/icon_address_location.webp", - draggable: false, - ); - _mapController.addMarker(bmfMarker); - } - bmfMarker.updateIsLockedToScreen( - true, - BMFPoint( - (Platform.isIOS - ? MediaQuery.of(context).size.width - : window.physicalSize.width) / - 2, - (Platform.isIOS - ? MediaQuery.of(context).size.height - : window.physicalSize.height) / - 4)); - } - saveLatLng(BMFCoordinate latLng) async { + saveLatLng(Position latLng) async { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("longitude", "${latLng.longitude}"); } - getLatLng() async { - SharedPreferences.getInstance().then((value) => { - setState(() { - if (_mapController != null) { - _mapController.updateMapOptions( - BMFMapOptions( - center: BMFCoordinate( - double.tryParse(value.getString("latitude")), - double.tryParse(value.getString("longitude")), - ), - zoomLevel: 15, - showZoomControl: false, - showMapScaleBar: false, - rotateEnabled: false, - ), - ); - } - }) - }); - } - - BMFMapWidget map; - BMFCoordinate center = BMFCoordinate(30.553111, 114.342366); - @override Widget build(BuildContext context) { return Scaffold( body: Column( children: [ searchWidget(), - Expanded( - child: Stack( - children: [ - Container( - child: BMFMapWidget( - mapOptions: BMFMapOptions( - center: BMFCoordinate(30.553111, 114.342366), - zoomLevel: 15, - showZoomControl: false, - showMapScaleBar: false, - rotateEnabled: false, - ), - onBMFMapCreated: onMapCreated, - // onCameraMoveEnd: (cameraPosition) { - // center = cameraPosition.target; - // searchPoi(center); - // }, - // onCameraMove: (cameraPosition) { - // center = cameraPosition.target; - // setState(() {}); - // }, - // markers: [Marker(position: center)].toSet(), - // touchPoiEnabled: true, - // scrollGesturesEnabled: true, - // customStyleOptions: _customStyleOptions, - // gestureRecognizers: >[ - // Factory( - // () => EagerGestureRecognizer()) - // ].toSet(), - ), - ), - // Center( - // child: IgnorePointer( - // child: Container( - // margin: EdgeInsets.only(bottom: 44.h), - // child: Image.asset( - // "assets/image/icon_address_location.webp", - // width: 66.w, - // height: 75.h, - // ), - // ), - // ), - // ), - Positioned( - right: 17, - bottom: 16, - child: InkWell( - onTap: () { - startLocation(); - }, - child: Container( - width: 32, - height: 32, - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - color: Colors.white, - ), - child: Image.asset( - "assets/image/icon_address_location_action.webp", - width: 16.w, - height: 16.h, - ), - ), - ), - ), - ], - ), - flex: 1, - ), + // Expanded( + // child: InkWell( + // onTap: () { + // startLocation(); + // }, + // child: Container( + // width: 32, + // height: 32, + // padding: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(16), + // color: Colors.white, + // ), + // child: Image.asset( + // "assets/image/icon_address_location_action.webp", + // width: 16.w, + // height: 16.h, + // ), + // ), + // ), + // flex: 1, + // ), Expanded( child: Container( child: ListView.separated( @@ -501,14 +272,16 @@ class _AddressMapPage extends State { padding: EdgeInsets.fromLTRB(10, 6, 16, 6), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(4)), + borderRadius: BorderRadius.all( + Radius.circular(4), + ), boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), offset: Offset(0, 3), blurRadius: 14, spreadRadius: 0, - ) + ), ], ), child: Row( diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index d8f8c2ad..c07cc649 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -1,9 +1,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/collect_class_list.dart'; import 'package:huixiang/retrofit/data/course_list.dart'; +import 'package:huixiang/retrofit/data/latlng.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; @@ -23,7 +24,7 @@ class HomeClass extends StatefulWidget { class _HomeClass extends State { ApiService apiService; - BMFCoordinate latLng; + Position latLng; final TextEditingController editingController = TextEditingController(); diff --git a/lib/community/headlines/activity_top_list.dart b/lib/community/headlines/activity_top_list.dart index 257f61b6..3216b3b3 100644 --- a/lib/community/headlines/activity_top_list.dart +++ b/lib/community/headlines/activity_top_list.dart @@ -1,9 +1,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/latlng.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; @@ -22,7 +23,7 @@ class ActivityTopList extends StatefulWidget { class _ActivityTopList extends State { ApiService apiService; - BMFCoordinate latLng; + Position latLng; final TextEditingController editingController = TextEditingController(); diff --git a/lib/community/headlines/headlines_collection.dart b/lib/community/headlines/headlines_collection.dart index a485fded..8da1d592 100644 --- a/lib/community/headlines/headlines_collection.dart +++ b/lib/community/headlines/headlines_collection.dart @@ -1,16 +1,13 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/article.dart'; -import 'package:huixiang/retrofit/data/collect_class_list.dart'; -import 'package:huixiang/retrofit/data/course_list.dart'; import 'package:huixiang/retrofit/data/headlines_list.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:huixiang/view_widget/new_people_reward.dart'; class HeadlinesCollection extends StatefulWidget { final List headlines; @@ -26,7 +23,7 @@ class HeadlinesCollection extends StatefulWidget { class _HeadlinesCollection extends State { ApiService apiService; - BMFCoordinate latLng; + Position latLng; final TextEditingController editingController = TextEditingController(); diff --git a/lib/home/home_view/quick_order.dart b/lib/home/home_view/quick_order.dart index 2bfa6a96..137ef631 100644 --- a/lib/home/home_view/quick_order.dart +++ b/lib/home/home_view/quick_order.dart @@ -1,13 +1,11 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.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_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_svg/flutter_svg.dart'; + +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/store/scan.dart'; +import 'package:huixiang/retrofit/data/latlng.dart'; import 'package:huixiang/utils/location.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/store.dart'; @@ -19,7 +17,7 @@ import 'package:huixiang/view_widget/item_title.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/round_button.dart'; -import 'package:permission_handler/permission_handler.dart'; +import 'package:permission_handler/permission_handler.dart' as PH; import 'package:shared_preferences/shared_preferences.dart'; class QuickOrder extends StatefulWidget { @@ -32,9 +30,9 @@ class QuickOrder extends StatefulWidget { class _QuickOrder extends State { ApiService apiService; List storeList; - BMFCoordinate latLng; + Position latLng; - BMFMapController _mapController; + // BMFMapController _mapController; final TextEditingController editingController = TextEditingController(); @override @@ -45,11 +43,8 @@ class _QuickOrder extends State { } ///门店列表 - queryStore(latitude, longitude, province, city, district, searchKey) async { + queryStore(latitude, longitude, searchKey) async { BaseData> baseData = await apiService.queryStore({ - // "city": city, - // "district": district, - // "province": province, "latitude": latitude, "longitude": longitude, "searchKey": searchKey @@ -68,74 +63,61 @@ class _QuickOrder extends State { token: value.getString('token'), showLoading: false), if (value.containsKey("latitude") && - value.containsKey("longitude") && - value.containsKey("province") && - value.containsKey("city") && - value.containsKey("district")) + value.containsKey("longitude")) { - latLng = BMFCoordinate(double.tryParse(value.getString("latitude")), - double.tryParse(value.getString("longitude"))), + latLng = Position( + latitude: double.tryParse(value.getString("latitude")), + longitude: double.tryParse(value.getString("longitude")), + ), queryStore( value.getString("latitude"), value.getString("longitude"), - value.getString("province"), - value.getString("city"), - value.getString("district"), editingController.text, ), setState(() { - if (_mapController != null) { - _mapController.updateMapOptions(BMFMapOptions( - center: latLng, - zoomLevel: 15, - )); - } + // if (_mapController != null) { + // _mapController.updateMapOptions(BMFMapOptions( + // center: latLng, + // zoomLevel: 15, + // )); + // } }) } else { - queryStore("", "", "", "", "", editingController.text), + queryStore("", "", editingController.text), } }, ); } startLocation() async { - Location.getInstance().startLocation(context, (BaiduLocation result){ + LocationInstance.getInstance().startLocation(context, (Position result){ if (result != null && result.latitude != null && result.longitude != null) { print("location: $result"); - latLng = BMFCoordinate(result.latitude, result.longitude); - BMFCalculateUtils.coordConvert( - coordinate: latLng, - fromType: BMF_COORD_TYPE.BD09LL, - toType: BMF_COORD_TYPE.COMMON) - .then((value) { - this.latLng = value; - saveLatLng( - value, result.province, result.city, result.district); - print("union: Location result ${value.latitude} " - "${value.longitude}"); - Location.getInstance().stopLocation(); + latLng = Position( + latitude: result.latitude, + longitude: result.longitude, + ); + LocationInstance.getInstance().getAddress(latLng.latitude, latLng.longitude).then((r) { + if (r != null) { + saveLatLng(latLng, r.province, r.city, r.area); + } + + LocationInstance.getInstance().stopLocation(); queryStore( - "${value.latitude}", - "${value.longitude}", - result.province, - result.city, - result.district, + "${latLng.latitude}", + "${latLng.longitude}", editingController.text); - if (_mapController != null) - _mapController.updateMapOptions(BMFMapOptions( - center: value, - zoomLevel: 15, - )); + return r; }); } }).then((value) {}); } - saveLatLng(BMFCoordinate latLng, province, city, district) async { + saveLatLng(Position latLng, province, city, district) async { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("longitude", "${latLng.longitude}"); @@ -363,7 +345,7 @@ class _QuickOrder extends State { ///扫码 toScan() async { - if (await Permission.camera.isPermanentlyDenied) { + if (await PH.Permission.camera.isPermanentlyDenied) { showCupertinoDialog( context: context, builder: (context) { @@ -374,13 +356,13 @@ class _QuickOrder extends State { S.of(context).kaiqiquanxian, (result) async { if (result) { - await openAppSettings(); + await PH.openAppSettings(); } }, heightRatioWithWidth: 0.82, ); }); - } else if (await Permission.camera.isGranted) { + } else if (await PH.Permission.camera.isGranted) { // http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 // 新版桌子码跳转 // http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432 @@ -407,7 +389,7 @@ class _QuickOrder extends State { ); } } else { - await Permission.camera.request(); + await PH.Permission.camera.request(); } } } diff --git a/lib/main.dart b/lib/main.dart index 72b6792b..9c99f38d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -351,8 +351,8 @@ Map routers = { VipBalancePage(arguments: arguments), '/router/exchange_order_details': (context, {arguments}) => ExchangeOrderDetailPage(), - '/router/location_map': (context, {arguments}) => - LocationMap(arguments: arguments), + // '/router/location_map': (context, {arguments}) => + // LocationMap(arguments: arguments), '/router/settlement': (context, {arguments}) => Settlement(arguments: arguments), '/router/integral_detailed_page': (context, {arguments}) => diff --git a/lib/main_page.dart b/lib/main_page.dart index 07ef90c8..3a59e628 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -3,8 +3,6 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -241,19 +239,19 @@ class _MainPage extends State with WidgetsBindingObserver { ); SharesdkPlugin.regist(shareSDKRegister); - LocationFlutterPlugin myLocPlugin = LocationFlutterPlugin(); + // LocationFlutterPlugin myLocPlugin = LocationFlutterPlugin(); // // 设置是否隐私政策 - myLocPlugin.setAgreePrivacy(true); - BMFMapSDK.setAgreePrivacy(true); - if (Platform.isIOS) { - myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); - BMFMapSDK.setApiKeyAndCoordType( - 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', - BMF_COORD_TYPE.BD09LL, - ); - } else if (Platform.isAndroid) { - BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); - } + // myLocPlugin.setAgreePrivacy(true); + // BMFMapSDK.setAgreePrivacy(true); + // if (Platform.isIOS) { + // myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); + // BMFMapSDK.setApiKeyAndCoordType( + // 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', + // BMF_COORD_TYPE.BD09LL, + // ); + // } else if (Platform.isAndroid) { + // BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); + // } if (Platform.isAndroid) { xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( diff --git a/lib/mine/mine_shop_details.dart b/lib/mine/mine_shop_details.dart index c8aa883f..04237cd6 100644 --- a/lib/mine/mine_shop_details.dart +++ b/lib/mine/mine_shop_details.dart @@ -1,8 +1,7 @@ -import 'package:barcode_widget/barcode_widget.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; @@ -13,7 +12,6 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/store/scan.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/location.dart'; -import 'package:huixiang/utils/painter_bg.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -45,7 +43,7 @@ class _MineShopDetails extends State { super.dispose(); refreshController.dispose(); consumeRefreshController.dispose(); - Location.getInstance().stopLocation(); + LocationInstance.getInstance().stopLocation(); } @override @@ -89,7 +87,7 @@ class _MineShopDetails extends State { startLocation() async { // EasyLoading.show(status: S.current.zhengzaijiazai); - Location.getInstance().startLocation(context, (BaiduLocation result){ + LocationInstance.getInstance().startLocation(context, (Position result){ if (result != null && result.latitude != null && result.longitude != null) { diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index 068c450f..a80647eb 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -1,8 +1,8 @@ import 'package:barcode_widget/barcode_widget.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/product.dart'; @@ -37,7 +37,7 @@ class _VipDetailPage extends State { void dispose() { super.dispose(); refreshController.dispose(); - Location.getInstance().stopLocation(); + LocationInstance.getInstance().stopLocation(); } @override @@ -51,7 +51,7 @@ class _VipDetailPage extends State { startLocation() async { // EasyLoading.show(status: S.current.zhengzaijiazai); - Location.getInstance().startLocation(context, (BaiduLocation result) { + LocationInstance.getInstance().startLocation(context, (Position result) { if (result != null && result.latitude != null && result.longitude != null) { diff --git a/lib/mine/vip_pay_code.dart b/lib/mine/vip_pay_code.dart index 60305ceb..9ee51a99 100644 --- a/lib/mine/vip_pay_code.dart +++ b/lib/mine/vip_pay_code.dart @@ -1,30 +1,18 @@ import 'dart:async'; import 'dart:convert'; - -import 'package:barcode_widget/barcode_widget.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/product.dart'; -import 'package:huixiang/retrofit/data/vip_card.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; -import 'package:huixiang/store/scan.dart'; import 'package:huixiang/utils/font_weight.dart'; -import 'package:huixiang/utils/location.dart'; -import 'package:huixiang/utils/painter_bg.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:huixiang/view_widget/my_footer.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../retrofit/data/user_info.dart'; -import '../view_widget/classic_header.dart'; class VipPayCode extends StatefulWidget { @override diff --git a/lib/order/store_selector_page.dart b/lib/order/store_selector_page.dart index e97c7aa6..29a017cb 100644 --- a/lib/order/store_selector_page.dart +++ b/lib/order/store_selector_page.dart @@ -1,13 +1,7 @@ -import 'dart:io'; -import 'package:android_intent_plus/android_intent.dart'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; -import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index bd2b9a1a..e3c16174 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:dio/dio.dart'; -import 'package:dio_log/interceptor/dio_log_interceptor.dart'; +// import 'package:dio_log/interceptor/dio_log_interceptor.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -95,7 +95,7 @@ abstract class BusinessApiService { responseType: ResponseType.json, baseUrl: baseUrl, ); - dio.interceptors.add(DioLogInterceptor()); + // dio.interceptors.add(DioLogInterceptor()); dio.interceptors.add( InterceptorsWrapper(onRequest: (RequestOptions options) { debugPrint("\n======================= 请求数据 ======================="); diff --git a/lib/retrofit/data/latlng.dart b/lib/retrofit/data/latlng.dart new file mode 100644 index 00000000..2682f784 --- /dev/null +++ b/lib/retrofit/data/latlng.dart @@ -0,0 +1,16 @@ + + +// +// class Latlng { +// +// +// /// Latitude in degrees +// final double latitude; +// +// /// Longitude, in degrees +// final double longitude; +// +// +// Latlng(this.latitude, this.longitude); +// +// } diff --git a/lib/retrofit/data/store_info.dart b/lib/retrofit/data/store_info.dart index ed58193d..09fa0883 100644 --- a/lib/retrofit/data/store_info.dart +++ b/lib/retrofit/data/store_info.dart @@ -125,7 +125,7 @@ class StoreInfo { 'couponVOList': this.couponVOList, 'createTime': this.createTime, 'createUser': this.createUser, - 'deliveryInfo': this.deliveryInfo.toJson(), + 'deliveryInfo': this.deliveryInfo != null ? this.deliveryInfo.toJson() : null, 'pickupType':this.pickupType.toJson(), 'district': this.district, 'headMobile': this.headMobile, @@ -150,7 +150,7 @@ class StoreInfo { 'remark': this.remark, 'shipAddress': this.shipAddress, 'storeName': this.storeName, - 'storeTable': this.storeTable.toJson(), + 'storeTable': this.storeTable != null ? this.storeTable.toJson() : null, 'tenantCode': this.tenantCode, 'updateTime': this.updateTime, 'updateUser': this.updateUser, diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 295b20f1..e45433aa 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -27,8 +27,9 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +// const localBaseUrl = "http://192.168.10.54:8765/app/";///本地 // const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///测试 +const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index f1d4dc15..432d7331 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -66,8 +66,9 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.54:8766/app/";///本地 +// const localBaseUrl = "http://192.168.10.54:8766/app/";///本地 // const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///测试 +const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 const ipBaseUrl = "http://whois.pconline.com.cn"; @@ -183,11 +184,14 @@ abstract class ApiService { @Part(name: "folderId") int folderId, bool isVideo); /// 周边搜索 - @GET( - "https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") + @GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") Future searchPoi(@Path("lat") String lat, @Path("lng") String lng, @Path("keywords") String keywords, int size, int page); + /// 逆地理编码 + @GET("https://restapi.amap.com/v3/geocode/regeo?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&extensions=base") + Future geocodeRegeo(@Path("lat") String lat, @Path("lng") String lng); + /// 用户登录 @POST("/auth/platform/memberLogin") Future memberLogin(@Body() Map param); diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index db98afb0..65f62dad 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -72,6 +72,26 @@ class _ApiService implements ApiService { return value; } + @override + Future geocodeRegeo(lat, lng) async { + ArgumentError.checkNotNull(lat, 'lat'); + ArgumentError.checkNotNull(lng, 'lng'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request( + 'https://restapi.amap.com/v3/geocode/regeo?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=${lng},${lat}&extensions=base', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = _result.data; + return value; + } + @override Future memberLogin(param) async { ArgumentError.checkNotNull(param, 'param'); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index b6e7da6b..e594a731 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -5,17 +5,17 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; -import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:fluwx/fluwx.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity_details.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/down_order.dart'; +import 'package:huixiang/retrofit/data/latlng.dart'; import 'package:huixiang/retrofit/data/launch_join_act.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart'; @@ -401,9 +401,9 @@ class _Settlement extends State { BaseData> baseDate = await minService.queryAddress().catchError((error) {}); - BMFCoordinate bmfCoordinate = BMFCoordinate( - double.tryParse(storeInfo.latitude), - double.tryParse(storeInfo.longitude), + Position bmfCoordinate = Position( + latitude: double.tryParse(storeInfo.latitude), + longitude: double.tryParse(storeInfo.longitude), ); if (baseDate != null && baseDate.isSuccess) { setState(() { @@ -411,26 +411,26 @@ class _Settlement extends State { }); for (int i = 1; i < baseDate.data.length; i++) { Address address1 = baseDate.data[i]; - - BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( - coordinate: BMFCoordinate( - double.tryParse(address.longitude), - double.tryParse(address.latitude), - ), - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); - BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( - coordinate: BMFCoordinate( - double.tryParse(address1.longitude), - double.tryParse(address1.latitude), - ), - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); - - double mi = await BMFCalculateUtils.getLocationDistance( - bmfCoordinate, coordinate); - double mi1 = await BMFCalculateUtils.getLocationDistance( - bmfCoordinate, coordinate1); + Position coordinate = Position( // COMMON->BD09LL + longitude: double.tryParse(address.longitude), + latitude: double.tryParse(address.latitude), + ); + Position coordinate1 = Position(// COMMON->BD09LL + longitude: double.tryParse(address1.longitude), + latitude: double.tryParse(address1.latitude), + ); + double mi = Geolocator.distanceBetween( + bmfCoordinate.latitude, + bmfCoordinate.longitude, + coordinate.latitude, + coordinate.longitude, + ); + double mi1 = Geolocator.distanceBetween( + bmfCoordinate.latitude, + bmfCoordinate.longitude, + coordinate1.latitude, + coordinate1.longitude, + ); if (mi1 < mi) { address = address1; } diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index 6e93ceb7..5a709271 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -1,11 +1,9 @@ import 'package:flutter/material.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/flutter_bmflocation.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; +import 'package:huixiang/retrofit/data/latlng.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -44,7 +42,7 @@ class _DistributionMode extends State { "assets/svg/dingdan_wuliu.svg", ]; - BMFCoordinate myLatLng; + Position myLatLng; String distance = "0"; int selectedBtn = 0; @@ -57,24 +55,29 @@ class _DistributionMode extends State { ///定位获取当前的位置 void startLocation() async { - Location.getInstance().startLocation(context, (BaiduLocation result) { + LocationInstance.getInstance().startLocation(context, (Position result) { if (result != null && result.latitude != null && result.longitude != null) { print("location: $result"); - myLatLng = BMFCoordinate(result.latitude, result.longitude); + myLatLng = Position(latitude: result.latitude, longitude: result.longitude); calculate(); - Location.getInstance().stopLocation(); + LocationInstance.getInstance().stopLocation(); } }); } calculate() async { - BMFCoordinate bmfCoordinate = BMFCoordinate( - double.tryParse(widget.storeInfo.latitude), - double.tryParse(widget.storeInfo.longitude), + Position bmfCoordinate = Position( + latitude: double.tryParse(widget.storeInfo.latitude), + longitude: double.tryParse(widget.storeInfo.longitude), ); - distance = await AppUtils.calculateDistance(bmfCoordinate, myLatLng); + distance = "${Geolocator.distanceBetween( + bmfCoordinate.latitude, + bmfCoordinate.longitude, + myLatLng.latitude, + myLatLng.longitude, + )}"; setState(() {}); } diff --git a/lib/store/shopping/shopping_cart/shopping_cart_page.dart b/lib/store/shopping/shopping_cart/shopping_cart_page.dart index a2e65784..3004c1d9 100644 --- a/lib/store/shopping/shopping_cart/shopping_cart_page.dart +++ b/lib/store/shopping/shopping_cart/shopping_cart_page.dart @@ -112,13 +112,14 @@ class _ShoppingCartPage extends State cartSkuItem.selected = selected; shopCarTemp["selected"] = selected; shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; - BaseData baseDate = await minService.shoppingCartSingle(shopCarTemp); + BaseData baseDate = await minService.shoppingCartSingle(shopCarTemp).catchError((error){}); if (baseDate.isSuccess) { - setState(() { - queryShopCar(); - }); + queryShopCar(); + refreshController.refreshCompleted(); + } else { + queryShopCar(); + refreshController.refreshFailed(); } - refreshController.refreshFailed(); } final SwiperController controller = SwiperController(); diff --git a/lib/store/shopping/shopping_home/classify_list.dart b/lib/store/shopping/shopping_home/classify_list.dart index b1012485..ccf81867 100644 --- a/lib/store/shopping/shopping_home/classify_list.dart +++ b/lib/store/shopping/shopping_home/classify_list.dart @@ -1,6 +1,5 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:huixiang/retrofit/data/shopping_home_config.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; diff --git a/lib/store/shopping/shopping_home/search_page.dart b/lib/store/shopping/shopping_home/search_page.dart index 23f27ba8..864e0511 100644 --- a/lib/store/shopping/shopping_home/search_page.dart +++ b/lib/store/shopping/shopping_home/search_page.dart @@ -1,6 +1,5 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 93725588..9b04c52e 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -912,8 +912,21 @@ class _StoreOrderPage extends State if (shopCartKey != null) { shopCartKey.currentState.setState(() {}); } - setState(() {}); + } else { + this.shopCarGoods = await queryShopCar(); + if (shopCartKey != null) { + shopCartKey.currentState.setState(() {}); + } + if (baseDate != null + && baseDate.msg != null + && baseDate.msg != "") { + SmartDialog.showToast( + "${baseDate.msg}", + alignment: Alignment.center, + ); + } } + setState(() {}); return this.shopCarGoods; } diff --git a/lib/store/store_view/shop_car.dart b/lib/store/store_view/shop_car.dart index 57d1ba48..4aba88e5 100644 --- a/lib/store/store_view/shop_car.dart +++ b/lib/store/store_view/shop_car.dart @@ -80,7 +80,9 @@ class _ShopCar extends State { ), InkWell( onTap: () { - widget.shopingCar.shoppingCartSkuItemList.clear(); + if (widget.shopingCar.shoppingCartSkuItemList != null) { + widget.shopingCar.shoppingCartSkuItemList.clear(); + } state(() {}); widget.clearShopCar(); }, diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart index 5aff71d7..571ca431 100644 --- a/lib/store/store_view/store_info.dart +++ b/lib/store/store_view/store_info.dart @@ -1,10 +1,14 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/location.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -168,15 +172,7 @@ class _StoreInfoView extends State { GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Navigator.of(context).pushNamed( - '/router/location_map', - arguments: { - "lat": widget.storeInfo.latitude, - "lng": widget.storeInfo.longitude, - "storeInfo":widget.storeInfo, - "distance":widget.distance - }, - ); + showMapSelect(); }, child:Container( color: Colors.transparent, @@ -193,15 +189,7 @@ class _StoreInfoView extends State { behavior: HitTestBehavior.opaque, onTap: () { if(widget.storeInfo.longitude != null && widget.storeInfo.latitude != null){ - Navigator.of(context).pushNamed( - '/router/location_map', - arguments: { - "lat": widget.storeInfo.latitude, - "lng": widget.storeInfo.longitude, - "storeInfo":widget.storeInfo, - "distance":widget.distance - }, - ); + showMapSelect(); }else{ return; } @@ -307,4 +295,57 @@ class _StoreInfoView extends State { )) .toList(); } + + + showMapSelect() { + showCupertinoModalPopup( + context: context, + builder: (context) { + return CupertinoActionSheet( + actions: [ + CupertinoActionSheetAction( + child: Text( + "使用高德地图导航", + style: TextStyle( + fontWeight: MyFontWeight.regular, + ), + ), + onPressed: () { + onOpenBaiduMap(); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + ], + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).quxiao, + style: TextStyle( + color: Colors.blue, + ),), + isDestructiveAction: true, + ), + ); + }); + } + + void onOpenBaiduMap() async { + LocationInstance.getInstance().startLocation(context, (locationData) { + String url = "${Platform.isIOS ? 'ios' : 'android'}amap://path?sourceApplication=haixia&sid=" + "&slat=${locationData.latitude.toStringAsFixed(8)}&slon=${locationData.longitude.toStringAsFixed(8)}&sname=&did=&dlat=${widget.storeInfo.latitude}&dlon=${widget.storeInfo.longitude}&dname=&dev=0&t=0"; + launch(url).then((value) { + if (!value) { + SmartDialog.showToast( + "未检测到安装高德地图", + alignment: Alignment.center, + ); + } + }); + }); + } + + } diff --git a/lib/union/location_map_page.dart b/lib/union/location_map_page.dart index ec1d52a6..a6378cab 100644 --- a/lib/union/location_map_page.dart +++ b/lib/union/location_map_page.dart @@ -1,1208 +1,1204 @@ -import 'dart:convert'; -import 'dart:io'; -import 'dart:ui'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.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_baidu_mapapi_search/flutter_baidu_mapapi_search.dart'; -import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:huixiang/utils/flutter_utils.dart'; -import 'package:huixiang/utils/font_weight.dart'; -import 'package:huixiang/utils/location.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import '../generated/l10n.dart'; -import '../retrofit/data/store_info.dart'; -import '../view_widget/custom_image.dart'; -import '../view_widget/location_tips.dart'; -import '../view_widget/round_button.dart'; - -class LocationMap extends StatefulWidget { - final Map arguments; - - LocationMap({this.arguments}); - - @override - State createState() { - return _LocationMap(); - } -} - -class _LocationMap extends State with WidgetsBindingObserver { - StoreInfo storeInfo; - int navigationState = 0; - double distance; - int navigationType = 0; - bool positionSorta = false; - String myAddress; - String myCity; - String hours; - String minutes; - String polylineId; - bool _isShowLocalTips = false; - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addObserver(this); - storeInfo = widget.arguments["storeInfo"]; - distance = widget.arguments["distance"]; - getLocation(); - } - - void getLocation() async { - bool powerFlag = false; - try { - Future.delayed(Duration(seconds: 5), () { - Location.getInstance().stopLocation(); - }); - powerFlag = await Location.getInstance().startLocation(context, - (BaiduLocation result) { - if (result != null && - result.latitude != null && - result.longitude != null) { - print("location: $result"); - myLatLng = BMFCoordinate(result.latitude, result.longitude); - myAddress = result.locationDetail; - myCity = result.city; - if (distance == null) calculate(); - // AppUtils.coordConvert(myLatLng).then((value) { - // this.myLatLng = value; - locationShow(); - // }); - Location.getInstance().stopLocation(); - } - }); - } finally { - if (!powerFlag) { - if (await Permission.locationWhenInUse.status.isGranted) { - getLocation(); - } else { - _isShowLocalTips = true; - } - // else { - // SmartDialog.showToast("您定位服务未开启,请前往系统设置中开启定位服务", - // alignment: Alignment.center); - // } - } - setState(() {}); - } - } - - calculate() async { - BMFCoordinate bmfCoordinate = BMFCoordinate( - double.tryParse(storeInfo.latitude), - double.tryParse(storeInfo.longitude), - ); - distance = double.tryParse( - await AppUtils.calculateDistance(bmfCoordinate, myLatLng, isMi: true)); - } - - locationShow() { - BMFLocation location = BMFLocation( - coordinate: myLatLng, - altitude: 0, - horizontalAccuracy: 5, - verticalAccuracy: -1.0, - speed: -1.0, - course: -1.0, - ); - BMFUserLocation userLocation = BMFUserLocation( - location: location, - ); - setState(() { - _mapController.updateLocationData(userLocation); - }); - } - - @override - void dispose() { - WidgetsBinding.instance.removeObserver(this); - Location.getInstance().stopLocation(); - super.dispose(); - } - - @override - void didChangeAppLifecycleState(AppLifecycleState state) { - if (state == AppLifecycleState.resumed) { - // 处理应用程序切换回前台的逻辑 - permissionSettings(); - } else if (state == AppLifecycleState.paused) { - // 处理应用程序切换到后台的逻辑 - } - } - - void permissionSettings() async { - if (_isShowLocalTips && await Permission.location.isGranted) { - _isShowLocalTips = false; - getLocation(); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - // appBar: MyAppBar( - // background: Color(0xFFF7F7F7), - // title: widget.arguments["storeName"], - // titleColor: Colors.black87, - // titleSize: 18.sp, - // leadingColor: Colors.black, - // ), - body: Stack( - children: [ - Stack( - children: [ - Column( - children: [ - Expanded( - child: Container( - //BMFMapWidget 组件会自动默认沾满全屏,并且挡住所有遮盖物 ,BMFTextureMapWidget不会强制遮盖其他控件。 - child: (Platform.isAndroid) - ? BMFTextureMapWidget( - mapOptions: BMFMapOptions( - center: BMFCoordinate( - double.tryParse(widget.arguments["lat"]), - double.tryParse(widget.arguments["lng"]), - ), - showZoomControl: false, - showMapScaleBar: false, - rotateEnabled: false, - zoomLevel: 15, - ), - onBMFMapCreated: onMapCreated, - ) - : BMFMapWidget( - mapOptions: BMFMapOptions( - center: BMFCoordinate( - double.tryParse(widget.arguments["lat"]), - double.tryParse(widget.arguments["lng"]), - ), - showZoomControl: false, - showMapScaleBar: false, - rotateEnabled: false, - zoomLevel: 15, - ), - onBMFMapCreated: onMapCreated, - )), - flex: 3, - ), - navigationState == 0 - ? Container( - height: 253.h, - padding: EdgeInsets.only( - top: 16.h, left: 16.w, right: 28.w), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x08213303), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.vertical( - top: Radius.circular(8), - ), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Row( - children: [ - Expanded( - child: Column( - children: [ - Text( - storeInfo?.storeName ?? "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 20.sp, - color: Color(0xFF0D0D0D), - fontWeight: MyFontWeight.medium, - ), - ), - Row( - children: [ - Text( - S.of(context).ren( - storeInfo != null - ? storeInfo - .perCapitaConsumption - : "", - ), - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: - MyFontWeight.regular, - color: Color(0xFF4D4D4D), - ), - ), - SizedBox( - width: 20.w, - ), - ]..addAll(itemServer( - storeInfo != null - ? storeInfo.businessService - : "")), - ), - Text( - S.of(context).yingyeshijian(storeInfo == - null - ? "" - : (storeInfo.openStartTime == - null && - storeInfo.openEndTime == - null) - ? S.of(context).quantian - : "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} " - "- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"), - style: TextStyle( - color: Color(0xFF4D4D4D), - fontWeight: MyFontWeight.medium, - fontSize: 12.sp, - ), - ), - ], - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: - CrossAxisAlignment.start, - ), - ), - MImage( - storeInfo != null ? storeInfo.logo : "", - width: 72.h, - height: 72.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - ], - ), - ), - Padding( - padding: EdgeInsets.only(bottom: 32.h), - child: Text( - "${storeInfo != null ? storeInfo.address : ""}", - maxLines: 2, - textAlign: TextAlign.justify, - style: TextStyle( - color: Color(0xFF353535), - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - ), - ), - ), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - if (myLatLng == null) { - // onOpenBaiduMap(); - SmartDialog.showToast( - "您定位服务未开启,请前往系统设置中开启定位服务", - alignment: Alignment.center); - } else { - navigationState = 1; - if ((distance ?? 0) < 500) - navigationType = 1; - else if ((distance ?? 0) < 1500) - navigationType = 2; - else - navigationType = 4; - navigationPosition(); - } - }, - child: Container( - alignment: Alignment.center, - width: double.infinity, - padding: EdgeInsets.symmetric(vertical: 10.h), - margin: EdgeInsets.only(bottom: 30.h), - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(23), - ), - child: Text( - "到这去", - style: TextStyle( - fontSize: 20.sp, - color: Colors.white, - fontWeight: MyFontWeight.medium, - ), - ), - ), - ) - ], - ), - ) - : navigationDistance(), - ], - ), - navigationState == 0 - ? GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - height: 56.h, - margin: EdgeInsets.only( - top: MediaQuery.of(context).padding.top + 16.h, - left: 14.w, - right: 14.w), - padding: EdgeInsets.only(left: 12.w, right: 21.w), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x08213303), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.circular(6), - ), - child: Row( - children: [ - Icon( - Icons.arrow_back_ios, - color: Color(0xFF353535), - size: 24, - ), - Expanded( - child: Text( - storeInfo?.storeName ?? "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 18.sp, - fontWeight: MyFontWeight.regular, - ), - )) - ], - ), - ), - ) - : navigationBox(), - ], - ), - if (_isShowLocalTips) - Padding( - padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), - child: LocationTips(() { - setState(() { - _isShowLocalTips = false; - }); - }), - ) - ], - ), - ); - } - - void onOpenBaiduMap() async { - launch( - "baidumap://map/marker?location=${storeInfo.latitude},${storeInfo.longitude}&title=${storeInfo.storeName}&content=${storeInfo.storeName}&traffic=on&src=andr.baidu.openAPIdemo&coord_type=gcj02"); - } - - //調取百度地圖APP - void onOpenBaiduMapRoute() async { - // 我的位置 - BMFCoordinate startCoord = BMFCoordinate( - positionSorta == false - ? myLatLng.latitude - : latLng.latitude, - positionSorta == false - ? myLatLng.longitude - : latLng.longitude); - String startName = ((positionSorta == false) ? "我的位置" : "终点"); - // 去的位置 - String endName = ((positionSorta == false) ? "终点" : "我的位置"); - BMFCoordinate endCoord = BMFCoordinate( - positionSorta == false - ? latLng.latitude - : myLatLng.latitude, - positionSorta == false - ? latLng.longitude - : myLatLng.longitude); - BMFOpenRouteOption routeOption = BMFOpenRouteOption( - startCoord: startCoord, - startName: startName, - endCoord: endCoord, - endName: endName, - routeType: navigationType == 1 - ? BMFOpenRouteType.WalkingRoute - : navigationType == 2 - ? BMFOpenRouteType.WalkingRoute - : navigationType == 3 - ? BMFOpenRouteType.TransitRoute - : BMFOpenRouteType.DrivingRoute, - appScheme: 'baidumapsdk_flutter://mapsdk.baidu.com', - // 指定返回自定义scheme - isSupportWeb: true); - BMFOpenErrorCode flag = - await BMFOpenMapUtils.openBaiduMapRoute(routeOption); - print('open - route - errorCode = $flag'); - } - - updateMapLine(List coordinates, int needHours, int needMinutes, - double needDistance) { - try { - //刪除之前的創建的點和綫 - _mapController.cleanAllMarkers(); - if (polylineId != null) _mapController.removeOverlay(polylineId); - - /// 创建polyline - BMFPolyline colorsPolyline = BMFPolyline( - // id: polylineOptions.hashCode.toString(), - coordinates: coordinates, - indexs: [0], - textures: [ - navigationType != 4 - ? 'assets/image/traffic_texture_unknown.png' - : 'assets/image/traffic_texture_smooth.png' - ], - width: Platform.isAndroid ? 16 : 10, - lineDashType: BMFLineDashType.LineDashTypeNone, - lineCapType: BMFLineCapType.LineCapButt, - lineJoinType: BMFLineJoinType.LineJoinRound); - polylineId = colorsPolyline.id; - - /// 添加polyline - _mapController.addPolyline(colorsPolyline); - var startBmfMarker = BMFMarker.icon( - position: BMFCoordinate( - coordinates.first.latitude, coordinates.first.longitude), - centerOffset: BMFPoint(0.5, 0.7), - enabled: false, - icon: "assets/image/icon_start.png", - draggable: false, - ); - _mapController.addMarker(startBmfMarker); - - var terminalBmfMarker = BMFMarker.icon( - position: BMFCoordinate( - coordinates.last.latitude, coordinates.last.longitude), - centerOffset: BMFPoint(0.5, 0.7), - enabled: false, - icon: "assets/image/icon_end.png", - draggable: false, - ); - _mapController.addMarker(terminalBmfMarker); - - double maxLatitude = 0, - minLatitude = 0, - maxLongitude = 0, - minLongitude = 0; - coordinates.forEach((element) { - if (element.latitude > maxLatitude) maxLatitude = element.latitude; - if (minLatitude == 0) - minLatitude = element.latitude; - else if (element.latitude < minLatitude) minLatitude = element.latitude; - - if (element.longitude > maxLongitude) maxLongitude = element.longitude; - if (minLongitude == 0) - minLongitude = element.longitude; - else if (element.longitude < minLongitude) - minLongitude = element.longitude; - }); - _mapController.setVisibleMapBounds( - BMFCoordinateBounds( - northeast: BMFCoordinate( - maxLatitude + ((maxLatitude - minLatitude) * 0.8), - maxLongitude + ((maxLongitude - minLongitude) / 2)), - southwest: BMFCoordinate( - minLatitude - ((maxLatitude - minLatitude) * 0.2), - minLongitude - ((maxLongitude - minLongitude) / 2))), - true); - - hours = needHours == 0 ? "" : "$needHours小时"; - minutes = needMinutes == 0 ? "" : "$needMinutes分钟"; - distance = needDistance; - } finally { - setState(() {}); - EasyLoading.dismiss(); - } - } - - navigationPosition() async { - EasyLoading.show( - status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); - BMFPlanNode from = BMFPlanNode( - cityName: positionSorta == false ? myCity : (storeInfo?.city ?? ""), - name: positionSorta == false ? myAddress : storeInfo?.address ?? "", - pt: positionSorta == false - ? BMFCoordinate(myLatLng?.latitude ?? 0, myLatLng?.longitude ?? 0) - : latLng); - BMFPlanNode to = BMFPlanNode( - // cityName: positionSorta == false ? (storeInfo?.city ?? "") : myCity, - // name: positionSorta == false ? (storeInfo?.address ?? "") : myAddress, - pt: positionSorta == false - ? latLng - : BMFCoordinate(myLatLng?.latitude ?? 0, myLatLng?.longitude ?? 0)); - if (navigationType == 1) { - //步行 - BMFWalkingRoutePlanOption walkingRoutePlanOption = - BMFWalkingRoutePlanOption(from: from, to: to); - // 检索实例 - BMFWalkingRouteSearch walkingRouteSearch = BMFWalkingRouteSearch(); - // 检索回调 - walkingRouteSearch.onGetWalkingRouteSearchResult(callback: - (BMFWalkingRouteResult result, BMFSearchErrorCode errorCode) async { - if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { - SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { - SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } - print( - '`步行检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); - - /// 坐标点 - List coordinates = []; - result.routes.first.steps.forEach((e1) { - e1.points.forEach((e2) { - coordinates.add(BMFCoordinate(e2.latitude, e2.longitude)); - }); - }); - updateMapLine( - coordinates, - result.routes.first.duration.hours, - result.routes.first.duration.minutes, - result.routes.first.distance.toDouble()); - }); - bool flag = - await walkingRouteSearch.walkingRouteSearch(walkingRoutePlanOption); - } else if (navigationType == 2) { - //骑行 - BMFRidingRoutePlanOption ridingRoutePlanOption = - BMFRidingRoutePlanOption(from: from, to: to); - BMFRidingRouteSearch ridingRouteSearch = BMFRidingRouteSearch(); - ridingRouteSearch.onGetRidingRouteSearchResult(callback: - (BMFRidingRouteResult result, BMFSearchErrorCode errorCode) { - if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { - SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { - SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } - print( - '`骑行检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); - - /// 坐标点 - List coordinates = []; - result.routes.first.steps.forEach((e1) { - e1.points.forEach((e2) { - coordinates.add(BMFCoordinate(e2.latitude, e2.longitude)); - }); - }); - updateMapLine( - coordinates, - result.routes.first.duration.hours, - result.routes.first.duration.minutes, - result.routes.first.distance.toDouble()); - }); -// 发起检索 - bool flag = - await ridingRouteSearch.ridingRouteSearch(ridingRoutePlanOption); - } else if (navigationType == 3) { - //公交 - BMFTransitRoutePlanOption transitRoutePlanOption = - BMFTransitRoutePlanOption(from: from, to: to, city: '武汉市'); - BMFTransitRouteSearch transitRouteSearch = BMFTransitRouteSearch(); - transitRouteSearch.onGetTransitRouteSearchResult(callback: - (BMFTransitRouteResult result, BMFSearchErrorCode errorCode) { - if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { - SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { - SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } - print( - '`市内公交检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); - - /// 坐标点 - List coordinates = []; - result.routes.first.steps.forEach((e1) { - e1.points.forEach((e2) { - coordinates.add(BMFCoordinate(e2.latitude, e2.longitude)); - }); - }); - updateMapLine( - coordinates, - result.routes.first.duration.hours, - result.routes.first.duration.minutes, - result.routes.first.distance.toDouble()); - }); -// 发起检索 - bool flag = - await transitRouteSearch.transitRouteSearch(transitRoutePlanOption); - } else { - //驾车 - BMFDrivingRoutePlanOption drivingRoutePlanOption = - BMFDrivingRoutePlanOption(from: from, to: to); - BMFDrivingRouteSearch drivingRouteSearch = BMFDrivingRouteSearch(); - drivingRouteSearch.onGetDrivingRouteSearchResult(callback: - (BMFDrivingRouteResult result, BMFSearchErrorCode errorCode) { - if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { - SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { - SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); - EasyLoading.dismiss(); - return; - } - print( - '驾车检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); - - /// 坐标点 - List coordinates = []; - result.routes.first.steps.forEach((e1) { - e1.points.forEach((e2) { - coordinates.add(BMFCoordinate(e2.latitude, e2.longitude)); - }); - }); - updateMapLine( - coordinates, - result.routes.first.duration.hours, - result.routes.first.duration.minutes, - result.routes.first.distance.toDouble()); - }); -// 发起检索 - bool flag = - await drivingRouteSearch.dringRouteSearch(drivingRoutePlanOption); - } - } - - Widget navigationBox() { - return Container( - height: 132.h, - margin: EdgeInsets.only( - top: MediaQuery.of(context).padding.top + 16.h, - left: 14.w, - right: 14.w), - padding: EdgeInsets.only(left: 12.w, right: 18.w, top: 8.h), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x08213303), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.circular(6), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - navigationState = 0; - }); - }, - child: Padding( - padding: EdgeInsets.only(top: 10.h, right: 10.w), - child: Icon( - Icons.arrow_back_ios, - color: Color(0xFF353535), - size: 24, - ), - ), - ), - Expanded( - child: Column( - children: [ - Container( - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFFF5F5F5), - borderRadius: BorderRadius.circular(6), - ), - padding: EdgeInsets.only( - top: 12.h, - bottom: 12.h, - left: 15.w, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - bottom: 14.h, - ), - child: Row( - children: [ - Container( - width: 4.h, - height: 4.h, - margin: EdgeInsets.only(right: 20.w), - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(6), - ), - ), - Expanded( - child: Text( - positionSorta == false - ? "我的位置" - : (storeInfo?.storeName ?? ""), - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - ), - )) - ], - ), - ), - Row( - children: [ - Container( - width: 4.h, - height: 4.h, - margin: EdgeInsets.only(right: 20.w), - decoration: BoxDecoration( - color: Color(0xFFFA5151), - borderRadius: BorderRadius.circular(6), - ), - ), - Expanded( - child: Text( - positionSorta == false - ? (storeInfo?.storeName ?? "") - : "我的位置", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - ), - )) - ], - ) - ], - )), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - positionSorta = !positionSorta; - navigationPosition(); - }, - child: Container( - padding: EdgeInsets.only(right: 24.w), - child: Image.asset( - "assets/image/position_sort.webp", - fit: BoxFit.fill, - height: 16.h, - width: 14.w, - ), - ), - ) - ], - ), - ), - SizedBox( - height: 12.h, - ), - Row( - children: [ - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - navigationType = 4; - navigationPosition(); - }, - child: Container( - decoration: BoxDecoration( - color: navigationType == 4 - ? Color(0xFFE8FFF2) - : Colors.transparent, - borderRadius: BorderRadius.circular(23), - ), - padding: - EdgeInsets.symmetric(vertical: 5.h, horizontal: 13.w), - child: Row( - children: [ - if (navigationType == 4) - Image.asset( - "assets/image/icon_drive.webp", - fit: BoxFit.fill, - height: 16.h, - width: 14.w, - ), - Padding( - padding: EdgeInsets.only(left: 2.w), - child: Text( - "驾车", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: navigationType == 4 - ? Color(0xFF32A060) - : Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ) - ], - ), - ), - )), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - navigationType = 3; - navigationPosition(); - }, - child: Container( - decoration: BoxDecoration( - color: navigationType == 3 - ? Color(0xFFE8FFF2) - : Colors.transparent, - borderRadius: BorderRadius.circular(23), - ), - padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 13.w), - child: Row( - children: [ - if (navigationType == 3) - Image.asset( - "assets/image/icon_transit.webp", - fit: BoxFit.fill, - height: 16.h, - width: 14.w, - ), - Padding( - padding: EdgeInsets.only(left: 2.w), - child: Text( - "公交", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: navigationType == 3 - ? Color(0xFF32A060) - : Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ) - ], - ), - ))), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - navigationType = 2; - navigationPosition(); - }, - child: Container( - decoration: BoxDecoration( - color: navigationType == 2 - ? Color(0xFFE8FFF2) - : Colors.transparent, - borderRadius: BorderRadius.circular(23), - ), - padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 13.w), - child: Row( - children: [ - if (navigationType == 2) - Image.asset( - "assets/image/icon_by_bike.webp", - fit: BoxFit.fill, - height: 16.h, - width: 14.w, - ), - Padding( - padding: EdgeInsets.only(left: 2.w), - child: Text( - "骑行", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: navigationType == 2 - ? Color(0xFF32A060) - : Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ) - ], - ), - ))), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - navigationType = 1; - navigationPosition(); - }, - child: Container( - decoration: BoxDecoration( - color: navigationType == 1 - ? Color(0xFFE8FFF2) - : Colors.transparent, - borderRadius: BorderRadius.circular(23), - ), - padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 13.w), - child: Row( - children: [ - if (navigationType == 1) - Image.asset( - "assets/image/icon_walk.webp", - fit: BoxFit.fill, - height: 16.h, - width: 14.w, - ), - Padding( - padding: EdgeInsets.only(left: 2.w), - child: Text( - "步行", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: navigationType == 1 - ? Color(0xFF32A060) - : Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ) - ], - ), - ))), - ], - ) - ], - )) - ], - ), - ); - } - - Widget navigationDistance() { - return Container( - height: 173.h, - padding: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x08213303), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.vertical( - top: Radius.circular(8), - ), - ), - child: Column( - // mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "${navigationType == 1 ? "步行" : navigationType == 2 ? "骑行" : navigationType == 3 ? "公交" : "驾车"}${(hours ?? "") + (minutes ?? "")}", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 20.sp, - color: Color(0xFF0D0D0D), - fontWeight: MyFontWeight.bold, - ), - ), - Padding( - padding: EdgeInsets.only(left: 40.w), - child: Text( - (distance ?? 0) > 1000 - ? S.of(context).gongli( - ((distance ?? 0) / 1000 * 100).toInt() / 100.0) - : S - .of(context) - .mi(((distance ?? 0) * 100).toInt() / 100.0), - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 20.sp, - color: Color(0xFF0D0D0D), - fontWeight: MyFontWeight.bold, - ), - ), - ), - ], - ), - ), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - navigationState = 1; - showMapSelect(); - }); - }, - child: Container( - alignment: Alignment.center, - width: double.infinity, - padding: EdgeInsets.symmetric(vertical: 10.h), - margin: EdgeInsets.only(bottom: 30.h), - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(23), - ), - child: Text( - navigationType == 1 - ? "步行导航" - : navigationType == 2 - ? "骑行导航" - : navigationType == 3 - ? "公交导航" - : "驾车导航", - style: TextStyle( - fontSize: 20.sp, - color: Colors.white, - fontWeight: MyFontWeight.medium, - ), - ), - ), - ) - ], - ), - ); - } - - showMapSelect() { - showCupertinoModalPopup( - context: context, - builder: (context) { - return CupertinoActionSheet( - actions: [ - CupertinoActionSheetAction( - child: Text( - "百度地图", - style: TextStyle( - fontWeight: MyFontWeight.regular, - ), - ), - onPressed: () { - onOpenBaiduMapRoute(); - Navigator.of(context).pop(); - }, - isDefaultAction: true, - isDestructiveAction: false, - ), - ], - cancelButton: CupertinoActionSheetAction( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(S.of(context).quxiao, - style: TextStyle( - color: Colors.blue, - ),), - isDestructiveAction: true, - ), - ); - }); - } - - List itemServer(String businessService) { - if (businessService == null || businessService == "") return []; - var list = businessService.split(","); - return list - .map((e) => Container( - margin: EdgeInsets.only(right: 8.w), - child: RoundButton( - height: 17.h * AppUtils.textScale(context), - text: "$e", - backgroup: Color(0xFFFF7A1A), - padding: EdgeInsets.only( - left: 2.w, - right: 2.w, - ), - fontSize: 10.sp, - textColor: Colors.white, - ), - )) - .toList(); - } - - BMFMapController _mapController; - BMFCoordinate latLng; - BMFCoordinate myLatLng; - BMFMarker bmfMarker; - - onMapCreated(BMFMapController controller) { - _mapController = controller; - setState(() { - _mapController.showUserLocation(true); - _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); - BMFUserLocationDisplayParam displayParam = BMFUserLocationDisplayParam( - locationViewOffsetX: 0, - locationViewOffsetY: 0, - accuracyCircleFillColor: Colors.red, - accuracyCircleStrokeColor: Colors.blue, - isAccuracyCircleShow: true, - locationViewImage: 'assets/image/icon_my_location.webp', - locationViewHierarchy: - BMFLocationViewHierarchy.LOCATION_VIEW_HIERARCHY_BOTTOM, - ); - _mapController.updateLocationViewWithParam(displayParam); - addMarker(); - }); - } - - addMarker() async { - latLng = await AppUtils.coordConvert(BMFCoordinate(double.tryParse(widget.arguments["lat"]), - double.tryParse(widget.arguments["lng"]))); - // latLng = BMFCoordinate(double.tryParse(widget.arguments["lat"]), - // double.tryParse(widget.arguments["lng"])); - - if (bmfMarker == null && _mapController != null) { - bmfMarker = BMFMarker.icon( - position: latLng, - centerOffset: BMFPoint(0.5, 0.7), - enabled: false, - icon: "assets/image/icon_map_marker.webp", - draggable: false, - ); - _mapController.addMarker(bmfMarker); - } - _mapController.setCenterCoordinate(latLng, true); - } -} +// import 'dart:convert'; +// import 'dart:io'; +// import 'dart:ui'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// +// import 'package:flutter_easyloading/flutter_easyloading.dart'; +// import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +// import 'package:huixiang/utils/flutter_utils.dart'; +// import 'package:huixiang/utils/font_weight.dart'; +// import 'package:huixiang/utils/location.dart'; +// import 'package:flutter_screenutil/flutter_screenutil.dart'; +// import 'package:permission_handler/permission_handler.dart'; +// import 'package:url_launcher/url_launcher.dart'; +// +// import '../generated/l10n.dart'; +// import '../retrofit/data/store_info.dart'; +// import '../view_widget/custom_image.dart'; +// import '../view_widget/location_tips.dart'; +// import '../view_widget/round_button.dart'; +// +// class LocationMap extends StatefulWidget { +// final Map arguments; +// +// LocationMap({this.arguments}); +// +// @override +// State createState() { +// return _LocationMap(); +// } +// } +// +// class _LocationMap extends State with WidgetsBindingObserver { +// StoreInfo storeInfo; +// int navigationState = 0; +// double distance; +// int navigationType = 0; +// bool positionSorta = false; +// String myAddress; +// String myCity; +// String hours; +// String minutes; +// String polylineId; +// bool _isShowLocalTips = false; +// +// @override +// void initState() { +// super.initState(); +// WidgetsBinding.instance.addObserver(this); +// storeInfo = widget.arguments["storeInfo"]; +// distance = widget.arguments["distance"]; +// getLocation(); +// } +// +// void getLocation() async { +// bool powerFlag = false; +// try { +// Future.delayed(Duration(seconds: 5), () { +// LocationInstance.getInstance().stopLocation(); +// }); +// powerFlag = await LocationInstance.getInstance().startLocation(context, +// (BaiduLocation result) { +// if (result != null && +// result.latitude != null && +// result.longitude != null) { +// print("location: $result"); +// myLatLng = Latlng(result.latitude, result.longitude); +// myAddress = result.locationDetail; +// myCity = result.city; +// if (distance == null) calculate(); +// // AppUtils.coordConvert(myLatLng).then((value) { +// // this.myLatLng = value; +// locationShow(); +// // }); +// LocationInstance.getInstance().stopLocation(); +// } +// }); +// } finally { +// if (!powerFlag) { +// if (await Permission.locationWhenInUse.status.isGranted) { +// getLocation(); +// } else { +// _isShowLocalTips = true; +// } +// // else { +// // SmartDialog.showToast("您定位服务未开启,请前往系统设置中开启定位服务", +// // alignment: Alignment.center); +// // } +// } +// setState(() {}); +// } +// } +// +// calculate() async { +// Latlng bmfCoordinate = Latlng( +// double.tryParse(storeInfo.latitude), +// double.tryParse(storeInfo.longitude), +// ); +// distance = double.tryParse( +// await AppUtils.calculateDistance(bmfCoordinate, myLatLng, isMi: true)); +// } +// +// locationShow() { +// BMFLocation location = BMFLocation( +// coordinate: myLatLng, +// altitude: 0, +// horizontalAccuracy: 5, +// verticalAccuracy: -1.0, +// speed: -1.0, +// course: -1.0, +// ); +// BMFUserLocation userLocation = BMFUserLocation( +// location: location, +// ); +// setState(() { +// _mapController.updateLocationData(userLocation); +// }); +// } +// +// @override +// void dispose() { +// WidgetsBinding.instance.removeObserver(this); +// LocationInstance.getInstance().stopLocation(); +// super.dispose(); +// } +// +// @override +// void didChangeAppLifecycleState(AppLifecycleState state) { +// if (state == AppLifecycleState.resumed) { +// // 处理应用程序切换回前台的逻辑 +// permissionSettings(); +// } else if (state == AppLifecycleState.paused) { +// // 处理应用程序切换到后台的逻辑 +// } +// } +// +// void permissionSettings() async { +// if (_isShowLocalTips && await Permission.location.isGranted) { +// _isShowLocalTips = false; +// getLocation(); +// } +// } +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// // appBar: MyAppBar( +// // background: Color(0xFFF7F7F7), +// // title: widget.arguments["storeName"], +// // titleColor: Colors.black87, +// // titleSize: 18.sp, +// // leadingColor: Colors.black, +// // ), +// body: Stack( +// children: [ +// Stack( +// children: [ +// Column( +// children: [ +// Expanded( +// child: Container( +// //BMFMapWidget 组件会自动默认沾满全屏,并且挡住所有遮盖物 ,BMFTextureMapWidget不会强制遮盖其他控件。 +// child: (Platform.isAndroid) +// ? BMFTextureMapWidget( +// mapOptions: BMFMapOptions( +// center: Latlng( +// double.tryParse(widget.arguments["lat"]), +// double.tryParse(widget.arguments["lng"]), +// ), +// showZoomControl: false, +// showMapScaleBar: false, +// rotateEnabled: false, +// zoomLevel: 15, +// ), +// onBMFMapCreated: onMapCreated, +// ) +// : BMFMapWidget( +// mapOptions: BMFMapOptions( +// center: Latlng( +// double.tryParse(widget.arguments["lat"]), +// double.tryParse(widget.arguments["lng"]), +// ), +// showZoomControl: false, +// showMapScaleBar: false, +// rotateEnabled: false, +// zoomLevel: 15, +// ), +// onBMFMapCreated: onMapCreated, +// )), +// flex: 3, +// ), +// navigationState == 0 +// ? Container( +// height: 253.h, +// padding: EdgeInsets.only( +// top: 16.h, left: 16.w, right: 28.w), +// decoration: BoxDecoration( +// color: Colors.white, +// boxShadow: [ +// BoxShadow( +// color: Color(0x08213303), +// offset: Offset(0, 2), +// blurRadius: 4, +// spreadRadius: 0, +// ), +// ], +// borderRadius: BorderRadius.vertical( +// top: Radius.circular(8), +// ), +// ), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Expanded( +// child: Row( +// children: [ +// Expanded( +// child: Column( +// children: [ +// Text( +// storeInfo?.storeName ?? "", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// fontSize: 20.sp, +// color: Color(0xFF0D0D0D), +// fontWeight: MyFontWeight.medium, +// ), +// ), +// Row( +// children: [ +// Text( +// S.of(context).ren( +// storeInfo != null +// ? storeInfo +// .perCapitaConsumption +// : "", +// ), +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// fontSize: 12.sp, +// fontWeight: +// MyFontWeight.regular, +// color: Color(0xFF4D4D4D), +// ), +// ), +// SizedBox( +// width: 20.w, +// ), +// ]..addAll(itemServer( +// storeInfo != null +// ? storeInfo.businessService +// : "")), +// ), +// Text( +// S.of(context).yingyeshijian(storeInfo == +// null +// ? "" +// : (storeInfo.openStartTime == +// null && +// storeInfo.openEndTime == +// null) +// ? S.of(context).quantian +// : "${storeInfo.openStartTime.substring(0, storeInfo.openStartTime.lastIndexOf(":"))} " +// "- ${storeInfo.openEndTime.substring(0, storeInfo.openEndTime.lastIndexOf(":"))}"), +// style: TextStyle( +// color: Color(0xFF4D4D4D), +// fontWeight: MyFontWeight.medium, +// fontSize: 12.sp, +// ), +// ), +// ], +// mainAxisAlignment: +// MainAxisAlignment.spaceAround, +// crossAxisAlignment: +// CrossAxisAlignment.start, +// ), +// ), +// MImage( +// storeInfo != null ? storeInfo.logo : "", +// width: 72.h, +// height: 72.h, +// fit: BoxFit.cover, +// errorSrc: "assets/image/default_1.webp", +// fadeSrc: "assets/image/default_1.webp", +// ), +// ], +// ), +// ), +// Padding( +// padding: EdgeInsets.only(bottom: 32.h), +// child: Text( +// "${storeInfo != null ? storeInfo.address : ""}", +// maxLines: 2, +// textAlign: TextAlign.justify, +// style: TextStyle( +// color: Color(0xFF353535), +// fontWeight: MyFontWeight.regular, +// fontSize: 12.sp, +// ), +// ), +// ), +// GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// if (myLatLng == null) { +// // onOpenBaiduMap(); +// SmartDialog.showToast( +// "您定位服务未开启,请前往系统设置中开启定位服务", +// alignment: Alignment.center); +// } else { +// navigationState = 1; +// if ((distance ?? 0) < 500) +// navigationType = 1; +// else if ((distance ?? 0) < 1500) +// navigationType = 2; +// else +// navigationType = 4; +// navigationPosition(); +// } +// }, +// child: Container( +// alignment: Alignment.center, +// width: double.infinity, +// padding: EdgeInsets.symmetric(vertical: 10.h), +// margin: EdgeInsets.only(bottom: 30.h), +// decoration: BoxDecoration( +// color: Color(0xFF32A060), +// borderRadius: BorderRadius.circular(23), +// ), +// child: Text( +// "到这去", +// style: TextStyle( +// fontSize: 20.sp, +// color: Colors.white, +// fontWeight: MyFontWeight.medium, +// ), +// ), +// ), +// ) +// ], +// ), +// ) +// : navigationDistance(), +// ], +// ), +// navigationState == 0 +// ? GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// Navigator.of(context).pop(); +// }, +// child: Container( +// height: 56.h, +// margin: EdgeInsets.only( +// top: MediaQuery.of(context).padding.top + 16.h, +// left: 14.w, +// right: 14.w), +// padding: EdgeInsets.only(left: 12.w, right: 21.w), +// decoration: BoxDecoration( +// color: Colors.white, +// boxShadow: [ +// BoxShadow( +// color: Color(0x08213303), +// offset: Offset(0, 2), +// blurRadius: 4, +// spreadRadius: 0, +// ), +// ], +// borderRadius: BorderRadius.circular(6), +// ), +// child: Row( +// children: [ +// Icon( +// Icons.arrow_back_ios, +// color: Color(0xFF353535), +// size: 24, +// ), +// Expanded( +// child: Text( +// storeInfo?.storeName ?? "", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: Color(0xFF0D0D0D), +// fontSize: 18.sp, +// fontWeight: MyFontWeight.regular, +// ), +// )) +// ], +// ), +// ), +// ) +// : navigationBox(), +// ], +// ), +// if (_isShowLocalTips) +// Padding( +// padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), +// child: LocationTips(() { +// setState(() { +// _isShowLocalTips = false; +// }); +// }), +// ) +// ], +// ), +// ); +// } +// +// void onOpenBaiduMap() async { +// launch( +// "baidumap://map/marker?location=${storeInfo.latitude},${storeInfo.longitude}&title=${storeInfo.storeName}&content=${storeInfo.storeName}&traffic=on&src=andr.baidu.openAPIdemo&coord_type=gcj02"); +// } +// +// //調取百度地圖APP +// void onOpenBaiduMapRoute() async { +// // 我的位置 +// Latlng startCoord = Latlng( +// positionSorta == false +// ? myLatLng.latitude +// : latLng.latitude, +// positionSorta == false +// ? myLatLng.longitude +// : latLng.longitude); +// String startName = ((positionSorta == false) ? "我的位置" : "终点"); +// // 去的位置 +// String endName = ((positionSorta == false) ? "终点" : "我的位置"); +// Latlng endCoord = Latlng( +// positionSorta == false +// ? latLng.latitude +// : myLatLng.latitude, +// positionSorta == false +// ? latLng.longitude +// : myLatLng.longitude); +// BMFOpenRouteOption routeOption = BMFOpenRouteOption( +// startCoord: startCoord, +// startName: startName, +// endCoord: endCoord, +// endName: endName, +// routeType: navigationType == 1 +// ? BMFOpenRouteType.WalkingRoute +// : navigationType == 2 +// ? BMFOpenRouteType.WalkingRoute +// : navigationType == 3 +// ? BMFOpenRouteType.TransitRoute +// : BMFOpenRouteType.DrivingRoute, +// appScheme: 'baidumapsdk_flutter://mapsdk.baidu.com', +// // 指定返回自定义scheme +// isSupportWeb: true); +// BMFOpenErrorCode flag = +// await BMFOpenMapUtils.openBaiduMapRoute(routeOption); +// print('open - route - errorCode = $flag'); +// } +// +// updateMapLine(List coordinates, int needHours, int needMinutes, +// double needDistance) { +// try { +// //刪除之前的創建的點和綫 +// _mapController.cleanAllMarkers(); +// if (polylineId != null) _mapController.removeOverlay(polylineId); +// +// /// 创建polyline +// BMFPolyline colorsPolyline = BMFPolyline( +// // id: polylineOptions.hashCode.toString(), +// coordinates: coordinates, +// indexs: [0], +// textures: [ +// navigationType != 4 +// ? 'assets/image/traffic_texture_unknown.png' +// : 'assets/image/traffic_texture_smooth.png' +// ], +// width: Platform.isAndroid ? 16 : 10, +// lineDashType: BMFLineDashType.LineDashTypeNone, +// lineCapType: BMFLineCapType.LineCapButt, +// lineJoinType: BMFLineJoinType.LineJoinRound); +// polylineId = colorsPolyline.id; +// +// /// 添加polyline +// _mapController.addPolyline(colorsPolyline); +// var startBmfMarker = BMFMarker.icon( +// position: Latlng( +// coordinates.first.latitude, coordinates.first.longitude), +// centerOffset: BMFPoint(0.5, 0.7), +// enabled: false, +// icon: "assets/image/icon_start.png", +// draggable: false, +// ); +// _mapController.addMarker(startBmfMarker); +// +// var terminalBmfMarker = BMFMarker.icon( +// position: Latlng( +// coordinates.last.latitude, coordinates.last.longitude), +// centerOffset: BMFPoint(0.5, 0.7), +// enabled: false, +// icon: "assets/image/icon_end.png", +// draggable: false, +// ); +// _mapController.addMarker(terminalBmfMarker); +// +// double maxLatitude = 0, +// minLatitude = 0, +// maxLongitude = 0, +// minLongitude = 0; +// coordinates.forEach((element) { +// if (element.latitude > maxLatitude) maxLatitude = element.latitude; +// if (minLatitude == 0) +// minLatitude = element.latitude; +// else if (element.latitude < minLatitude) minLatitude = element.latitude; +// +// if (element.longitude > maxLongitude) maxLongitude = element.longitude; +// if (minLongitude == 0) +// minLongitude = element.longitude; +// else if (element.longitude < minLongitude) +// minLongitude = element.longitude; +// }); +// _mapController.setVisibleMapBounds( +// BMFCoordinateBounds( +// northeast: Latlng( +// maxLatitude + ((maxLatitude - minLatitude) * 0.8), +// maxLongitude + ((maxLongitude - minLongitude) / 2)), +// southwest: Latlng( +// minLatitude - ((maxLatitude - minLatitude) * 0.2), +// minLongitude - ((maxLongitude - minLongitude) / 2))), +// true); +// +// hours = needHours == 0 ? "" : "$needHours小时"; +// minutes = needMinutes == 0 ? "" : "$needMinutes分钟"; +// distance = needDistance; +// } finally { +// setState(() {}); +// EasyLoading.dismiss(); +// } +// } +// +// navigationPosition() async { +// EasyLoading.show( +// status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); +// BMFPlanNode from = BMFPlanNode( +// cityName: positionSorta == false ? myCity : (storeInfo?.city ?? ""), +// name: positionSorta == false ? myAddress : storeInfo?.address ?? "", +// pt: positionSorta == false +// ? Latlng(myLatLng?.latitude ?? 0, myLatLng?.longitude ?? 0) +// : latLng); +// BMFPlanNode to = BMFPlanNode( +// // cityName: positionSorta == false ? (storeInfo?.city ?? "") : myCity, +// // name: positionSorta == false ? (storeInfo?.address ?? "") : myAddress, +// pt: positionSorta == false +// ? latLng +// : Latlng(myLatLng?.latitude ?? 0, myLatLng?.longitude ?? 0)); +// if (navigationType == 1) { +// //步行 +// BMFWalkingRoutePlanOption walkingRoutePlanOption = +// BMFWalkingRoutePlanOption(from: from, to: to); +// // 检索实例 +// BMFWalkingRouteSearch walkingRouteSearch = BMFWalkingRouteSearch(); +// // 检索回调 +// walkingRouteSearch.onGetWalkingRouteSearchResult(callback: +// (BMFWalkingRouteResult result, BMFSearchErrorCode errorCode) async { +// if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { +// SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { +// SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } +// print( +// '`步行检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); +// +// /// 坐标点 +// List coordinates = []; +// result.routes.first.steps.forEach((e1) { +// e1.points.forEach((e2) { +// coordinates.add(Latlng(e2.latitude, e2.longitude)); +// }); +// }); +// updateMapLine( +// coordinates, +// result.routes.first.duration.hours, +// result.routes.first.duration.minutes, +// result.routes.first.distance.toDouble()); +// }); +// bool flag = +// await walkingRouteSearch.walkingRouteSearch(walkingRoutePlanOption); +// } else if (navigationType == 2) { +// //骑行 +// BMFRidingRoutePlanOption ridingRoutePlanOption = +// BMFRidingRoutePlanOption(from: from, to: to); +// BMFRidingRouteSearch ridingRouteSearch = BMFRidingRouteSearch(); +// ridingRouteSearch.onGetRidingRouteSearchResult(callback: +// (BMFRidingRouteResult result, BMFSearchErrorCode errorCode) { +// if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { +// SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { +// SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } +// print( +// '`骑行检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); +// +// /// 坐标点 +// List coordinates = []; +// result.routes.first.steps.forEach((e1) { +// e1.points.forEach((e2) { +// coordinates.add(Latlng(e2.latitude, e2.longitude)); +// }); +// }); +// updateMapLine( +// coordinates, +// result.routes.first.duration.hours, +// result.routes.first.duration.minutes, +// result.routes.first.distance.toDouble()); +// }); +// // 发起检索 +// bool flag = +// await ridingRouteSearch.ridingRouteSearch(ridingRoutePlanOption); +// } else if (navigationType == 3) { +// //公交 +// BMFTransitRoutePlanOption transitRoutePlanOption = +// BMFTransitRoutePlanOption(from: from, to: to, city: '武汉市'); +// BMFTransitRouteSearch transitRouteSearch = BMFTransitRouteSearch(); +// transitRouteSearch.onGetTransitRouteSearchResult(callback: +// (BMFTransitRouteResult result, BMFSearchErrorCode errorCode) { +// if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { +// SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { +// SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } +// print( +// '`市内公交检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); +// +// /// 坐标点 +// List coordinates = []; +// result.routes.first.steps.forEach((e1) { +// e1.points.forEach((e2) { +// coordinates.add(Latlng(e2.latitude, e2.longitude)); +// }); +// }); +// updateMapLine( +// coordinates, +// result.routes.first.duration.hours, +// result.routes.first.duration.minutes, +// result.routes.first.distance.toDouble()); +// }); +// // 发起检索 +// bool flag = +// await transitRouteSearch.transitRouteSearch(transitRoutePlanOption); +// } else { +// //驾车 +// BMFDrivingRoutePlanOption drivingRoutePlanOption = +// BMFDrivingRoutePlanOption(from: from, to: to); +// BMFDrivingRouteSearch drivingRouteSearch = BMFDrivingRouteSearch(); +// drivingRouteSearch.onGetDrivingRouteSearchResult(callback: +// (BMFDrivingRouteResult result, BMFSearchErrorCode errorCode) { +// if (errorCode == BMFSearchErrorCode.RESULT_NOT_FOUND) { +// SmartDialog.showToast("该方案暂无可用的规划路线", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } else if (errorCode != BMFSearchErrorCode.NO_ERROR) { +// SmartDialog.showToast("获取路线规划失败,请稍后再试", alignment: Alignment.center); +// EasyLoading.dismiss(); +// return; +// } +// print( +// '驾车检索回调 errorCode = ${errorCode} \n result = ${result?.toMap()}'); +// +// /// 坐标点 +// List coordinates = []; +// result.routes.first.steps.forEach((e1) { +// e1.points.forEach((e2) { +// coordinates.add(Latlng(e2.latitude, e2.longitude)); +// }); +// }); +// updateMapLine( +// coordinates, +// result.routes.first.duration.hours, +// result.routes.first.duration.minutes, +// result.routes.first.distance.toDouble()); +// }); +// // 发起检索 +// bool flag = +// await drivingRouteSearch.dringRouteSearch(drivingRoutePlanOption); +// } +// } +// +// Widget navigationBox() { +// return Container( +// height: 132.h, +// margin: EdgeInsets.only( +// top: MediaQuery.of(context).padding.top + 16.h, +// left: 14.w, +// right: 14.w), +// padding: EdgeInsets.only(left: 12.w, right: 18.w, top: 8.h), +// decoration: BoxDecoration( +// color: Colors.white, +// boxShadow: [ +// BoxShadow( +// color: Color(0x08213303), +// offset: Offset(0, 2), +// blurRadius: 4, +// spreadRadius: 0, +// ), +// ], +// borderRadius: BorderRadius.circular(6), +// ), +// child: Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// setState(() { +// navigationState = 0; +// }); +// }, +// child: Padding( +// padding: EdgeInsets.only(top: 10.h, right: 10.w), +// child: Icon( +// Icons.arrow_back_ios, +// color: Color(0xFF353535), +// size: 24, +// ), +// ), +// ), +// Expanded( +// child: Column( +// children: [ +// Container( +// width: double.infinity, +// decoration: BoxDecoration( +// color: Color(0xFFF5F5F5), +// borderRadius: BorderRadius.circular(6), +// ), +// padding: EdgeInsets.only( +// top: 12.h, +// bottom: 12.h, +// left: 15.w, +// ), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Expanded( +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Padding( +// padding: EdgeInsets.only( +// bottom: 14.h, +// ), +// child: Row( +// children: [ +// Container( +// width: 4.h, +// height: 4.h, +// margin: EdgeInsets.only(right: 20.w), +// decoration: BoxDecoration( +// color: Color(0xFF32A060), +// borderRadius: BorderRadius.circular(6), +// ), +// ), +// Expanded( +// child: Text( +// positionSorta == false +// ? "我的位置" +// : (storeInfo?.storeName ?? ""), +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: Color(0xFF0D0D0D), +// fontSize: 14.sp, +// fontWeight: MyFontWeight.semi_bold, +// ), +// )) +// ], +// ), +// ), +// Row( +// children: [ +// Container( +// width: 4.h, +// height: 4.h, +// margin: EdgeInsets.only(right: 20.w), +// decoration: BoxDecoration( +// color: Color(0xFFFA5151), +// borderRadius: BorderRadius.circular(6), +// ), +// ), +// Expanded( +// child: Text( +// positionSorta == false +// ? (storeInfo?.storeName ?? "") +// : "我的位置", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: Color(0xFF0D0D0D), +// fontSize: 14.sp, +// fontWeight: MyFontWeight.semi_bold, +// ), +// )) +// ], +// ) +// ], +// )), +// GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// positionSorta = !positionSorta; +// navigationPosition(); +// }, +// child: Container( +// padding: EdgeInsets.only(right: 24.w), +// child: Image.asset( +// "assets/image/position_sort.webp", +// fit: BoxFit.fill, +// height: 16.h, +// width: 14.w, +// ), +// ), +// ) +// ], +// ), +// ), +// SizedBox( +// height: 12.h, +// ), +// Row( +// children: [ +// Expanded( +// child: GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// navigationType = 4; +// navigationPosition(); +// }, +// child: Container( +// decoration: BoxDecoration( +// color: navigationType == 4 +// ? Color(0xFFE8FFF2) +// : Colors.transparent, +// borderRadius: BorderRadius.circular(23), +// ), +// padding: +// EdgeInsets.symmetric(vertical: 5.h, horizontal: 13.w), +// child: Row( +// children: [ +// if (navigationType == 4) +// Image.asset( +// "assets/image/icon_drive.webp", +// fit: BoxFit.fill, +// height: 16.h, +// width: 14.w, +// ), +// Padding( +// padding: EdgeInsets.only(left: 2.w), +// child: Text( +// "驾车", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: navigationType == 4 +// ? Color(0xFF32A060) +// : Colors.black, +// fontSize: 12.sp, +// fontWeight: MyFontWeight.medium, +// ), +// ), +// ) +// ], +// ), +// ), +// )), +// Expanded( +// child: GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// navigationType = 3; +// navigationPosition(); +// }, +// child: Container( +// decoration: BoxDecoration( +// color: navigationType == 3 +// ? Color(0xFFE8FFF2) +// : Colors.transparent, +// borderRadius: BorderRadius.circular(23), +// ), +// padding: EdgeInsets.symmetric( +// vertical: 5.h, horizontal: 13.w), +// child: Row( +// children: [ +// if (navigationType == 3) +// Image.asset( +// "assets/image/icon_transit.webp", +// fit: BoxFit.fill, +// height: 16.h, +// width: 14.w, +// ), +// Padding( +// padding: EdgeInsets.only(left: 2.w), +// child: Text( +// "公交", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: navigationType == 3 +// ? Color(0xFF32A060) +// : Colors.black, +// fontSize: 12.sp, +// fontWeight: MyFontWeight.medium, +// ), +// ), +// ) +// ], +// ), +// ))), +// Expanded( +// child: GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// navigationType = 2; +// navigationPosition(); +// }, +// child: Container( +// decoration: BoxDecoration( +// color: navigationType == 2 +// ? Color(0xFFE8FFF2) +// : Colors.transparent, +// borderRadius: BorderRadius.circular(23), +// ), +// padding: EdgeInsets.symmetric( +// vertical: 5.h, horizontal: 13.w), +// child: Row( +// children: [ +// if (navigationType == 2) +// Image.asset( +// "assets/image/icon_by_bike.webp", +// fit: BoxFit.fill, +// height: 16.h, +// width: 14.w, +// ), +// Padding( +// padding: EdgeInsets.only(left: 2.w), +// child: Text( +// "骑行", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: navigationType == 2 +// ? Color(0xFF32A060) +// : Colors.black, +// fontSize: 12.sp, +// fontWeight: MyFontWeight.medium, +// ), +// ), +// ) +// ], +// ), +// ))), +// Expanded( +// child: GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// navigationType = 1; +// navigationPosition(); +// }, +// child: Container( +// decoration: BoxDecoration( +// color: navigationType == 1 +// ? Color(0xFFE8FFF2) +// : Colors.transparent, +// borderRadius: BorderRadius.circular(23), +// ), +// padding: EdgeInsets.symmetric( +// vertical: 5.h, horizontal: 13.w), +// child: Row( +// children: [ +// if (navigationType == 1) +// Image.asset( +// "assets/image/icon_walk.webp", +// fit: BoxFit.fill, +// height: 16.h, +// width: 14.w, +// ), +// Padding( +// padding: EdgeInsets.only(left: 2.w), +// child: Text( +// "步行", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// color: navigationType == 1 +// ? Color(0xFF32A060) +// : Colors.black, +// fontSize: 12.sp, +// fontWeight: MyFontWeight.medium, +// ), +// ), +// ) +// ], +// ), +// ))), +// ], +// ) +// ], +// )) +// ], +// ), +// ); +// } +// +// Widget navigationDistance() { +// return Container( +// height: 173.h, +// padding: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), +// decoration: BoxDecoration( +// color: Colors.white, +// boxShadow: [ +// BoxShadow( +// color: Color(0x08213303), +// offset: Offset(0, 2), +// blurRadius: 4, +// spreadRadius: 0, +// ), +// ], +// borderRadius: BorderRadius.vertical( +// top: Radius.circular(8), +// ), +// ), +// child: Column( +// // mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Expanded( +// child: Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// "${navigationType == 1 ? "步行" : navigationType == 2 ? "骑行" : navigationType == 3 ? "公交" : "驾车"}${(hours ?? "") + (minutes ?? "")}", +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// fontSize: 20.sp, +// color: Color(0xFF0D0D0D), +// fontWeight: MyFontWeight.bold, +// ), +// ), +// Padding( +// padding: EdgeInsets.only(left: 40.w), +// child: Text( +// (distance ?? 0) > 1000 +// ? S.of(context).gongli( +// ((distance ?? 0) / 1000 * 100).toInt() / 100.0) +// : S +// .of(context) +// .mi(((distance ?? 0) * 100).toInt() / 100.0), +// overflow: TextOverflow.ellipsis, +// style: TextStyle( +// fontSize: 20.sp, +// color: Color(0xFF0D0D0D), +// fontWeight: MyFontWeight.bold, +// ), +// ), +// ), +// ], +// ), +// ), +// GestureDetector( +// behavior: HitTestBehavior.opaque, +// onTap: () { +// setState(() { +// navigationState = 1; +// showMapSelect(); +// }); +// }, +// child: Container( +// alignment: Alignment.center, +// width: double.infinity, +// padding: EdgeInsets.symmetric(vertical: 10.h), +// margin: EdgeInsets.only(bottom: 30.h), +// decoration: BoxDecoration( +// color: Color(0xFF32A060), +// borderRadius: BorderRadius.circular(23), +// ), +// child: Text( +// navigationType == 1 +// ? "步行导航" +// : navigationType == 2 +// ? "骑行导航" +// : navigationType == 3 +// ? "公交导航" +// : "驾车导航", +// style: TextStyle( +// fontSize: 20.sp, +// color: Colors.white, +// fontWeight: MyFontWeight.medium, +// ), +// ), +// ), +// ) +// ], +// ), +// ); +// } +// +// showMapSelect() { +// showCupertinoModalPopup( +// context: context, +// builder: (context) { +// return CupertinoActionSheet( +// actions: [ +// CupertinoActionSheetAction( +// child: Text( +// "百度地图", +// style: TextStyle( +// fontWeight: MyFontWeight.regular, +// ), +// ), +// onPressed: () { +// onOpenBaiduMapRoute(); +// Navigator.of(context).pop(); +// }, +// isDefaultAction: true, +// isDestructiveAction: false, +// ), +// ], +// cancelButton: CupertinoActionSheetAction( +// onPressed: () { +// Navigator.of(context).pop(); +// }, +// child: Text(S.of(context).quxiao, +// style: TextStyle( +// color: Colors.blue, +// ),), +// isDestructiveAction: true, +// ), +// ); +// }); +// } +// +// List itemServer(String businessService) { +// if (businessService == null || businessService == "") return []; +// var list = businessService.split(","); +// return list +// .map((e) => Container( +// margin: EdgeInsets.only(right: 8.w), +// child: RoundButton( +// height: 17.h * AppUtils.textScale(context), +// text: "$e", +// backgroup: Color(0xFFFF7A1A), +// padding: EdgeInsets.only( +// left: 2.w, +// right: 2.w, +// ), +// fontSize: 10.sp, +// textColor: Colors.white, +// ), +// )) +// .toList(); +// } +// +// BMFMapController _mapController; +// Latlng latLng; +// Latlng myLatLng; +// BMFMarker bmfMarker; +// +// onMapCreated(BMFMapController controller) { +// _mapController = controller; +// setState(() { +// _mapController.showUserLocation(true); +// _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); +// BMFUserLocationDisplayParam displayParam = BMFUserLocationDisplayParam( +// locationViewOffsetX: 0, +// locationViewOffsetY: 0, +// accuracyCircleFillColor: Colors.red, +// accuracyCircleStrokeColor: Colors.blue, +// isAccuracyCircleShow: true, +// locationViewImage: 'assets/image/icon_my_location.webp', +// locationViewHierarchy: +// BMFLocationViewHierarchy.LOCATION_VIEW_HIERARCHY_BOTTOM, +// ); +// _mapController.updateLocationViewWithParam(displayParam); +// addMarker(); +// }); +// } +// +// addMarker() async { +// latLng = await AppUtils.coordConvert(Latlng(double.tryParse(widget.arguments["lat"]), +// double.tryParse(widget.arguments["lng"]))); +// // latLng = Latlng(double.tryParse(widget.arguments["lat"]), +// // double.tryParse(widget.arguments["lng"])); +// +// if (bmfMarker == null && _mapController != null) { +// bmfMarker = BMFMarker.icon( +// position: latLng, +// centerOffset: BMFPoint(0.5, 0.7), +// enabled: false, +// icon: "assets/image/icon_map_marker.webp", +// draggable: false, +// ); +// _mapController.addMarker(bmfMarker); +// } +// _mapController.setCenterCoordinate(latLng, true); +// } +// } diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index 2080ac73..06987789 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -1,10 +1,11 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/latlng.dart'; import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; @@ -23,7 +24,7 @@ import '../view_widget/round_button.dart'; class UnionList extends StatefulWidget { final String serviceType; - final BMFCoordinate latLng; + final Position latLng; final String searchKey; final String city; @@ -39,7 +40,7 @@ class UnionList extends StatefulWidget { class _UnionList extends State with AutomaticKeepAliveClientMixin { ApiService apiService; List storeList; - BMFCoordinate latLng; + Position latLng; final RefreshController _refreshController = RefreshController(); int networkStatus = 0; diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index c8158739..3772695a 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -4,11 +4,12 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; + +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; +import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/ip_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/union/union_list.dart'; @@ -19,7 +20,6 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:visibility_detector/visibility_detector.dart'; import '../view_widget/location_tips.dart'; @@ -44,7 +44,7 @@ class UnionPageState extends State final TextEditingController editingController = TextEditingController(); bool isKeyBoardShow = false; TabController tabController; - BMFCoordinate latLng; + Position latLng; String areaName; List _allKey = []; bool _isShowLocalTips = false; @@ -58,9 +58,9 @@ class UnionPageState extends State void dispose() { super.dispose(); WidgetsBinding.instance.removeObserver(this); - if (Location.getInstance() != null && - Location.getInstance().aMapFlutterLocation != null) - Location.getInstance().aMapFlutterLocation.stopLocation(); + // if (LocationInstance.getInstance() != null && + // LocationInstance.getInstance().location != null) + // LocationInstance.getInstance().location.stopLocation(); } @override @@ -117,30 +117,27 @@ class UnionPageState extends State getLocation({bool showLoading = true}) async { if(showLoading) EasyLoading.show( - status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black, + ); bool powerFlag = false; // bool finallyFlag = false; try { - Future.delayed(Duration(seconds: 5), () { - // if (!finallyFlag) - Location.getInstance().stopLocation(); - }); - powerFlag = await Location.getInstance().startLocation(context, - (BaiduLocation result) async { + powerFlag = await LocationInstance.getInstance().startLocation(context, + (Position result) async { if (result != null && result.latitude != null && result.longitude != null) { print("location: $result"); - latLng = BMFCoordinate(result.latitude, result.longitude); - latLng = await BMFCalculateUtils.coordConvert( - coordinate: latLng, - fromType: BMF_COORD_TYPE.BD09LL, - toType: BMF_COORD_TYPE.COMMON); - await saveLatLng( - latLng, result.province, result.city, result.district); - print("union: Location result ${latLng.latitude} " - "${latLng.longitude}"); - Location.getInstance().stopLocation(); + latLng = Position( + latitude: result.latitude, + longitude: result.longitude, + ); + Address address = await LocationInstance.getInstance().getAddress(result.latitude, result.longitude); + if (address != null) { + await saveLatLng(latLng, address.province, address.city, address.area); + } + LocationInstance.getInstance().stopLocation(); } else { await getLatLng(); } @@ -159,7 +156,7 @@ class UnionPageState extends State } } - saveLatLng(BMFCoordinate latLng, province, city, district) async { + saveLatLng(Position latLng, province, city, district) async { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("longitude", "${latLng.longitude}"); @@ -175,14 +172,18 @@ class UnionPageState extends State tempLatLng.containsKey("province") && tempLatLng.containsKey("city") && tempLatLng.containsKey("district")) { - latLng = BMFCoordinate(double.tryParse(tempLatLng.getString("latitude")), - double.tryParse(tempLatLng.getString("longitude"))); + latLng = Position( + latitude: double.tryParse(tempLatLng.getString("latitude")), + longitude: double.tryParse(tempLatLng.getString("longitude")), + ); } } queryIpInfo() async { EasyLoading.show( - status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black, + ); try { ApiService apiIpService = ApiService(Dio(), context: context, isIp: true); IpData baseData = await apiIpService.getIpInfo().catchError((onError) {}); @@ -197,8 +198,9 @@ class UnionPageState extends State loadFinish({bool showLoading = true}) { if (showLoading) EasyLoading.show( - status: S.current.zhengzaijiazai, - maskType: EasyLoadingMaskType.black); + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black, + ); _allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()]; setState(() {}); } diff --git a/lib/union/union_view/store_info.dart b/lib/union/union_view/store_info.dart index 6035babe..8a90ecf7 100644 --- a/lib/union/union_view/store_info.dart +++ b/lib/union/union_view/store_info.dart @@ -1,10 +1,14 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/location.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/round_button.dart'; @@ -108,10 +112,10 @@ class _StoreInfos extends State { S.of(context).yingyeshijian(widget.storeInfo == null ? "" : (widget.storeInfo.openStartTime == null && - widget.storeInfo.openEndTime == null) - ? S.of(context).quantian - : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " - "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), + widget.storeInfo.openEndTime == null) + ? S.of(context).quantian + : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " + "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), style: TextStyle( color: Color(0xFF353535), fontWeight: MyFontWeight.regular, @@ -144,12 +148,7 @@ class _StoreInfos extends State { widget.storeInfo.longitude == null || widget.storeInfo.latitude == "" || widget.storeInfo.longitude == "") return; - Navigator.of(context) - .pushNamed('/router/location_map', arguments: { - "lat": widget.storeInfo.latitude, - "lng": widget.storeInfo.longitude, - "storeName": widget.storeInfo.storeName, - }); + showMapSelect(); }, child: Image.asset( "assets/image/icon_union_location.webp", @@ -177,175 +176,6 @@ class _StoreInfos extends State { ], ), ); - // return AspectRatio( - // aspectRatio: 1, - // child: Container( - // margin: EdgeInsets.fromLTRB(16, 20, 16, 8), - // padding: EdgeInsets.fromLTRB(10, 20, 10, 14), - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: BorderRadius.circular(8), - // boxShadow: [ - // BoxShadow( - // color: Colors.black.withAlpha(25), - // offset: Offset(0, 1), - // blurRadius: 12, - // spreadRadius: 0, - // ), - // ], - // ), - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // AspectRatio( - // aspectRatio: 1.8, - // child: buildSwiper(), - // ), - // Expanded( - // child: Container( - // margin: EdgeInsets.only( - // left: 10.w, - // right: 10.w, - // top: 16.h, - // ), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Expanded( - // child: Container( - // alignment: - // Alignment.centerLeft, - // child: Text( - // widget.storeInfo != null - // ? widget.storeInfo.storeName - // : "", - // overflow: TextOverflow.ellipsis, - // style: TextStyle( - // fontSize: 16.sp, - // color: Colors.black, - // fontWeight: MyFontWeight.medium, - // ), - // ), - // ), - // ), - // Text( - // S.of(context).ren( - // widget.storeInfo != null - // ? widget.storeInfo - // .perCapitaConsumption - // : "", - // ), - // overflow: TextOverflow.ellipsis, - // style: TextStyle( - // fontSize: 14.sp, - // fontWeight: MyFontWeight.regular, - // color: Color(0xFF353535), - // ), - // ), - // ], - // ), - // Text( - // widget.storeInfo != null - // ? widget.storeInfo.address - // : "", - // maxLines: 2, - // textAlign: TextAlign.justify, - // style: TextStyle( - // color: Color(0xFF353535), - // fontWeight: MyFontWeight.regular, - // fontSize: 12.sp, - // ), - // ), - // Row( - // children: itemServer( - // widget.storeInfo != null - // ? widget.storeInfo.businessService - // : "", - // ), - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.end, - // children: [ - // Expanded( - // child: Text( - // S.of(context).yingyeshijian(widget.storeInfo == - // null - // ? "" - // : (widget.storeInfo.openStartTime == - // null && - // widget.storeInfo - // .openEndTime == - // null) - // ? S.of(context).quantian - // : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " - // "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), - // style: TextStyle( - // color: Color(0xFF353535), - // fontWeight: MyFontWeight.regular, - // fontSize: 12.sp, - // ), - // ), - // ), - // SizedBox( - // width: 16.w, - // ), - // InkWell( - // onTap: () { - // if (widget.storeInfo == null || - // widget.storeInfo.latitude == - // null || - // widget.storeInfo.longitude == - // null || - // widget.storeInfo.latitude == "" || - // widget.storeInfo.longitude == "") - // return; - // Navigator.of(context).pushNamed( - // '/router/location_map', - // arguments: { - // "lat": widget.storeInfo.latitude, - // "lng": - // widget.storeInfo.longitude, - // "storeName": - // widget.storeInfo.storeName, - // }); - // }, - // child: Image.asset( - // "assets/image/icon_union_location.webp", - // width: 24.w, - // height: 24.h, - // ), - // ), - // SizedBox( - // width: 16.w, - // ), - // InkWell( - // onTap: () { - // showCallMobile(); - // }, - // child: Image.asset( - // "assets/image/icon_union_call.webp", - // width: 24, - // height: 24, - // ), - // ), - // ], - // ), - // ], - // ), - // ), - // flex: 1, - // ), - // ], - // ), - // ), - // ); } Widget buildSwiper() { @@ -444,4 +274,55 @@ class _StoreInfos extends State { throw 'Could not launch $url'; } } + + showMapSelect() { + showCupertinoModalPopup( + context: context, + builder: (context) { + return CupertinoActionSheet( + actions: [ + CupertinoActionSheetAction( + child: Text( + "使用高德地图导航", + style: TextStyle( + fontWeight: MyFontWeight.regular, + ), + ), + onPressed: () { + onOpenBaiduMap(); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + ], + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).quxiao, + style: TextStyle( + color: Colors.blue, + ),), + isDestructiveAction: true, + ), + ); + }); + } + + void onOpenBaiduMap() async { + LocationInstance.getInstance().startLocation(context, (locationData) { + String url = "${Platform.isIOS ? 'ios' : 'android'}amap://path?sourceApplication=haixia&sid=" + "&slat=${locationData.latitude.toStringAsFixed(8)}&slon=${locationData.longitude.toStringAsFixed(8)}&sname=&did=&dlat=${widget.storeInfo.latitude}&dlon=${widget.storeInfo.longitude}&dname=&dev=0&t=0"; + launch(url).then((value) { + if (!value) { + SmartDialog.showToast( + "未检测到安装高德地图", + alignment: Alignment.center, + ); + } + }); + }); + } + } diff --git a/lib/utils/flutter_utils.dart b/lib/utils/flutter_utils.dart index f9257c79..aee94742 100644 --- a/lib/utils/flutter_utils.dart +++ b/lib/utils/flutter_utils.dart @@ -3,20 +3,10 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; -import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:intl/intl.dart'; import 'package:path_provider/path_provider.dart'; class AppUtils { - ///计算距离(当前位置到店位置直线距离) - static Future calculateDistance( - BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng, {bool isMi = false}) async { - double mi = - await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng); - NumberFormat numberFormat = NumberFormat("#.#"); - return "${numberFormat.format(mi / (isMi ? 1 :1000))}"; - } ///保留两位小数 @@ -78,13 +68,6 @@ class AppUtils { return resString; } - ///坐标系转换(高德转百度) - static Future coordConvert(BMFCoordinate latLng) async { - return BMFCalculateUtils.coordConvert( - coordinate: latLng, - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); - } static bool isPhone(mobile) { RegExp exp = RegExp( diff --git a/lib/utils/gps_utils.dart b/lib/utils/gps_utils.dart new file mode 100644 index 00000000..a379517a --- /dev/null +++ b/lib/utils/gps_utils.dart @@ -0,0 +1,141 @@ + +import 'dart:math'; + +class GpsUtil { + static const num pi = 3.1415926535897932384626; + static const num x_pi = 3.14159265358979324 * 3000.0 / 180.0; + static const num a = 6378245.0; + static const num ee = 0.00669342162296594323; + + static num transformLat(num x, num y) { + num ret = -100.0 + + 2.0 * x + + 3.0 * y + + 0.2 * y * y + + 0.1 * x * y + + 0.2 * sqrt(x.abs()); + ret += (20.0 * sin(6.0 * x * pi) + 20.0 * sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * sin(y * pi) + 40.0 * sin(y / 3.0 * pi)) * 2.0 / 3.0; + ret += (160.0 * sin(y / 12.0 * pi) + 320 * sin(y * pi / 30.0)) * 2.0 / 3.0; + return ret; + } + + static num transformLon(num x, num y) { + num ret = + 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(x.abs()); + ret += (20.0 * sin(6.0 * x * pi) + 20.0 * sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * sin(x * pi) + 40.0 * sin(x / 3.0 * pi)) * 2.0 / 3.0; + ret += + (150.0 * sin(x / 12.0 * pi) + 300.0 * sin(x / 30.0 * pi)) * 2.0 / 3.0; + return ret; + } + + static List transform(num lat, num lon) { + if (outOfChina(lat, lon)) { + return [lat, lon]; + } + num dLat = transformLat(lon - 105.0, lat - 35.0); + num dLon = transformLon(lon - 105.0, lat - 35.0); + num radLat = lat / 180.0 * pi; + num magic = sin(radLat); + magic = 1 - ee * magic * magic; + num sqrtMagic = sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * cos(radLat) * pi); + num mgLat = lat + dLat; + num mgLon = lon + dLon; + return [mgLat, mgLon]; + } + + static bool outOfChina(num lat, num lon) { + if (lon < 72.004 || lon > 137.8347) return true; + if (lat < 0.8293 || lat > 55.8271) return true; + return false; + } + + /// 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System + /// + /// @param lat + /// @param lon + /// @return + static List gps84_To_Gcj02(num lat, num lon) { + if (outOfChina(lat, lon)) { + return [lat, lon]; + } + num dLat = transformLat(lon - 105.0, lat - 35.0); + num dLon = transformLon(lon - 105.0, lat - 35.0); + num radLat = lat / 180.0 * pi; + num magic = sin(radLat); + magic = 1 - ee * magic * magic; + num sqrtMagic = sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * cos(radLat) * pi); + num mgLat = lat + dLat; + num mgLon = lon + dLon; + return [mgLat, mgLon]; + } + + /// * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return + static List gcj02_To_Gps84(num lat, num lon) { + List gps = transform(lat, lon); + num lontitude = lon * 2 - gps[1]; + num latitude = lat * 2 - gps[0]; + return [latitude, lontitude]; + } + + /// 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 + /// + /// @param lat + /// @param lon + static List gcj02_To_Bd09(num lat, num lon) { + num x = lon, y = lat; + num z = sqrt(x * x + y * y) + 0.00002 * sin(y * x_pi); + num theta = atan2(y, x) + 0.000003 * cos(x * x_pi); + num tempLon = z * cos(theta) + 0.0065; + num tempLat = z * sin(theta) + 0.006; + List gps = [tempLat, tempLon]; + return gps; + } + + /// * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * 将 BD-09 坐标转换成GCJ-02 坐标 + /// @param lat + /// @param lon + /// @return + static List bd09_To_Gcj02(num lat, num lon) { + num x = lon - 0.0065, y = lat - 0.006; + num z = sqrt(x * x + y * y) - 0.00002 * sin(y * x_pi); + num theta = atan2(y, x) - 0.000003 * cos(x * x_pi); + num tempLon = z * cos(theta); + num tempLat = z * sin(theta); + List gps = [tempLat, tempLon]; + return gps; + } + + /// 将gps84转为bd09 + /// + /// @param lat + /// @param lon + /// @return + static List gps84_To_bd09(num lat, num lon) { + List gcj02 = gps84_To_Gcj02(lat, lon); + List bd09 = gcj02_To_Bd09(gcj02[0], gcj02[1]); + return bd09; + } + + static List bd09_To_gps84(num lat, num lon) { + List gcj02 = bd09_To_Gcj02(lat, lon); + List gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]); + //保留小数点后六位 + gps84[0] = retain6(gps84[0]); + gps84[1] = retain6(gps84[1]); + return gps84; + } + + /// 保留小数点后六位 + /// + /// @param num + /// @return + static num retain6(num n) { + return num.parse(n.toStringAsFixed(6)); + } +} \ No newline at end of file diff --git a/lib/utils/location.dart b/lib/utils/location.dart index 2b1f1482..feda0fec 100644 --- a/lib/utils/location.dart +++ b/lib/utils/location.dart @@ -1,112 +1,60 @@ -import 'dart:io'; - -import 'package:android_intent_plus/android_intent.dart'; +import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bmflocation/flutter_bmflocation.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/address.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:intl/intl.dart'; +import 'package:permission_handler/permission_handler.dart' as PH; import 'font_weight.dart'; -BaiduLocationAndroidOption initAndroidOptions() { - BaiduLocationAndroidOption options = BaiduLocationAndroidOption( - // 定位模式,可选的模式有高精度、仅设备、仅网络。默认为高精度模式 - locationMode: BMFLocationMode.hightAccuracy, - // 是否需要返回地址信息 - isNeedAddress: true, -// 是否需要返回海拔高度信息 - isNeedAltitude: false, -// 是否需要返回周边poi信息 - isNeedLocationPoiList: false, -// 是否需要返回新版本rgc信息 - isNeedNewVersionRgc: false, -// 是否需要返回位置描述信息 - isNeedLocationDescribe: true, -// 是否使用gps - openGps: true, -// 可选,设置场景定位参数,包括签到场景、运动场景、出行场景 - locationPurpose: BMFLocationPurpose.signIn, -// 坐标系 - coordType: BMFLocationCoordType.bd09ll, -// 设置发起定位请求的间隔,int类型,单位ms -// 如果设置为0,则代表单次定位,即仅定位一次,默认为0 - scanspan: 0); - return options; -} - -BaiduLocationIOSOption initIOSOptions() { - BaiduLocationIOSOption options = BaiduLocationIOSOption( - // 坐标系 - coordType: BMFLocationCoordType.bd09ll, - // 位置获取超时时间 - locationTimeout: 10, - // 获取地址信息超时时间 - reGeocodeTimeout: 10, - // 应用位置类型 默认为automotiveNavigation - activityType: BMFActivityType.automotiveNavigation, - // 设置预期精度参数 默认为best - desiredAccuracy: BMFDesiredAccuracy.best, - // 是否需要最新版本rgc数据 - isNeedNewVersionRgc: false, - // 指定定位是否会被系统自动暂停 - pausesLocationUpdatesAutomatically: false, - // 指定是否允许后台定位, - // 允许的话是可以进行后台定位的,但需要项目配置允许后台定位,否则会报错,具体参考开发文档 - allowsBackgroundLocationUpdates: false, - // 设定定位的最小更新距离 - distanceFilter: 10, - ); - return options; -} - -class Location { - static Location _instance; +class LocationInstance { + static LocationInstance _instance; - Location._internal() { - aMapFlutterLocation = LocationFlutterPlugin(); - } + LocationInstance._internal() {} - static Location getInstance() { + static LocationInstance getInstance() { if (_instance == null) { - _instance = Location._internal(); + _instance = LocationInstance._internal(); } return _instance; } - LocationFlutterPlugin aMapFlutterLocation; - Future startLocation( - context, Function(BaiduLocation result) locationCallback) async { - aMapFlutterLocation.prepareLoc( - initAndroidOptions().getMap(), initIOSOptions().getMap()); - var permissionStatus = await Permission.location.status; - if (!permissionStatus.isGranted) { - if (permissionStatus.isUndetermined) - showTipsAlertDialog(context); + context, Function(Position locationData) locationCallback) async { + LocationPermission permissionStatus = await Geolocator.checkPermission(); + if (permissionStatus == LocationPermission.denied) { + permissionStatus = await Geolocator.requestPermission(); + } + if (permissionStatus == LocationPermission.denied) { + showTipsAlertDialog(context); + return false; + } + if (permissionStatus == LocationPermission.deniedForever) { + showTipsAlertDialog(context); return false; - } else { - aMapFlutterLocation.singleLocationCallback( - callback: (BaiduLocation result) { - locationCallback.call(result); + } + if (permissionStatus == LocationPermission.whileInUse || + permissionStatus == LocationPermission.always) { + bool isNext = true; + Future.delayed(Duration(seconds: 5), () { + if (isNext) { + EasyLoading.dismiss(); + } }); - if (Platform.isIOS) { - await aMapFlutterLocation.singleLocation({ - 'isReGeocode': true, - 'isNetworkState': true, - }); - } else if (Platform.isAndroid) { - await aMapFlutterLocation.startLocation(); - } - return true; + Position locationData = await Geolocator.getCurrentPosition(); + isNext = false; + locationCallback.call(locationData); } + return true; } - void stopLocation() { - if (aMapFlutterLocation != null) aMapFlutterLocation.stopLocation(); - } + void stopLocation() {} enableLocation(context) { showCupertinoDialog( @@ -119,10 +67,12 @@ class Location { S.of(context).dakaidingwei, (result) async { if (result) { - final AndroidIntent intent = AndroidIntent( - action: 'action_location_source_settings', - package: "com.zsw.huixiang"); - await intent.launch(); + // final AndroidIntent intent = AndroidIntent( + // action: 'action_location_source_settings', + // package: "com.zsw.huixiang", + // ); + // await intent.launch(); + Geolocator.openLocationSettings(); // startLocation(); } }, @@ -132,7 +82,7 @@ class Location { ); } - requestDialog(context, Function(BaiduLocation result) locationCallback) { + requestDialog(context, Function(Position result) locationCallback) { showCupertinoDialog( context: context, builder: (context) { @@ -143,8 +93,11 @@ class Location { S.of(context).kaiqiquanxian, (result) async { if (result) { - await openAppSettings(); - if (await Permission.location.isGranted) { + await PH.openAppSettings(); + if ((await Geolocator.checkPermission()) == + LocationPermission.whileInUse || + (await Geolocator.checkPermission()) == + LocationPermission.always) { startLocation(context, locationCallback); } } @@ -218,7 +171,7 @@ class Location { ); }, ); - await Permission.location.request(); + Geolocator.requestPermission(); Navigator.of(context).pop(); } @@ -292,8 +245,11 @@ class Location { ), ), onTap: () async { - await openAppSettings(); - if (await Permission.location.isGranted) + await PH.openAppSettings(); + if ((await Geolocator.checkPermission()) == + LocationPermission.whileInUse || + (await Geolocator.checkPermission()) == + LocationPermission.always) Navigator.of(context).pop(); }, behavior: HitTestBehavior.opaque, @@ -325,4 +281,45 @@ class Location { }, ); } + + ///计算距离(当前位置到店位置直线距离) + static Future calculateDistance( + Position bmfCoordinate, Position myLatLng, + {bool isMi = false}) async { + double mi = Geolocator.distanceBetween( + bmfCoordinate.latitude, + bmfCoordinate.longitude, + myLatLng.latitude, + myLatLng.longitude, + ); + NumberFormat numberFormat = NumberFormat("#.#"); + return "${numberFormat.format(mi / (isMi ? 1 : 1000))}"; + } + + // ///坐标系转换(高德转百度) + // static Future coordConvert(Latlng latLng) async { + // return BMFCalculateUtils.coordConvert( + // coordinate: latLng, + // fromType: BMF_COORD_TYPE.COMMON, + // toType: BMF_COORD_TYPE.BD09LL); + // } + + Future
getAddress(double lat, double lang) async { + var result = await ApiService(Dio()).geocodeRegeo("$lat", "$lang"); + print("address_result: $result"); + if (result["status"] == 1 && + result["regeocode"] != null && + result["regeocode"]["addressComponent"] != null) { + Address address = Address.fromJson({ + "address": result["regeocode"]["formatted_address"], + "area": result['regeocode']["addressComponent"]["district"], + "city": result['regeocode']["addressComponent"]["city"], + "latitude": lat, + "longitude": lang, + "province": result['regeocode']["addressComponent"]["province"], + }); + return address; + } + return null; + } } diff --git a/pubspec.lock b/pubspec.lock index 87884e3c..96679656 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,6 +5,7 @@ packages: dependency: "direct main" description: name: ai_decimal_accuracy + sha256: "2a0f195a0bf9f36e7481a66e03d5b1e4e90b4861438910d63e99e42ddcdebdbb" url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" @@ -12,6 +13,7 @@ packages: dependency: "direct main" description: name: android_intent_plus + sha256: e49b4d9e26135dd7ef83606aac56bd3105345e8243de903939a15c5aa07cc0ec url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" @@ -19,6 +21,7 @@ packages: dependency: transitive description: name: args + sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" @@ -26,6 +29,7 @@ packages: dependency: transitive description: name: asn1lib + sha256: b74e3842a52c61f8819a1ec8444b4de5419b41a7465e69d4aa681445377398b0 url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" @@ -33,13 +37,15 @@ packages: dependency: transitive description: name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.flutter-io.cn" source: hosted - version: "2.8.2" + version: "2.10.0" barcode: dependency: transitive description: name: barcode + sha256: "6f4e44699843c336fcb4a14a4f4221f03d21ae47dd8c4ae4c25ffc7b7dd1cfb8" url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" @@ -47,6 +53,7 @@ packages: dependency: "direct main" description: name: barcode_widget + sha256: "4fb82c63a008972bc5f0ca83865bd3a5728f596c80f44658aefd7d55b6e65f45" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" @@ -54,13 +61,15 @@ packages: dependency: transitive description: name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" bubble_tab_indicator: dependency: "direct main" description: name: bubble_tab_indicator + sha256: "0aa37980a00e3374d917f9da8e83acd7f59ba872a3d05c306220063f28f945aa" url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" @@ -68,13 +77,15 @@ packages: dependency: transitive description: name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: name: charcode + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" @@ -82,6 +93,7 @@ packages: dependency: transitive description: name: charts_common + sha256: "7b8922f9b0d9b134122756a787dab1c3946ae4f3fc5022ff323ba0014998ea02" url: "https://pub.flutter-io.cn" source: hosted version: "0.12.0" @@ -89,6 +101,7 @@ packages: dependency: "direct main" description: name: charts_flutter + sha256: "4172c3f4b85322fdffe1896ffbed79ae4689ae72cb6fe6690dcaaea620a9c558" url: "https://pub.flutter-io.cn" source: hosted version: "0.12.0" @@ -96,6 +109,7 @@ packages: dependency: transitive description: name: chewie + sha256: "90a75721f8cb881be0a38878b246183f69a0490e409f1d8f294b686b89a25f24" url: "https://pub.flutter-io.cn" source: hosted version: "1.3.3" @@ -103,6 +117,7 @@ packages: dependency: "direct main" description: name: chewie_audio + sha256: ac29d37382c4f0d9da8e6f53c78b3e74ffff102040b1e77c7e49e4fa35cd425f url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" @@ -110,20 +125,23 @@ packages: dependency: transitive description: name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 url: "https://pub.flutter-io.cn" source: hosted - version: "1.16.0" + version: "1.17.0" convert: dependency: transitive description: name: convert + sha256: "1be13198012c1d5bc042dc40ad1d7f16cbd522350984c0c1abf471d6d7e305c6" url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" @@ -131,6 +149,7 @@ packages: dependency: transitive description: name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" @@ -138,6 +157,7 @@ packages: dependency: transitive description: name: csslib + sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 url: "https://pub.flutter-io.cn" source: hosted version: "0.17.2" @@ -145,6 +165,7 @@ packages: dependency: "direct main" description: name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" @@ -152,20 +173,15 @@ packages: dependency: "direct main" description: name: dio + sha256: "11979099d9ea182d74b6734340704d628b99c7a8316f9edd7718a297d1bcdd27" url: "https://pub.flutter-io.cn" source: hosted version: "3.0.10" - dio_log: - dependency: "direct main" - description: - name: dio_log - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.5" emoji_picker_flutter: dependency: "direct main" description: name: emoji_picker_flutter + sha256: a0e8b36a98ca2257b0edd9cb6ef5b4aa2a6fbf3ed67cf11eab96100778741b8a url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" @@ -173,6 +189,7 @@ packages: dependency: "direct main" description: name: encrypt + sha256: "4fd4e4fdc21b9d7d4141823e1e6515cd94e7b8d84749504c232999fba25d9bbb" url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" @@ -180,6 +197,7 @@ packages: dependency: transitive description: name: equatable + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" @@ -187,6 +205,7 @@ packages: dependency: "direct main" description: name: event_bus + sha256: "44baa799834f4c803921873e7446a2add0f3efa45e101a054b1f0ab9b95f8edc" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" @@ -194,13 +213,15 @@ packages: dependency: transitive description: name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" @@ -208,6 +229,7 @@ packages: dependency: transitive description: name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.flutter-io.cn" source: hosted version: "6.1.4" @@ -215,6 +237,7 @@ packages: dependency: "direct main" description: name: fl_chart + sha256: "48a1b69be9544e2b03d9a8e843affd89e43f3194c9248776222efcb4206bb1ec" url: "https://pub.flutter-io.cn" source: hosted version: "0.62.0" @@ -222,6 +245,7 @@ packages: dependency: "direct main" description: name: flare_flutter + sha256: "99d63c60f00fac81249ce6410ee015d7b125c63d8278a30da81edf3317a1f6a0" url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" @@ -230,45 +254,11 @@ packages: description: flutter source: sdk 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: "3.2.0" - flutter_baidu_mapapi_map: - dependency: "direct main" - description: - name: flutter_baidu_mapapi_map - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.2.1" - flutter_baidu_mapapi_search: - dependency: "direct main" - description: - name: flutter_baidu_mapapi_search - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.2.0" - flutter_baidu_mapapi_utils: - dependency: "direct main" - description: - name: flutter_baidu_mapapi_utils - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.2.0" - flutter_bmflocation: - dependency: "direct main" - description: - name: flutter_bmflocation - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.2.1" flutter_datetime_picker: dependency: "direct main" description: name: flutter_datetime_picker + sha256: "8e695c63c769350e541951227c2775190ec73ceda774a315b1dc9a99d5facfe5" url: "https://pub.flutter-io.cn" source: hosted version: "1.5.1" @@ -276,6 +266,7 @@ packages: dependency: "direct main" description: name: flutter_easyloading + sha256: ba21a3c883544e582f9cc455a4a0907556714e1e9cf0eababfcb600da191d17c url: "https://pub.flutter-io.cn" source: hosted version: "3.0.5" @@ -283,6 +274,7 @@ packages: dependency: "direct main" description: name: flutter_html + sha256: ccb810fcabfce3a7ffaca46e458323915ac7e7fc59082c7357ff848972c02230 url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" @@ -290,6 +282,7 @@ packages: dependency: transitive description: name: flutter_layout_grid + sha256: "86c1b21520612edfbb93f189b3ec05058470570f3a5c08ce10c92cc76a6e814e" url: "https://pub.flutter-io.cn" source: hosted version: "1.0.6" @@ -302,6 +295,7 @@ packages: dependency: transitive description: name: flutter_math_fork + sha256: cfec964c4975c6becc64291eb9b782fe70df5e0c5bfe0763d9e856432fcc6fcd url: "https://pub.flutter-io.cn" source: hosted version: "0.4.2+2" @@ -309,20 +303,15 @@ packages: dependency: transitive description: name: flutter_page_indicator + sha256: a5b2992228c2827b69faed3977681a3f5c313c7f13d72272decbb2923d1d7176 url: "https://pub.flutter-io.cn" source: hosted version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.14" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil + sha256: c04bf2f9a41b5130c1071daa34acc04b5e4f479181287a958ece9b31a5b8f89c url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0+1" @@ -330,6 +319,7 @@ packages: dependency: "direct main" description: name: flutter_slidable + sha256: "90787334388211e6810065550119b015e6fd3893584641194d500bf5bc7e6235" url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" @@ -337,6 +327,7 @@ packages: dependency: "direct main" description: name: flutter_smart_dialog + sha256: "3f99d33847629b223f28bb339eff58687d64efed3965a7e44d650d0c89739325" url: "https://pub.flutter-io.cn" source: hosted version: "3.0.6" @@ -344,6 +335,7 @@ packages: dependency: "direct main" description: name: flutter_spinkit + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e url: "https://pub.flutter-io.cn" source: hosted version: "5.2.0" @@ -351,6 +343,7 @@ packages: dependency: "direct main" description: name: flutter_staggered_grid_view + sha256: f0b6d8c0fa7b4b444985cdde68492c0138a4fb6fc57a641b24cb234b7ee0f5c4 url: "https://pub.flutter-io.cn" source: hosted version: "0.4.1" @@ -358,6 +351,7 @@ packages: dependency: "direct main" description: name: flutter_svg + sha256: "9ac1967e2f72a08af11b05b39167920f90d043cf67163d13a544a358c8f31afa" url: "https://pub.flutter-io.cn" source: hosted version: "0.22.0" @@ -365,6 +359,7 @@ packages: dependency: "direct main" description: name: flutter_swiper + sha256: e52a0e894abfa4099a5d4e5098a00597f3b55e25617cdd19e6fe6be5d24858c7 url: "https://pub.flutter-io.cn" source: hosted version: "1.1.6" @@ -382,6 +377,7 @@ packages: dependency: "direct main" description: name: fluwx + sha256: e54837349819d51261be00692071db43fc1ff79dd06cf3a50175a5940249691e url: "https://pub.flutter-io.cn" source: hosted version: "3.9.0+2" @@ -389,6 +385,7 @@ packages: dependency: "direct main" description: name: font_awesome_flutter + sha256: "1f93e5799f0e6c882819e8393a05c6ca5226010f289190f2242ec19f3f0fdba5" url: "https://pub.flutter-io.cn" source: hosted version: "9.2.0" @@ -396,6 +393,31 @@ packages: dependency: "direct main" description: name: gbk2utf8 + sha256: "83a255e974b970d20538c1661bd5b7ee9120e106fbb10478cffcd515ba480e34" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.1" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: "01fed879aa87185efebfb1d23de619077bcc7d83ffdebd0aad6f74392f84fb40" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.1" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: aa11c4cb9eb31f096ffc62cf54858f869bd437de327cba660577ddd594a8f3fa + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.9" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: "9a7f3c5061fb8fb26103fc67e07343eebd4d3b15d18c6d75766e2a1a8b0618f8" url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" @@ -403,6 +425,7 @@ packages: dependency: "direct main" description: name: gradient_widgets + sha256: d337a8a329da9aefa50b82155d11875c1b9992982f65d15c805aa057a2670536 url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" @@ -410,6 +433,7 @@ packages: dependency: transitive description: name: graphs + sha256: db4e50f399d69bf7349d4e99e8dabd74fad51c0574f36b8d3613ef465715af52 url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0" @@ -417,6 +441,7 @@ packages: dependency: transitive description: name: html + sha256: "58e3491f7bf0b6a4ea5110c0c688877460d1a6366731155c4a4580e7ded773e8" url: "https://pub.flutter-io.cn" source: hosted version: "0.15.3" @@ -424,6 +449,7 @@ packages: dependency: transitive description: name: http_parser + sha256: "9d2b0626e9e402fc98e6868360da8f256064d6c0b8e4c3edcca5e02fb0b95da9" url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" @@ -431,6 +457,7 @@ packages: dependency: "direct main" description: name: image_gallery_saver + sha256: be812580c7a320d3bf583af89cac6b376f170d48000aca75215a73285a3223a0 url: "https://pub.flutter-io.cn" source: hosted version: "1.7.1" @@ -438,6 +465,7 @@ packages: dependency: "direct main" description: name: image_pickers + sha256: "3175436eec5136773230cf25bb0feba7e58bded93c6f4159bd4bae2b90b4c2d3" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" @@ -445,6 +473,7 @@ packages: dependency: transitive description: name: infinite_listview + sha256: f6062c1720eb59be553dfa6b89813d3e8dd2f054538445aaa5edaddfa5195ce6 url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" @@ -452,6 +481,7 @@ packages: dependency: "direct main" description: name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" @@ -459,13 +489,15 @@ packages: dependency: transitive description: name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.4" + version: "0.6.5" json_annotation: dependency: "direct main" description: name: json_annotation + sha256: "6cec7404b25d6338c8cb7b30131cd6c760079a4ec1fa7846c55bdda91f9d2819" url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" @@ -473,6 +505,7 @@ packages: dependency: "direct main" description: name: keframe + sha256: a84add1826c54cd68e6095dbcc00cdd84fd4d97820712bfc8e1d06f41b0bfac3 url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" @@ -480,6 +513,7 @@ packages: dependency: "direct main" description: name: like_button + sha256: "08e6a45b78888412df5d351786c550205ad3a677e72a0820d5bbc0b063c8a463" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" @@ -487,6 +521,7 @@ packages: dependency: "direct main" description: name: logger + sha256: "6bbb9d6f7056729537a4309bda2e74e18e5d9f14302489cc1e93f33b3fe32cac" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2+1" @@ -494,6 +529,7 @@ packages: dependency: transitive description: name: logging + sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946 url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" @@ -501,27 +537,31 @@ packages: dependency: transitive description: name: matcher + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.0" + version: "1.8.0" mqtt_client: dependency: "direct main" description: name: mqtt_client + sha256: e8347f8996c33b80a6764a1881e94a8ef5392c2d6e724b9daad65eafa202b0c7 url: "https://pub.flutter-io.cn" source: hosted version: "9.6.8" @@ -529,6 +569,7 @@ packages: dependency: transitive description: name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" @@ -536,6 +577,7 @@ packages: dependency: "direct main" description: name: network_to_file_image + sha256: "47528730539abf61ea9b5edf30fe2803b5f8212b2049e1a6cb3b564acadc46dc" url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" @@ -543,6 +585,7 @@ packages: dependency: "direct main" description: name: number_precision + sha256: "397639f584cdd4fb5965e3b91c03b911b0c8fa9c5be7e7236bbf102bf6f75681" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2+1" @@ -550,6 +593,7 @@ packages: dependency: transitive description: name: numerus + sha256: "0087ef729d63b96cb347a9c44b9c592f21cecb3605b415bbd18710aef80ce5cb" url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" @@ -557,6 +601,7 @@ packages: dependency: "direct main" description: name: package_info + sha256: "6c07d9d82c69e16afeeeeb6866fe43985a20b3b50df243091bfc4a4ad2b03b75" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" @@ -564,13 +609,15 @@ packages: dependency: transitive description: name: path + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.1" + version: "1.8.2" path_drawing: dependency: transitive description: name: path_drawing + sha256: "3bdd251dae9ffaef944450b73f168610db7e968e7b20daf0c3907f8b4aafc8a2" url: "https://pub.flutter-io.cn" source: hosted version: "0.5.1+1" @@ -578,6 +625,7 @@ packages: dependency: transitive description: name: path_parsing + sha256: ee5c47c1058ad66b4a41746ec3996af9593d0858872807bcd64ac118f0700337 url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" @@ -585,6 +633,7 @@ packages: dependency: "direct main" description: name: path_provider + sha256: "7a6929151858214b36140fb847090292d027818e91da7141a2402cbf037b491e" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" @@ -592,6 +641,7 @@ packages: dependency: transitive description: name: path_provider_linux + sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" url: "https://pub.flutter-io.cn" source: hosted version: "2.1.10" @@ -599,6 +649,7 @@ packages: dependency: transitive description: name: path_provider_macos + sha256: "4e9a9637dfeba8c35f598238c63adc6e77121b16d81ae97ad21b952a67c83a64" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" @@ -606,6 +657,7 @@ packages: dependency: transitive description: name: path_provider_platform_interface + sha256: "2e14fc474b8acfc4111ac8eb0e37c2fe70234f9f8cd796f1560d03aa1689fa51" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" @@ -613,6 +665,7 @@ packages: dependency: transitive description: name: path_provider_windows + sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 url: "https://pub.flutter-io.cn" source: hosted version: "2.1.6" @@ -620,6 +673,7 @@ packages: dependency: "direct main" description: name: permission_handler + sha256: fb4666087528b1cbf91d98771cf50b14f36f4d8756ec7e7a8629dd3cb55442b7 url: "https://pub.flutter-io.cn" source: hosted version: "5.1.0+2" @@ -627,6 +681,7 @@ packages: dependency: transitive description: name: permission_handler_platform_interface + sha256: f7e3c798f7c4dd215e4ca8843695b3a63a5b79c9aa04f296d316f13a15d518ba url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" @@ -634,6 +689,7 @@ packages: dependency: transitive description: name: petitparser + sha256: "2ebb289dc4764ec397f5cd3ca9881c6d17196130a7d646ed022a0dd9c2e25a71" url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" @@ -641,6 +697,7 @@ packages: dependency: "direct main" description: name: photo_view + sha256: "26cb153080a2673bebccaf72d3283e82f8f41a47fe5f9bc5ba8634d2e8a9fc8e" url: "https://pub.flutter-io.cn" source: hosted version: "0.13.0" @@ -648,6 +705,7 @@ packages: dependency: "direct main" description: name: pin_input_text_field + sha256: "569861876d5c67994adc58ddd15e93bd0057c4f26d7e5599ccde880d05813463" url: "https://pub.flutter-io.cn" source: hosted version: "4.4.1" @@ -655,6 +713,7 @@ packages: dependency: transitive description: name: platform + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" @@ -662,6 +721,7 @@ packages: dependency: transitive description: name: plugin_platform_interface + sha256: c3ebbff365bfb1b5f7b690c9857d2dabea167f35b05eb7586186499b407efb37 url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" @@ -669,6 +729,7 @@ packages: dependency: transitive description: name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" url: "https://pub.flutter-io.cn" source: hosted version: "3.7.3" @@ -676,6 +737,7 @@ packages: dependency: transitive description: name: process + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" url: "https://pub.flutter-io.cn" source: hosted version: "4.2.4" @@ -683,6 +745,7 @@ packages: dependency: transitive description: name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f url: "https://pub.flutter-io.cn" source: hosted version: "6.0.5" @@ -690,6 +753,7 @@ packages: dependency: "direct main" description: name: pull_to_refresh + sha256: bbadd5a931837b57739cf08736bea63167e284e71fb23b218c8c9a6e042aad12 url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" @@ -697,6 +761,7 @@ packages: dependency: transitive description: name: qr + sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" @@ -704,6 +769,7 @@ packages: dependency: "direct main" description: name: qr_flutter + sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" @@ -711,6 +777,7 @@ packages: dependency: transitive description: name: quiver + sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" @@ -718,6 +785,7 @@ packages: dependency: "direct main" description: name: retrofit + sha256: bd4d2817ecb01cdf7ce6d7de62a44716639e82e6b62bd295984c12eb916fb341 url: "https://pub.flutter-io.cn" source: hosted version: "1.3.4+1" @@ -725,6 +793,7 @@ packages: dependency: "direct main" description: name: rive + sha256: cf420a4440bc072698432bd176e70c70cbec01b8c1debe5c56edf2a19b310fbf url: "https://pub.flutter-io.cn" source: hosted version: "0.6.8" @@ -732,6 +801,7 @@ packages: dependency: "direct main" description: name: rxdart + sha256: "2ef8b4e91cb3b55d155e0e34eeae0ac7107974e451495c955ac04ddee8cc21fd" url: "https://pub.flutter-io.cn" source: hosted version: "0.26.0" @@ -739,6 +809,7 @@ packages: dependency: "direct main" description: name: scan + sha256: b343ec36f863a88d41eb4c174b810c055c6bd1f1822b2188ab31aab684fb7cdb url: "https://pub.flutter-io.cn" source: hosted version: "1.6.0" @@ -746,6 +817,7 @@ packages: dependency: "direct main" description: name: shared_preferences + sha256: "78528fd87d0d08ffd3e69551173c026e8eacc7b7079c82eb6a77413957b7e394" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.20" @@ -753,6 +825,7 @@ packages: dependency: transitive description: name: shared_preferences_android + sha256: ad423a80fe7b4e48b50d6111b3ea1027af0e959e49d485712e134863d9c1c521 url: "https://pub.flutter-io.cn" source: hosted version: "2.0.17" @@ -760,6 +833,7 @@ packages: dependency: transitive description: name: shared_preferences_foundation + sha256: "1e755f8583229f185cfca61b1d80fb2344c9d660e1c69ede5450d8f478fa5310" url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" @@ -767,6 +841,7 @@ packages: dependency: transitive description: name: shared_preferences_linux + sha256: "3a59ed10890a8409ad0faad7bb2957dab4b92b8fbe553257b05d30ed8af2c707" url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" @@ -774,6 +849,7 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface + sha256: "992f0fdc46d0a3c0ac2e5859f2de0e577bbe51f78a77ee8f357cbe626a2ad32d" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" @@ -781,6 +857,7 @@ packages: dependency: transitive description: name: shared_preferences_web + sha256: "0dc2633f215a3d4aa3184c9b2c5766f4711e4e5a6b256e62aafee41f89f1bfb8" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" @@ -788,6 +865,7 @@ packages: dependency: transitive description: name: shared_preferences_windows + sha256: "71bcd669bb9cdb6b39f22c4a7728b6d49e934f6cba73157ffa5a54f1eed67436" url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" @@ -795,6 +873,7 @@ packages: dependency: "direct main" description: name: sharesdk_plugin + sha256: a1a18d01f362c119df1931082e3694591a24b3b00eef2576522e00ef8da3b25e url: "https://pub.flutter-io.cn" source: hosted version: "1.3.10" @@ -802,6 +881,7 @@ packages: dependency: "direct main" description: name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" @@ -809,6 +889,7 @@ packages: dependency: transitive description: name: simple_gesture_detector + sha256: "7ab8ee2027f4323a1574e9eeda55d4279ae499190e119d6b872b3a52b501eb42" url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" @@ -821,20 +902,23 @@ packages: dependency: transitive description: name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.2" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.flutter-io.cn" source: hosted - version: "1.10.0" + version: "1.11.0" steel_crypt: dependency: "direct main" description: name: steel_crypt + sha256: "4f86a8ddc690ed1adff486faeb4ceece9e09f59cd90c8bd7e2ff48c42ca271dd" url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0+1" @@ -842,20 +926,23 @@ packages: dependency: transitive description: name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0" syncfusion_flutter_core: dependency: transitive description: name: syncfusion_flutter_core + sha256: "9be1bb9bbdb42823439a18da71484f1964c14dbe1c255ab1b931932b12fa96e8" url: "https://pub.flutter-io.cn" source: hosted version: "19.4.56" @@ -863,6 +950,7 @@ packages: dependency: "direct main" description: name: syncfusion_flutter_datepicker + sha256: ff428c4e2ebd753c2f8f3b2aa60e96e014c9ca2653ce7007c7a603e560973f34 url: "https://pub.flutter-io.cn" source: hosted version: "19.4.56" @@ -870,6 +958,7 @@ packages: dependency: "direct main" description: name: table_calendar + sha256: "82dc932c6e07af6e7eeafb2c91e87969746f3b9b59ac222ecf8d75f51c3a4844" url: "https://pub.flutter-io.cn" source: hosted version: "2.3.3" @@ -877,20 +966,23 @@ packages: dependency: transitive description: name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.9" + version: "0.4.16" thumbnails: dependency: "direct main" description: name: thumbnails + sha256: "06b3f727362b3c08a222800e881258dd5d5d42775ad07b64efb60e583dd6de8d" url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" @@ -898,6 +990,7 @@ packages: dependency: "direct main" description: name: tobias + sha256: "61b35145cdebde36da7a54d211d807a3cb1681c50456d40495fa7109dddd7a44" url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" @@ -914,6 +1007,7 @@ packages: dependency: transitive description: name: transformer_page_view + sha256: "2210531bc4148831061c575070173f32693415be8bbbf5bd2159a38f2adff61c" url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" @@ -921,6 +1015,7 @@ packages: dependency: transitive description: name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" @@ -928,6 +1023,7 @@ packages: dependency: transitive description: name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" @@ -935,6 +1031,7 @@ packages: dependency: "direct main" description: name: umeng_common_sdk + sha256: fce28065224b0839ffc16b5003d2295dae8aabee290bf639f978536b32ed601d url: "https://pub.flutter-io.cn" source: hosted version: "1.2.6" @@ -942,6 +1039,7 @@ packages: dependency: "direct main" description: name: url_launcher + sha256: e1e0c46fcd777c0f0bd7f4541b747c28ad4e925f93344cebf667ef76c695533a url: "https://pub.flutter-io.cn" source: hosted version: "5.7.10" @@ -949,6 +1047,7 @@ packages: dependency: transitive description: name: url_launcher_linux + sha256: c489023cdd864a19c0be63bb3796bec21ea4bc16bfe09568953f1828e02151c9 url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+4" @@ -956,6 +1055,7 @@ packages: dependency: transitive description: name: url_launcher_macos + sha256: be04eac5076414469027ce068c360478c3e56e43205bb7efaaa61cbdd3ba890d url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+9" @@ -963,6 +1063,7 @@ packages: dependency: transitive description: name: url_launcher_platform_interface + sha256: c6bd00f46e8c348703d0ae691850eb2052be8e1338dc3ae6f72af53b962da157 url: "https://pub.flutter-io.cn" source: hosted version: "1.0.9" @@ -970,6 +1071,7 @@ packages: dependency: transitive description: name: url_launcher_web + sha256: eaa6de8ac353681794533edcedd69dd8b39ed987bf2360d172185eff8283dbc2 url: "https://pub.flutter-io.cn" source: hosted version: "0.1.5+3" @@ -977,6 +1079,7 @@ packages: dependency: transitive description: name: url_launcher_windows + sha256: "034479b1dafd8f01de81267d8117eb5ae019e0dddcc23f4b14ed31253a2635d9" url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+3" @@ -984,13 +1087,15 @@ packages: dependency: transitive description: name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" + version: "2.1.4" video_player: dependency: "direct main" description: name: video_player + sha256: "743b57d45251101344057d3b886a5f9a4fbb3eb3e275ac8bb64c3a7fa0c79d4c" url: "https://pub.flutter-io.cn" source: hosted version: "2.2.19" @@ -998,6 +1103,7 @@ packages: dependency: transitive description: name: video_player_android + sha256: b41889c6bc9eaf51790863885349fb5ff8edef2da940291a2da96b80dd649686 url: "https://pub.flutter-io.cn" source: hosted version: "2.3.4" @@ -1005,6 +1111,7 @@ packages: dependency: transitive description: name: video_player_avfoundation + sha256: "5df5411ff9d316f1dcbfee284e9838aa686e314f2a722b15c02cb7ce40ef9446" url: "https://pub.flutter-io.cn" source: hosted version: "2.3.9" @@ -1012,6 +1119,7 @@ packages: dependency: transitive description: name: video_player_platform_interface + sha256: a1d56477752271a7a0de872d8962bce1dd5fecf463beaf66da417ebebb9ba0f7 url: "https://pub.flutter-io.cn" source: hosted version: "4.2.0" @@ -1019,6 +1127,7 @@ packages: dependency: transitive description: name: video_player_web + sha256: fb3bbeaf0302cb0c31340ebd6075487939aa1fe3b379d1a8784ef852b679940e url: "https://pub.flutter-io.cn" source: hosted version: "2.0.15" @@ -1026,6 +1135,7 @@ packages: dependency: "direct main" description: name: visibility_detector + sha256: "15c54a459ec2c17b4705450483f3d5a2858e733aee893dcee9d75fd04814940d" url: "https://pub.flutter-io.cn" source: hosted version: "0.3.3" @@ -1033,6 +1143,7 @@ packages: dependency: transitive description: name: wakelock + sha256: "769ecf42eb2d07128407b50cb93d7c10bd2ee48f0276ef0119db1d25cc2f87db" url: "https://pub.flutter-io.cn" source: hosted version: "0.6.2" @@ -1040,6 +1151,7 @@ packages: dependency: transitive description: name: wakelock_macos + sha256: "047c6be2f88cb6b76d02553bca5a3a3b95323b15d30867eca53a19a0a319d4cd" url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" @@ -1047,6 +1159,7 @@ packages: dependency: transitive description: name: wakelock_platform_interface + sha256: "1f4aeb81fb592b863da83d2d0f7b8196067451e4df91046c26b54a403f9de621" url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" @@ -1054,6 +1167,7 @@ packages: dependency: transitive description: name: wakelock_web + sha256: "1b256b811ee3f0834888efddfe03da8d18d0819317f20f6193e2922b41a501b5" url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" @@ -1061,6 +1175,7 @@ packages: dependency: transitive description: name: wakelock_windows + sha256: "857f77b3fe6ae82dd045455baa626bc4b93cb9bb6c86bf3f27c182167c3a5567" url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" @@ -1068,6 +1183,7 @@ packages: dependency: transitive description: name: webview_flutter + sha256: "15900bc32e210fc5a87b08e65473c45ff4fa0ed707f05a84ea2547aaf1d2cfc7" url: "https://pub.flutter-io.cn" source: hosted version: "2.0.14" @@ -1075,6 +1191,7 @@ packages: dependency: "direct main" description: name: widgetpicker + sha256: "1ab0ef91a279d0dfbbddc6d2b0c2624ea02b8ab7030d51d27d97dad2a1233a15" url: "https://pub.flutter-io.cn" source: hosted version: "0.1.1" @@ -1082,6 +1199,7 @@ packages: dependency: transitive description: name: win32 + sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4 url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" @@ -1089,6 +1207,7 @@ packages: dependency: transitive description: name: xdg_directories + sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" @@ -1096,9 +1215,10 @@ packages: dependency: transitive description: name: xml + sha256: "80d494c09849dc3f899d227a78c30c5b949b985ededf884cb3f3bcd39f4b447a" url: "https://pub.flutter-io.cn" source: hosted version: "5.4.1" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=2.18.0 <3.0.0" flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1a77c6ee..8b3bd054 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,18 +41,15 @@ dependencies: permission_handler: ^5.0.1+1 - flutter_bmflocation: 3.2.1 - flutter_baidu_mapapi_base: 3.2.0 - flutter_baidu_mapapi_map: 3.2.1 - flutter_baidu_mapapi_search: 3.2.0 - flutter_baidu_mapapi_utils: 3.2.0 + geolocator: ^6.2.1 +# location: ^3.2.4 dio: ^3.0.10 rxdart: ^0.26.0 retrofit: ^1.3.4+1 json_annotation: ^3.1.1 logger: ^2.0.2+1 - dio_log: ^1.3.5 +# dio_log: ^1.3.5 pin_input_text_field: ^4.1.2 android_intent_plus: ^1.0.2