Browse Source

Merge branch 'master' into dev

# Conflicts:
#	lib/union/union_page.dart
#	pubspec.yaml
null_safety
w-R 3 years ago
parent
commit
9f25e7275c
  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. 241
      lib/address/address_map_page.dart
  8. 2
      lib/main.dart
  9. 7
      lib/main_page.dart
  10. 18
      lib/order/store_selector_page.dart
  11. 45
      lib/union/union_page.dart
  12. 8
      pubspec.lock
  13. 3
      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/Utils (6.2.0):
- BaiduMapKit/Base
- BMKLocationKit (2.0.0)
- Flutter (1.0.0)
- flutter_baidu_mapapi_base (2.0.0):
- BaiduMapKit/Utils (= 6.2.0)
@ -22,6 +23,9 @@ PODS:
- BaiduMapKit/Utils (= 6.2.0)
- Flutter
- flutter_baidu_mapapi_base
- flutter_bmflocation (1.0.3):
- BMKLocationKit
- Flutter
- fluwx (0.0.1):
- Flutter
- 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_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`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
@ -116,6 +121,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- BaiduMapKit
- BMKLocationKit
- FMDB
- mob_sharesdk
- MOBFoundation
@ -134,6 +140,8 @@ EXTERNAL SOURCES:
: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"
image_cropper:
@ -165,11 +173,13 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8
BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db
flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16
flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d
flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a
flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb

18
ios/Runner.xcodeproj/project.pbxproj

@ -7,6 +7,7 @@
objects = {
/* 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 */; };
05C5426F26BBE8FE00D26AC2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F373269581F600237A5E /* CoreLocation.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 */; };
89AEFA9326A69A3600DD2817 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA9226A69A3600DD2817 /* Security.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 */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@ -90,6 +91,7 @@
/* End PBXCopyFilesBuildPhase 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; };
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; };
@ -211,7 +213,7 @@
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>"; };
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>"; };
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>"; };
@ -591,7 +593,7 @@
6EE8F2E42695813500237A5E /* UniMPSDK */,
6EE8F2E32695806400237A5E /* Class */,
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@ -600,6 +602,7 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
05C5427726BCFCBB00D26AC2 /* Runner-Bridging-Header.h */,
0558860226BD10CA00FB1CFE /* test.swift */,
);
path = Runner;
sourceTree = "<group>";
@ -769,9 +772,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
978B8F6F1D3862AE00F588F7 /* AppDelegate.mm in Sources */,
6EE8F37F269582C200237A5E /* UniappPlugin.m in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */,
0558860326BD10CA00FB1CFE /* test.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -878,7 +882,7 @@
"$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"",
@ -1104,7 +1108,7 @@
"$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"",
@ -1223,7 +1227,7 @@
"$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_INPUT_FILETYPE = automatic;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${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 {
}

241
lib/address/address_map_page.dart

@ -9,7 +9,11 @@ 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_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/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:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart';
@ -27,7 +31,6 @@ class AddressMapPage extends StatefulWidget {
}
class _AddressMapPage extends State<AddressMapPage> {
//
void _loadCustomData() async {
setState(() {
@ -57,7 +60,6 @@ class _AddressMapPage extends State<AddressMapPage> {
});
if (aMapFlutterLocation == null) {
aMapFlutterLocation = LocationFlutterPlugin();
aMapFlutterLocation.onResultCallback().listen((event) {
print("event: ${jsonEncode(event)}");
@ -72,72 +74,113 @@ class _AddressMapPage extends State<AddressMapPage> {
} else {
latLng = BMFCoordinate(event["latitude"], event["longitude"]);
}
saveLatLng(latLng);
if (_mapController != null)
_mapController.updateMapOptions(
BMFMapOptions(
center: latLng,
zoomLevel: 15,
),
);
searchPoi(latLng);
BMFCalculateUtils.coordConvert(
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(
BMFMapOptions(
center: latLng,
zoomLevel: 15,
),
);
}
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();
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;
searchPoi(BMFCoordinate latLng) async {
keyWord = textEditingController.text;
var addressPoi = await apiService.searchPoi(
"${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1);
List<dynamic> poi = addressPoi['pois'];
poiList = poi
.map((e) => Address.fromJson({
"address": e["address"] is List ? "" : e["address"],
"area": e["adname"],
"city": e["cityname"],
"province": e["pname"],
"latitude": e["location"].toString().split(",")[0],
"longitude": e["location"].toString().split(",")[1],
"cityInfo": e["name"],
"id": "",
"mid": "",
"phone": "",
"tag": "",
"username": "",
"isDefault": true,
}))
.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
.map((e) => Address.fromJson({
"address": e.address,
"area": e.name,
"city": e.city,
"province": e.province,
"latitude": e.pt.latitude,
"longitude": e.pt.longitude,
"cityInfo": e.name,
"id": "",
"mid": "",
"phone": "",
"tag": "",
"username": "",
"isDefault": true,
}))
.toList();
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 {
if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
enableLocation();
@ -173,7 +216,7 @@ class _AddressMapPage extends State<AddressMapPage> {
S.of(context).nindingweigongnengweikaiqi,
S.of(context).weilexiangnintuijianfujindemendianxinxi,
S.of(context).dakaidingwei,
(result) async {
(result) async {
if (result) {
final AndroidIntent intent = AndroidIntent(
action: 'action_location_source_settings',
@ -197,7 +240,7 @@ class _AddressMapPage extends State<AddressMapPage> {
S.of(context).nindingweiquanxianweiyunxu,
S.of(context).weilexiangnintuijianfujindemendianxinxi,
S.of(context).kaiqiquanxian,
(result) async {
(result) async {
if (result) {
await openAppSettings();
if (await Permission.location.isGranted) {
@ -213,11 +256,47 @@ class _AddressMapPage extends State<AddressMapPage> {
BMFMapController _mapController;
void onMapCreated(BMFMapController controller) {
controller.setMapRegionDidChangeCallback(callback: (status) {
center = status.targetGeoPt;
searchPoi(center);
});
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}");
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 {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("latitude", "${latLng.latitude}");
@ -231,8 +310,9 @@ class _AddressMapPage extends State<AddressMapPage> {
_mapController.updateMapOptions(
BMFMapOptions(
center: BMFCoordinate(
double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))),
double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude")),
),
zoomLevel: 15,
),
);
@ -277,18 +357,18 @@ class _AddressMapPage extends State<AddressMapPage> {
// ].toSet(),
),
),
Center(
child: IgnorePointer(
child: Container(
margin: EdgeInsets.only(bottom: 44.h),
child: Image.asset(
"assets/image/icon_address_location.png",
width: 66.w,
height: 75.h,
),
),
),
),
// Center(
// child: IgnorePointer(
// child: Container(
// margin: EdgeInsets.only(bottom: 44.h),
// child: Image.asset(
// "assets/image/icon_address_location.png",
// width: 66.w,
// height: 75.h,
// ),
// ),
// ),
// ),
searchWidget(),
Positioned(
right: 17,
@ -372,7 +452,7 @@ class _AddressMapPage extends State<AddressMapPage> {
color: Color(0xFF4C4C4C),
fontSize: 14.sp,
),
)
),
],
),
);
@ -386,16 +466,17 @@ class _AddressMapPage extends State<AddressMapPage> {
margin: EdgeInsets.fromLTRB(16, 48, 16, 8),
padding: EdgeInsets.fromLTRB(10, 6, 16, 6),
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,
)
]),
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: Row(
mainAxisSize: MainAxisSize.max,
children: [

2
lib/main.dart

@ -121,7 +121,7 @@ initSdk() async {
BMFMapSDK.setApiKeyAndCoordType(
'7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.BD09LL);
} 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(),
context: context, token: sharedPreferences.getString('token'))
.queryInfo();
SharedPreferences.getInstance().then(
(value) => {
value.setString('user', jsonEncode(baseDate.data)),
},
);
sharedPreferences.setString('user', jsonEncode(baseDate.data));
}
requestPermission() async {

18
lib/order/store_selector_page.dart

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

45
lib/union/union_page.dart

@ -8,6 +8,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.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:huixiang/generated/l10n.dart';
@ -24,6 +25,7 @@ import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:typed_data';
import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
@ -37,7 +39,6 @@ class UnionPage extends StatefulWidget {
class _UnionPage extends State<UnionPage>
with AutomaticKeepAliveClientMixin, WidgetsBindingObserver {
//使true
//
void _loadCustomData() async {
@ -101,20 +102,26 @@ class _UnionPage extends State<UnionPage>
} else {
latLng = BMFCoordinate(event["latitude"], event["longitude"]);
}
saveLatLng(
latLng, event["province"], event["city"], event["district"]);
queryStore(
"${event["latitude"]}",
"${event["longitude"]}",
event["province"],
event["city"],
event["district"],
editingController.text);
if (_mapController != null)
_mapController.updateMapOptions(BMFMapOptions(
center: latLng,
zoomLevel: 15,
));
BMFCalculateUtils.coordConvert(
coordinate: latLng,
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL).then((value) {
this.latLng = value;
saveLatLng(
value, event["province"], event["city"], event["district"]);
queryStore(
"${value.latitude}",
"${value.longitude}",
event["province"],
event["city"],
event["district"],
editingController.text);
if (_mapController != null)
_mapController.updateMapOptions(BMFMapOptions(
center: value,
zoomLevel: 15,
));
});
}
});
@ -262,7 +269,7 @@ class _UnionPage extends State<UnionPage>
PreferredSize(
preferredSize: Size(double.infinity, 52.h),
child: Container(
padding: EdgeInsets.only(top: 6.h),
padding: EdgeInsets.only(top: 26.5.h),
color: Color(0xFFFAFAFA),
child: ItemTitle(
text: S.of(context).jingbilianmenghuiyuandian,
@ -658,10 +665,6 @@ class _UnionPage extends State<UnionPage>
),
],
),
// Expanded(
// child: Container(),
// flex: 1,
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
@ -732,4 +735,4 @@ class _UnionPage extends State<UnionPage>
@override
bool get wantKeepAlive => true;
}
}

8
pubspec.lock

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

3
pubspec.yaml

@ -45,8 +45,7 @@ dependencies:
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_map: ^2.0.1
flutter_baidu_mapapi_search: ^2.0.1

Loading…
Cancel
Save