From ddb820f8d21eed0bee584ce9f227f9b7f3cff660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=93=88=E5=93=88=E5=93=88?= Date: Fri, 6 Aug 2021 18:57:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/icon_map_marker.png | Bin 4055 -> 5637 bytes assets/image/icon_map_marker.png | Bin 1871 -> 5637 bytes ios/Podfile.lock | 10 + ios/Runner.xcodeproj/project.pbxproj | 18 +- ios/Runner/{AppDelegate.m => AppDelegate.mm} | 0 ios/Runner/test.swift | 12 + lib/address/address_map_page.dart | 241 ++++++++---- lib/main.dart | 2 +- lib/main_page.dart | 7 +- lib/order/store_selector_page.dart | 18 +- lib/union/union_page.dart | 364 +++++++++---------- pubspec.lock | 15 +- pubspec.yaml | 2 +- 13 files changed, 389 insertions(+), 300 deletions(-) rename ios/Runner/{AppDelegate.m => AppDelegate.mm} (100%) create mode 100644 ios/Runner/test.swift diff --git a/assets/image/2x/icon_map_marker.png b/assets/image/2x/icon_map_marker.png index ab786207d9add6f540fb819993fae0695a9fb4da..01d2531993fc06d88e4b7770a78c8fb75f845f95 100644 GIT binary patch literal 5637 zcma)AML-k`uwGn{W)Y;jQIT4@ySqa=m+tPCF6r)OX;=hQ8tLxtMoMaV{+IWz@9@p{ z&CGY0xy)g{swhcgq7kD3002x`840z2?D8K_-u{aTYvKO?2*FiNS`1J(PI~k&k+9H_ zwNz9DeEg?T00@x~0OEg^e<1z`003Bk0091Dg#T&M3z;l$9 z5Y_NPI5R-^!kcR`^xfax-OWuzrozTqH+~;ZD^U7ad8>-oLapijMMbr~wzcKH=)?T$rQWV{^L8y9Ot?Q2r3T3MFFB*Ylks$1$>zo`g_}(a#;U3#1+0}Ai zAo=3-VkL8UG@zynzGPe9a+k#`(eQppBo@eq)yISV{}9G$z+ZO2q$;E5r>C9M#^j=5 zxvG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Hm0#!B=3b6D}R zjJ}MQ{Iu>ltOSfU*5a~L6Y*&&dc7_5#-e8jCOl}sN+}{VY;j<;GG1V$Hwo)gSQD_4 zbqrkuVi0Q=R*K4YtWg(3S=0+n3&=8Vtn{Tq&t(EOE*Fx5|8@BnVq%F { - //加载自定义地图样式 void _loadCustomData() async { setState(() { @@ -57,7 +60,6 @@ class _AddressMapPage extends State { }); if (aMapFlutterLocation == null) { - aMapFlutterLocation = LocationFlutterPlugin(); aMapFlutterLocation.onResultCallback().listen((event) { print("event: ${jsonEncode(event)}"); @@ -72,72 +74,113 @@ class _AddressMapPage extends State { } 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
poiList; searchPoi(BMFCoordinate latLng) async { keyWord = textEditingController.text; - var addressPoi = await apiService.searchPoi( - "${latLng.latitude}", "${latLng.longitude}", keyWord, 20, 1); - List 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 { 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 { 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 { 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 { _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 { // ].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 { color: Color(0xFF4C4C4C), fontSize: 14.sp, ), - ) + ), ], ), ); @@ -386,16 +466,17 @@ class _AddressMapPage extends State { 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: [ diff --git a/lib/main.dart b/lib/main.dart index 091f68a7..ebed8b0e 100644 --- a/lib/main.dart +++ b/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); } } diff --git a/lib/main_page.dart b/lib/main_page.dart index 096369a2..9c783691 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -123,12 +123,7 @@ class _MainPage extends State { 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 { diff --git a/lib/order/store_selector_page.dart b/lib/order/store_selector_page.dart index 1b706de7..3dd8027f 100644 --- a/lib/order/store_selector_page.dart +++ b/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 { } 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"]); + }); } }); } diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 586b1c7c..f600d5aa 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -1,15 +1,15 @@ import 'dart:io'; 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:dio/dio.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; 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'; 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/icon_text.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:permission_handler/permission_handler.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 'package:flutter/rendering.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; class UnionPage extends StatefulWidget { @override @@ -40,28 +39,15 @@ class UnionPage extends StatefulWidget { class _UnionPage extends State with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { - //默认设置为不使用自定义地图,如果需要直接显示,在初始化是设置为true - CustomStyleOptions _customStyleOptions = CustomStyleOptions(false); //加载自定义地图样式 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(() { - _customStyleOptions.enabled = true; + _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); }); } - AMapFlutterLocation aMapFlutterLocation; + LocationFlutterPlugin aMapFlutterLocation; RefreshController refreshController = RefreshController(initialRefresh: false); @@ -70,7 +56,6 @@ class _UnionPage extends State super.dispose(); WidgetsBinding.instance.removeObserver(this); aMapFlutterLocation.stopLocation(); - aMapFlutterLocation.destroy(); refreshController.dispose(); } @@ -105,36 +90,38 @@ class _UnionPage extends State WidgetsBinding.instance.addObserver(this); if (aMapFlutterLocation == null) { - AMapFlutterLocation.setApiKey("f39d1daa020a56f208eb2519f63e9534", - "feaae7986201b571cace1b83728be5bb"); - aMapFlutterLocation = AMapFlutterLocation(); - aMapFlutterLocation.onLocationChanged().listen((event) { + aMapFlutterLocation = LocationFlutterPlugin(); + aMapFlutterLocation.onResultCallback().listen((event) { if (event != null && event["latitude"] != null && event["longitude"] != null) { print("location: $event"); 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"])); } else { - latLng = LatLng(event["latitude"], event["longitude"]); + 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.moveCamera( - CameraUpdate.newCameraPosition(CameraPosition( - target: latLng, - zoom: 15.0, - )), - ); + 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, + )); + }); } }); @@ -146,15 +133,25 @@ class _UnionPage extends State }); } - aMapFlutterLocation.setLocationOption(AMapLocationOption( - needAddress: true, - onceLocation: true, - locationMode: AMapLocationMode.Hight_Accuracy, - desiredAccuracy: DesiredAccuracy.HundredMeters, - desiredLocationAccuracyAuthorizationMode: - AMapLocationAccuracyAuthorizationMode.FullAndReduceAccuracy, - pausesLocationUpdatesAutomatically: true, - )); + 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(); @@ -162,9 +159,9 @@ class _UnionPage extends State startLocation(); } - LatLng latLng; + BMFCoordinate latLng; - saveLatLng(LatLng latLng, province, city, district) async { + saveLatLng(BMFCoordinate latLng, province, city, district) async { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("longitude", "${latLng.longitude}"); @@ -186,7 +183,7 @@ class _UnionPage extends State value.containsKey("city") && value.containsKey("district")) { - latLng = LatLng(double.tryParse(value.getString("latitude")), + latLng = BMFCoordinate(double.tryParse(value.getString("latitude")), double.tryParse(value.getString("longitude"))), queryStore( value.getString("latitude"), @@ -198,14 +195,10 @@ class _UnionPage extends State ), setState(() { if (_mapController != null) { - _mapController.moveCamera( - CameraUpdate.newCameraPosition( - CameraPosition( - target: latLng, - zoom: 15.0, - ), - ), - ); + _mapController.updateMapOptions(BMFMapOptions( + center: latLng, + zoomLevel: 15, + )); } }) } @@ -235,7 +228,7 @@ class _UnionPage extends State storeList = (baseData.data as List) .map((e) => Store.fromJson(e)) .toList(); - buildMarker(); + // buildMarker(); refreshController.refreshCompleted(); if (mounted) setState(() {}); } else { @@ -243,34 +236,20 @@ class _UnionPage extends State } } - RepaintBoundary repaintBoundary; - - buildMarker() async { - markers.clear(); - - BitmapDescriptor bitmapDescriptor = await BitmapDescriptor.fromAssetImage( - ImageConfiguration( - bundle: DefaultAssetBundle.of(context), - devicePixelRatio: MediaQuery.of(context)?.devicePixelRatio ?? 1.0, - locale: Localizations.localeOf(context), - textDirection: Directionality.of(context), - size: Size(35.w, 35.h), - platform: defaultTargetPlatform, - ), - "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 markers = []; + // buildMarker() async { + // markers.clear(); + // markers.addAll(storeList.map((element) => BMFMarker( + // position: BMFCoordinate(double.tryParse(element.latitude), + // double.tryParse(element.longitude)), + // centerOffset: BMFPoint(0.5, 0.9), + // enabled: false, + // icon: "assets/image/icon_map_marker.png", + // draggable: false, + // ))); + // if (mounted) setState(() {}); + // } + // + // List markers = []; @override Widget build(BuildContext context) { @@ -306,24 +285,17 @@ class _UnionPage extends State // headerSliverBuilder: (context, inner) { // return [ // SliverOverlapAbsorber( - // sliver: buildSliverAppBar(AMapWidget( - // initialCameraPosition: CameraPosition( - // target: LatLng(30.553111, 114.342366), - // zoom: 12.0, + // sliver: buildSliverAppBar(BMFMapWidget( + // mapOptions: BMFMapOptions( + // center: BMFCoordinate(30.553111, 114.342366), + // zoomLevel: 12, // ), - // onMapCreated: onMapCreated, - // apiKey: aMapApiKeys, - // touchPoiEnabled: true, - // markers: markers.toSet(), - // scrollGesturesEnabled: true, - // customStyleOptions: _customStyleOptions, - // onPoiTouched: (poiTouch) { - // FocusScope.of(context).requestFocus(FocusNode()); - // }, - // gestureRecognizers: >[ - // Factory( - // () => EagerGestureRecognizer()), - // ].toSet(), + // onBMFMapCreated: onMapCreated, + // // customStyleOptions: _customStyleOptions, + // // gestureRecognizers: >[ + // // Factory( + // // () => EagerGestureRecognizer()), + // // ].toSet(), // )), // handle: // NestedScrollView.sliverOverlapAbsorberHandleFor(context), @@ -368,7 +340,7 @@ class _UnionPage extends State 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: 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(), itemBuilder: (context, position) { return GestureDetector( @@ -460,10 +432,10 @@ class _UnionPage extends State }); } - AMapController _mapController; + BMFMapController _mapController; TextEditingController editingController = TextEditingController(); - void onMapCreated(AMapController controller) { + void onMapCreated(BMFMapController controller) { _mapController = controller; } @@ -473,16 +445,17 @@ class _UnionPage extends State margin: EdgeInsets.fromLTRB(16.w, 40, 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, - ) - ]), + 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: () { @@ -513,81 +486,81 @@ class _UnionPage extends State ); } - 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( - 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 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) { 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), decoration: BoxDecoration( color: Colors.white, @@ -651,6 +624,9 @@ class _UnionPage extends State ), ], ), + SizedBox( + height: 4.h, + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/pubspec.lock b/pubspec.lock index 6dc89927..4ce17977 100644 --- a/pubspec.lock +++ b/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: @@ -307,6 +307,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted 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: dependency: transitive description: @@ -886,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: @@ -1049,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: @@ -1072,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" diff --git a/pubspec.yaml b/pubspec.yaml index 68b17f91..c9555a4c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,7 +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