Browse Source

修改

null_safety
哈哈哈 3 years ago
parent
commit
ddb820f8d2
  1. BIN
      assets/image/2x/icon_map_marker.png
  2. BIN
      assets/image/icon_map_marker.png
  3. 10
      ios/Podfile.lock
  4. 18
      ios/Runner.xcodeproj/project.pbxproj
  5. 0
      ios/Runner/AppDelegate.mm
  6. 12
      ios/Runner/test.swift
  7. 185
      lib/address/address_map_page.dart
  8. 2
      lib/main.dart
  9. 7
      lib/main_page.dart
  10. 14
      lib/order/store_selector_page.dart
  11. 332
      lib/union/union_page.dart
  12. 15
      pubspec.lock
  13. 2
      pubspec.yaml

BIN
assets/image/2x/icon_map_marker.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
assets/image/icon_map_marker.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

10
ios/Podfile.lock

@ -6,6 +6,7 @@ PODS:
- BaiduMapKit/Base - BaiduMapKit/Base
- BaiduMapKit/Utils (6.2.0): - BaiduMapKit/Utils (6.2.0):
- BaiduMapKit/Base - BaiduMapKit/Base
- BMKLocationKit (2.0.0)
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_baidu_mapapi_base (2.0.0): - flutter_baidu_mapapi_base (2.0.0):
- BaiduMapKit/Utils (= 6.2.0) - BaiduMapKit/Utils (= 6.2.0)
@ -22,6 +23,9 @@ PODS:
- BaiduMapKit/Utils (= 6.2.0) - BaiduMapKit/Utils (= 6.2.0)
- Flutter - Flutter
- flutter_baidu_mapapi_base - flutter_baidu_mapapi_base
- flutter_bmflocation (1.0.3):
- BMKLocationKit
- Flutter
- fluwx (0.0.1): - fluwx (0.0.1):
- Flutter - Flutter
- WechatOpenSDK (= 1.8.7.1) - WechatOpenSDK (= 1.8.7.1)
@ -98,6 +102,7 @@ DEPENDENCIES:
- flutter_baidu_mapapi_map (from `.symlinks/plugins/flutter_baidu_mapapi_map/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_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`)
- flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/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`) - fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`)
@ -116,6 +121,7 @@ DEPENDENCIES:
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- BaiduMapKit - BaiduMapKit
- BMKLocationKit
- FMDB - FMDB
- mob_sharesdk - mob_sharesdk
- MOBFoundation - MOBFoundation
@ -134,6 +140,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_baidu_mapapi_search/ios" :path: ".symlinks/plugins/flutter_baidu_mapapi_search/ios"
flutter_baidu_mapapi_utils: flutter_baidu_mapapi_utils:
:path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios" :path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios"
flutter_bmflocation:
:path: ".symlinks/plugins/flutter_bmflocation/ios"
fluwx: fluwx:
:path: ".symlinks/plugins/fluwx/ios" :path: ".symlinks/plugins/fluwx/ios"
image_cropper: image_cropper:
@ -165,11 +173,13 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8 BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8
BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db
flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16 flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16
flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d
flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a
flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb

18
ios/Runner.xcodeproj/project.pbxproj

@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
0558860326BD10CA00FB1CFE /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0558860226BD10CA00FB1CFE /* test.swift */; };
05C5426026BB9CEB00D26AC2 /* liblibIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33A2695816000237A5E /* liblibIO.a */; }; 05C5426026BB9CEB00D26AC2 /* liblibIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33A2695816000237A5E /* liblibIO.a */; };
05C5426F26BBE8FE00D26AC2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F373269581F600237A5E /* CoreLocation.framework */; }; 05C5426F26BBE8FE00D26AC2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F373269581F600237A5E /* CoreLocation.framework */; };
05C5427126BBE93600D26AC2 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05C5427026BBE93600D26AC2 /* AdSupport.framework */; }; 05C5427126BBE93600D26AC2 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05C5427026BBE93600D26AC2 /* AdSupport.framework */; };
@ -68,7 +69,7 @@
89AEFA9126A69A2200DD2817 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9026A69A2200DD2817 /* ExternalAccessory.framework */; }; 89AEFA9126A69A2200DD2817 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9026A69A2200DD2817 /* ExternalAccessory.framework */; };
89AEFA9326A69A3600DD2817 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9226A69A3600DD2817 /* Security.framework */; }; 89AEFA9326A69A3600DD2817 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9226A69A3600DD2817 /* Security.framework */; };
89AEFA9526A69A4800DD2817 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9426A69A4800DD2817 /* SystemConfiguration.framework */; }; 89AEFA9526A69A4800DD2817 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9426A69A4800DD2817 /* SystemConfiguration.framework */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@ -90,6 +91,7 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0558860226BD10CA00FB1CFE /* test.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = test.swift; sourceTree = "<group>"; };
05C5427026BBE93600D26AC2 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; 05C5427026BBE93600D26AC2 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
05C5427326BCE3AC00D26AC2 /* BMKLocationKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = BMKLocationKit.framework; sourceTree = "<group>"; }; 05C5427326BCE3AC00D26AC2 /* BMKLocationKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = BMKLocationKit.framework; sourceTree = "<group>"; };
05C5427526BCFA9000D26AC2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 05C5427526BCFA9000D26AC2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
@ -211,7 +213,7 @@
6EE8F37E269582C200237A5E /* UniappPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UniappPlugin.m; sourceTree = "<group>"; }; 6EE8F37E269582C200237A5E /* UniappPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UniappPlugin.m; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
81880E8F5E90EA6E5E0D57EB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; 81880E8F5E90EA6E5E0D57EB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
89847A4826A14482008C8077 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; }; 89847A4826A14482008C8077 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
899C4C3826A5171500B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; }; 899C4C3826A5171500B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
@ -591,7 +593,7 @@
6EE8F2E42695813500237A5E /* UniMPSDK */, 6EE8F2E42695813500237A5E /* UniMPSDK */,
6EE8F2E32695806400237A5E /* Class */, 6EE8F2E32695806400237A5E /* Class */,
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@ -600,6 +602,7 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
05C5427726BCFCBB00D26AC2 /* Runner-Bridging-Header.h */, 05C5427726BCFCBB00D26AC2 /* Runner-Bridging-Header.h */,
0558860226BD10CA00FB1CFE /* test.swift */,
); );
path = Runner; path = Runner;
sourceTree = "<group>"; sourceTree = "<group>";
@ -769,9 +772,10 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 978B8F6F1D3862AE00F588F7 /* AppDelegate.mm in Sources */,
6EE8F37F269582C200237A5E /* UniappPlugin.m in Sources */, 6EE8F37F269582C200237A5E /* UniappPlugin.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */, 97C146F31CF9000F007C117D /* main.m in Sources */,
0558860326BD10CA00FB1CFE /* test.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -878,7 +882,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
@ -1104,7 +1108,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",
@ -1223,7 +1227,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"", "\"${PODS_ROOT}/Headers/Public\"",

0
ios/Runner/AppDelegate.m → ios/Runner/AppDelegate.mm

12
ios/Runner/test.swift

@ -0,0 +1,12 @@
//
// test.swift
// Runner
//
// Created by f on 2021/8/6.
//
import UIKit
class test: NSObject {
}

185
lib/address/address_map_page.dart

@ -9,7 +9,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.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/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_bmflocation/flutter_baidu_location_android_option.dart';
import 'package:flutter_bmflocation/flutter_baidu_location_ios_option.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
@ -27,7 +31,6 @@ class AddressMapPage extends StatefulWidget {
} }
class _AddressMapPage extends State<AddressMapPage> { class _AddressMapPage extends State<AddressMapPage> {
// //
void _loadCustomData() async { void _loadCustomData() async {
setState(() { setState(() {
@ -57,7 +60,6 @@ class _AddressMapPage extends State<AddressMapPage> {
}); });
if (aMapFlutterLocation == null) { if (aMapFlutterLocation == null) {
aMapFlutterLocation = LocationFlutterPlugin(); aMapFlutterLocation = LocationFlutterPlugin();
aMapFlutterLocation.onResultCallback().listen((event) { aMapFlutterLocation.onResultCallback().listen((event) {
print("event: ${jsonEncode(event)}"); print("event: ${jsonEncode(event)}");
@ -72,61 +74,87 @@ class _AddressMapPage extends State<AddressMapPage> {
} else { } else {
latLng = BMFCoordinate(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"], event["longitude"]);
} }
saveLatLng(latLng); BMFCalculateUtils.coordConvert(
if (_mapController != null) coordinate: latLng,
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL)
.then((value) {
saveLatLng(value);
if (_mapController != null) {
this.latLng = value;
addMarker();
_mapController.updateMapOptions( _mapController.updateMapOptions(
BMFMapOptions( BMFMapOptions(
center: latLng, center: latLng,
zoomLevel: 15, zoomLevel: 15,
), ),
); );
searchPoi(latLng);
} }
searchPoi(latLng);
}); });
} }
aMapFlutterLocation.prepareLoc({
"coorType": "bd09ll",
"isNeedAddres": false,
"isNeedAltitude": false,
"isNeedLocationPoiList": false,
"isNeedLocationDescribe": false,
"isNeedNewVersionRgc": false,
"scanspan": 0,
"openGps": true,
"locationMode": 2,
}, {
"locationMode": "kCLLocationAccuracyBest",
"locationTimeout": 10,
"reGeocodeTimeout": 10,
"activityType": "CLActivityTypeAutomotiveNavigation",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"BMKLocationCoordinateType": "BMKLocationCoordinateTypeBMK09LL",
"isNeedNewVersionRgc": false,
}); });
}
_loadCustomData(); _setLocOption();
getLatLng(); getLatLng();
startLocation(); startLocation();
} }
/// android端和ios端定位参数
void _setLocOption() {
/// android
BaiduLocationAndroidOption androidOption = new BaiduLocationAndroidOption();
androidOption.setCoorType("GCJ02"); //
androidOption.setIsNeedAltitude(true); //
androidOption.setIsNeedAddres(true); //
androidOption.setIsNeedLocationPoiList(true); // poi信息
androidOption.setIsNeedNewVersionRgc(true); // rgc信息
androidOption.setIsNeedLocationDescribe(true); //
androidOption.setOpenGps(true); // 使gps
androidOption.setLocationMode(LocationMode.Hight_Accuracy); //
androidOption.setScanspan(0); //
Map androidMap = androidOption.getMap();
/// ios
BaiduLocationIOSOption iosOption = new BaiduLocationIOSOption();
iosOption.setIsNeedNewVersionRgc(true); // rgc信息
iosOption.setBMKLocationCoordinateType(
"BMKLocationCoordinateTypeGCJ02"); //
iosOption.setActivityType("CLActivityTypeAutomotiveNavigation"); //
iosOption.setLocationTimeout(10); //
iosOption.setDesiredAccuracy("kCLLocationAccuracyBest"); //
iosOption.setReGeocodeTimeout(10); //
iosOption.setDistanceFilter(1000); //
iosOption.setAllowsBackgroundLocationUpdates(true); //
iosOption.setPauseLocUpdateAutomatically(true); //
Map iosMap = iosOption.getMap();
aMapFlutterLocation.prepareLoc(androidMap, iosMap);
}
List<Address> poiList; List<Address> poiList;
searchPoi(BMFCoordinate latLng) async { searchPoi(BMFCoordinate latLng) async {
keyWord = textEditingController.text; keyWord = textEditingController.text;
var addressPoi = await apiService.searchPoi(
"${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1); BMFPoiNearbySearch bmfPoiNearbySearch = BMFPoiNearbySearch();
List<dynamic> poi = addressPoi['pois']; bmfPoiNearbySearch.onGetPoiNearbySearchResult(
poiList = poi callback: (BMFPoiSearchResult result, BMFSearchErrorCode errorCode) {
if ((DateTime.now().millisecondsSinceEpoch - time) > 2000) {
result.poiInfoList.map((e) => print("sssssssssss:${e.toMap()}"));
poiList = result.poiInfoList
.map((e) => Address.fromJson({ .map((e) => Address.fromJson({
"address": e["address"] is List ? "" : e["address"], "address": e.address,
"area": e["adname"], "area": e.name,
"city": e["cityname"], "city": e.city,
"province": e["pname"], "province": e.province,
"latitude": e["location"].toString().split(",")[0], "latitude": e.pt.latitude,
"longitude": e["location"].toString().split(",")[1], "longitude": e.pt.longitude,
"cityInfo": e["name"], "cityInfo": e.name,
"id": "", "id": "",
"mid": "", "mid": "",
"phone": "", "phone": "",
@ -135,8 +163,23 @@ class _AddressMapPage extends State<AddressMapPage> {
"isDefault": true, "isDefault": true,
})) }))
.toList(); .toList();
setState(() {}); print("object112221: ${poiList.length}");
setState(() {
time = DateTime.now().millisecondsSinceEpoch;
});
} }
});
bmfPoiNearbySearch.poiNearbySearch(BMFPoiNearbySearchOption(
keywords: ["all"],
radius: 100000,
location: latLng,
pageSize: 20,
pageIndex: 0,
isRadiusLimit: true,
));
}
int time = 0;
startLocation() async { startLocation() async {
if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) { if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
@ -213,11 +256,47 @@ class _AddressMapPage extends State<AddressMapPage> {
BMFMapController _mapController; BMFMapController _mapController;
void onMapCreated(BMFMapController controller) { void onMapCreated(BMFMapController controller) {
controller.setMapRegionDidChangeCallback(callback: (status) {
center = status.targetGeoPt;
searchPoi(center);
});
setState(() { setState(() {
_mapController = controller; _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}");
bmfMarker = BMFMarker(
position: latLng,
screenPointToLock: BMFPoint(MediaQuery.of(context).size.width / 2,
MediaQuery.of(context).size.height / 4),
isLockedToScreen: true,
centerOffset: BMFPoint(0.5, 0.9),
enabled: false,
icon: "assets/image/icon_map_marker.png",
draggable: false,
);
_mapController.addMarker(bmfMarker);
}
bmfMarker.updateIsLockedToScreen(
true,
BMFPoint(MediaQuery.of(context).size.width / 2,
MediaQuery.of(context).size.height / 4));
}
saveLatLng(BMFCoordinate latLng) async { saveLatLng(BMFCoordinate latLng) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("latitude", "${latLng.latitude}");
@ -232,7 +311,8 @@ class _AddressMapPage extends State<AddressMapPage> {
BMFMapOptions( BMFMapOptions(
center: BMFCoordinate( center: BMFCoordinate(
double.tryParse(value.getString("latitude")), double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))), double.tryParse(value.getString("longitude")),
),
zoomLevel: 15, zoomLevel: 15,
), ),
); );
@ -277,18 +357,18 @@ class _AddressMapPage extends State<AddressMapPage> {
// ].toSet(), // ].toSet(),
), ),
), ),
Center( // Center(
child: IgnorePointer( // child: IgnorePointer(
child: Container( // child: Container(
margin: EdgeInsets.only(bottom: 44.h), // margin: EdgeInsets.only(bottom: 44.h),
child: Image.asset( // child: Image.asset(
"assets/image/icon_address_location.png", // "assets/image/icon_address_location.png",
width: 66.w, // width: 66.w,
height: 75.h, // height: 75.h,
), // ),
), // ),
), // ),
), // ),
searchWidget(), searchWidget(),
Positioned( Positioned(
right: 17, right: 17,
@ -372,7 +452,7 @@ class _AddressMapPage extends State<AddressMapPage> {
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
fontSize: 14.sp, fontSize: 14.sp,
), ),
) ),
], ],
), ),
); );
@ -395,7 +475,8 @@ class _AddressMapPage extends State<AddressMapPage> {
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
) )
]), ],
),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [

2
lib/main.dart

@ -121,7 +121,7 @@ initSdk() async {
BMFMapSDK.setApiKeyAndCoordType( BMFMapSDK.setApiKeyAndCoordType(
'7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.BD09LL); '7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.BD09LL);
} else if(Platform.isAndroid) { } else if(Platform.isAndroid) {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON);
} }
} }

7
lib/main_page.dart

@ -123,12 +123,7 @@ class _MainPage extends State<MainPage> {
BaseData baseDate = await ApiService(Dio(), BaseData baseDate = await ApiService(Dio(),
context: context, token: sharedPreferences.getString('token')) context: context, token: sharedPreferences.getString('token'))
.queryInfo(); .queryInfo();
sharedPreferences.setString('user', jsonEncode(baseDate.data));
SharedPreferences.getInstance().then(
(value) => {
value.setString('user', jsonEncode(baseDate.data)),
},
);
} }
requestPermission() async { requestPermission() async {

14
lib/order/store_selector_page.dart

@ -5,6 +5,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
@ -60,13 +61,16 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
} else { } else {
latLng = BMFCoordinate(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"], event["longitude"]);
} }
if (Navigator.of(context).canPop()) { BMFCalculateUtils.coordConvert(
Navigator.of(context).pop(); coordinate: latLng,
} fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL).then((value) {
this.latLng = value;
saveLatLng( saveLatLng(
latLng, event["province"], event["city"], event["district"]); value, event["province"], event["city"], event["district"]);
queryStore("${event["latitude"]}", "${event["longitude"]}", queryStore("${value.latitude}", "${value.longitude}",
event["province"], event["city"], event["district"]); event["province"], event["city"], event["district"]);
});
} }
}); });
} }

332
lib/union/union_page.dart

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

15
pubspec.lock

@ -35,7 +35,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.6.1" version: "2.5.0"
barcode: barcode:
dependency: transitive dependency: transitive
description: description:
@ -307,6 +307,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
flutter_bmflocation:
dependency: "direct main"
description:
name: flutter_bmflocation
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
flutter_cache_manager: flutter_cache_manager:
dependency: transitive dependency: transitive
description: description:
@ -886,7 +893,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.3.0" version: "0.2.19"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -1049,7 +1056,7 @@ packages:
name: win32 name: win32
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.5" version: "2.0.5"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@ -1072,5 +1079,5 @@ packages:
source: hosted source: hosted
version: "3.1.0" version: "3.1.0"
sdks: sdks:
dart: ">=2.13.0 <3.0.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0" flutter: ">=2.0.0"

2
pubspec.yaml

@ -45,7 +45,7 @@ dependencies:
permission_handler: ^5.0.1+1 permission_handler: ^5.0.1+1
# flutter_bmflocation: ^1.0.4 flutter_bmflocation: ^1.0.3
flutter_baidu_mapapi_base: ^2.0.1 flutter_baidu_mapapi_base: ^2.0.1
flutter_baidu_mapapi_map: ^2.0.1 flutter_baidu_mapapi_map: ^2.0.1
flutter_baidu_mapapi_search: ^2.0.1 flutter_baidu_mapapi_search: ^2.0.1

Loading…
Cancel
Save