From 595930067fee6712ba19bd30c62de7c8d443752b Mon Sep 17 00:00:00 2001 From: Kuloud Date: Fri, 29 Dec 2023 22:16:21 +0800 Subject: [PATCH] release: 1.0.1 --- .../interactive/map_gestures_options.dart | 1 - .../lib/pages/interactive/map_ui_options.dart | 1 - .../pages/interactive/move_camera_demo.dart | 1 - .../lib/pages/interactive/poi_click_demo.dart | 1 - .../lib/pages/interactive/snapshot_demo.dart | 1 - example/lib/pages/map/change_map_type.dart | 1 - example/lib/pages/map/custom_map_style.dart | 1 - example/lib/pages/map/limit_map_bounds.dart | 1 - example/lib/pages/map/map_all_config.dart | 3 --- example/lib/pages/map/map_my_location.dart | 1 - example/lib/pages/map/min_max_zoom.dart | 1 - example/lib/pages/map/show_map_page.dart | 1 - .../pages/overlays/marker_add_after_map.dart | 1 - .../pages/overlays/marker_add_with_map.dart | 1 - example/lib/pages/overlays/marker_config.dart | 1 - .../lib/pages/overlays/marker_custom_icon.dart | 1 - lib/src/amap_widget.dart | 18 ++---------------- pubspec.yaml | 2 +- 18 files changed, 3 insertions(+), 35 deletions(-) diff --git a/example/lib/pages/interactive/map_gestures_options.dart b/example/lib/pages/interactive/map_gestures_options.dart index e68e50f..45bd8ea 100644 --- a/example/lib/pages/interactive/map_gestures_options.dart +++ b/example/lib/pages/interactive/map_gestures_options.dart @@ -34,7 +34,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget map = AMapWidget( - apiKey: ConstConfig.amapApiKeys, rotateGesturesEnabled: _rotateGesturesEnabled, scrollGesturesEnabled: _scrollGesturesEnabled, tiltGesturesEnabled: _tiltGesturesEnabled, diff --git a/example/lib/pages/interactive/map_ui_options.dart b/example/lib/pages/interactive/map_ui_options.dart index c57f59c..28f7db6 100644 --- a/example/lib/pages/interactive/map_ui_options.dart +++ b/example/lib/pages/interactive/map_ui_options.dart @@ -38,7 +38,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget map = AMapWidget( - apiKey: ConstConfig.amapApiKeys, trafficEnabled: _trafficEnabled, buildingsEnabled: _buildingsEnabled, compassEnabled: _compassEnabled, diff --git a/example/lib/pages/interactive/move_camera_demo.dart b/example/lib/pages/interactive/move_camera_demo.dart index df6f419..a056afa 100644 --- a/example/lib/pages/interactive/move_camera_demo.dart +++ b/example/lib/pages/interactive/move_camera_demo.dart @@ -25,7 +25,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, onMapCreated: _onMapCreated, onCameraMove: _onCameraMove, onCameraMoveEnd: _onCameraMoveEnd, diff --git a/example/lib/pages/interactive/poi_click_demo.dart b/example/lib/pages/interactive/poi_click_demo.dart index 0e29a9c..aabca90 100644 --- a/example/lib/pages/interactive/poi_click_demo.dart +++ b/example/lib/pages/interactive/poi_click_demo.dart @@ -23,7 +23,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, touchPoiEnabled: true, onPoiTouched: _onPoiTouched, ); diff --git a/example/lib/pages/interactive/snapshot_demo.dart b/example/lib/pages/interactive/snapshot_demo.dart index 6a134a2..fece619 100644 --- a/example/lib/pages/interactive/snapshot_demo.dart +++ b/example/lib/pages/interactive/snapshot_demo.dart @@ -31,7 +31,6 @@ class _SnapShotState extends State<_SnapShotBody> { children: [ Expanded( child: AMapWidget( - apiKey: ConstConfig.amapApiKeys, onMapCreated: _onMapCreated, ), ), diff --git a/example/lib/pages/map/change_map_type.dart b/example/lib/pages/map/change_map_type.dart index 3cc83d6..943d4e0 100644 --- a/example/lib/pages/map/change_map_type.dart +++ b/example/lib/pages/map/change_map_type.dart @@ -38,7 +38,6 @@ class _PageBodyState extends State<_PageBody> { Widget build(BuildContext context) { //创建地图 final AMapWidget map = AMapWidget( - apiKey: ConstConfig.amapApiKeys, //地图类型属性 mapType: _mapType, ); diff --git a/example/lib/pages/map/custom_map_style.dart b/example/lib/pages/map/custom_map_style.dart index a118d5d..c514f87 100644 --- a/example/lib/pages/map/custom_map_style.dart +++ b/example/lib/pages/map/custom_map_style.dart @@ -48,7 +48,6 @@ class _CustomMapStyleState extends State<_CustomMapStyleBody> { @override Widget build(BuildContext context) { final AMapWidget map = AMapWidget( - apiKey: ConstConfig.amapApiKeys, onMapCreated: onMapCreated, customStyleOptions: _customStyleOptions, ); diff --git a/example/lib/pages/map/limit_map_bounds.dart b/example/lib/pages/map/limit_map_bounds.dart index 661307c..9dbe309 100644 --- a/example/lib/pages/map/limit_map_bounds.dart +++ b/example/lib/pages/map/limit_map_bounds.dart @@ -22,7 +22,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, limitBounds: LatLngBounds( southwest: LatLng(39.83309, 116.290176), northeast: LatLng(39.99951, 116.501663)), diff --git a/example/lib/pages/map/map_all_config.dart b/example/lib/pages/map/map_all_config.dart index eaf7150..61785d3 100644 --- a/example/lib/pages/map/map_all_config.dart +++ b/example/lib/pages/map/map_all_config.dart @@ -87,9 +87,6 @@ class _MapUiBodyState extends State<_MapUiBody> { @override Widget build(BuildContext context) { final AMapWidget map = AMapWidget( - ///必须正确设置的合规隐私声明,否则SDK不会工作,会造成地图白屏等问题。 - // privacyStatement: ConstConfig.amapPrivacyStatement, - // apiKey: ConstConfig.amapApiKeys, initialCameraPosition: _kInitialPosition, mapType: _mapType, trafficEnabled: _trafficEnabled, diff --git a/example/lib/pages/map/map_my_location.dart b/example/lib/pages/map/map_my_location.dart index f77b66d..f612c27 100644 --- a/example/lib/pages/map/map_my_location.dart +++ b/example/lib/pages/map/map_my_location.dart @@ -37,7 +37,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, myLocationStyleOptions: MyLocationStyleOptions( true, circleFillColor: Colors.lightBlue, diff --git a/example/lib/pages/map/min_max_zoom.dart b/example/lib/pages/map/min_max_zoom.dart index a2e4c36..423fd17 100644 --- a/example/lib/pages/map/min_max_zoom.dart +++ b/example/lib/pages/map/min_max_zoom.dart @@ -25,7 +25,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, onMapCreated: _onMapCreated, onCameraMove: _onCameraMove, onCameraMoveEnd: _onCameraMoveEnd, diff --git a/example/lib/pages/map/show_map_page.dart b/example/lib/pages/map/show_map_page.dart index cebd12c..3d884b8 100644 --- a/example/lib/pages/map/show_map_page.dart +++ b/example/lib/pages/map/show_map_page.dart @@ -22,7 +22,6 @@ class _ShowMapPageState extends State<_ShowMapPageBody> { @override Widget build(BuildContext context) { final AMapWidget map = AMapWidget( - apiKey: ConstConfig.amapApiKeys, onMapCreated: onMapCreated, ); diff --git a/example/lib/pages/overlays/marker_add_after_map.dart b/example/lib/pages/overlays/marker_add_after_map.dart index 778a981..e42767f 100644 --- a/example/lib/pages/overlays/marker_add_after_map.dart +++ b/example/lib/pages/overlays/marker_add_after_map.dart @@ -65,7 +65,6 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, // //创建地图时,给marker属性赋值一个空的set,否则后续无法添加marker markers: Set.of(_markers.values), ); diff --git a/example/lib/pages/overlays/marker_add_with_map.dart b/example/lib/pages/overlays/marker_add_with_map.dart index addbc02..ecfe310 100644 --- a/example/lib/pages/overlays/marker_add_with_map.dart +++ b/example/lib/pages/overlays/marker_add_with_map.dart @@ -32,7 +32,6 @@ class _BodyState extends State<_Body> { } final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, markers: Set.of(_initMarkerMap.values), ); return Container( diff --git a/example/lib/pages/overlays/marker_config.dart b/example/lib/pages/overlays/marker_config.dart index 38ef90b..56c551d 100644 --- a/example/lib/pages/overlays/marker_config.dart +++ b/example/lib/pages/overlays/marker_config.dart @@ -243,7 +243,6 @@ class _State extends State<_Body> { // _createMarkerImageFromBytes(context); final AMapWidget map = AMapWidget( - apiKey: ConstConfig.amapApiKeys, onMapCreated: _onMapCreated, markers: Set.of(_markers.values), ); diff --git a/example/lib/pages/overlays/marker_custom_icon.dart b/example/lib/pages/overlays/marker_custom_icon.dart index e112be4..b6563fa 100644 --- a/example/lib/pages/overlays/marker_custom_icon.dart +++ b/example/lib/pages/overlays/marker_custom_icon.dart @@ -75,7 +75,6 @@ class _BodyState extends State<_Body> { Widget build(BuildContext context) { _initMarker(context); final AMapWidget amap = AMapWidget( - apiKey: ConstConfig.amapApiKeys, markers: Set.of(_initMarkerMap.values), ); return Container( diff --git a/lib/src/amap_widget.dart b/lib/src/amap_widget.dart index 5cfeafc..038a689 100644 --- a/lib/src/amap_widget.dart +++ b/lib/src/amap_widget.dart @@ -4,10 +4,6 @@ typedef void MapCreatedCallback(AMapController controller); ///用于展示高德地图的Widget class AMapWidget extends StatefulWidget { - ///高德开放平台的key - @Deprecated('高德开放平台的key,请通过AMapInitializer初始化设置,将在1.0.1+移除') - final AMapApiKey? apiKey; - /// 初始化时的地图中心点 final CameraPosition initialCameraPosition; @@ -89,12 +85,6 @@ class AMapWidget extends StatefulWidget { ///需要应用到地图上的手势集合 final Set> gestureRecognizers; - ///高德合规声明配置 - /// - /// 高德SDK合规使用方案请参考:https://lbs.amap.com/news/sdkhgsy - @Deprecated('高德开放平台的key,请通过AMapInitializer初始化设置,将在1.0.1+移除') - final AMapPrivacyStatement? privacyStatement; - /// 创建一个展示高德地图的widget /// /// 在app首次启动时必须传入高德合规声明配置[privacyStatement],后续如果没有变化不需要重复设置 @@ -108,9 +98,6 @@ class AMapWidget extends StatefulWidget { /// [AssertionError] will be thrown if [initialCameraPosition] is null; const AMapWidget({ Key? key, - @Deprecated('高德开放平台的key,请通过AMapInitializer初始化设置,将在1.0.1+移除') - this.privacyStatement, - @Deprecated('高德开放平台的key,请通过AMapInitializer初始化设置,将在1.0.1+移除') this.apiKey, this.initialCameraPosition = const CameraPosition(target: LatLng(39.909187, 116.397451), zoom: 10), this.mapType = MapType.normal, @@ -157,9 +144,8 @@ class _MapState extends State { @override Widget build(BuildContext context) { final Map creationParams = { - 'privacyStatement': - widget.privacyStatement?.toMap() ?? AMapInitializer._privacyStatement, - 'apiKey': widget.apiKey?.toMap() ?? AMapInitializer._apiKey, + 'privacyStatement': AMapInitializer._privacyStatement?.toMap(), + 'apiKey': AMapInitializer._apiKey?.toMap(), 'initialCameraPosition': widget.initialCameraPosition.toMap(), 'options': _mapOptions.toMap(), 'markersToAdd': serializeOverlaySet(widget.markers), diff --git a/pubspec.yaml b/pubspec.yaml index 5d292c0..db2e87f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: amap_map description: Amap SDK Flutter plugin for integrating AMapSDK in iOS and Android applications. -version: 1.0.0+8 +version: 1.0.1 homepage: https://github.com/kuloud/amap_map issue_tracker: https://github.com/kuloud/amap_map/issues platforms: