From b4cc5f83fa33876221fbf8f55529aa5b878e2e96 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 15 Apr 2025 15:34:44 -0300 Subject: [PATCH 01/29] feat: camera control on web --- .../google_maps_flutter/CHANGELOG.md | 4 + .../example/lib/map_ui.dart | 70 +++++++++ .../lib/google_maps_flutter.dart | 1 + .../lib/src/google_map.dart | 14 ++ .../CHANGELOG.md | 4 + .../lib/src/types/map_configuration.dart | 30 ++++ .../lib/src/types/types.dart | 1 + .../types/web_camera_control_position.dart | 143 ++++++++++++++++++ .../google_maps_flutter_web/CHANGELOG.md | 5 + .../lib/src/convert.dart | 66 ++++++++ 10 files changed, 338 insertions(+) create mode 100644 packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index fba99c45dbf..e6403620707 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.12.2 + +* Adds support for camera control button on web. + ## 2.12.1 * Fixes typo in README. diff --git a/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart b/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart index 26c0b2ab720..b7b3ec6d3d8 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart @@ -61,6 +61,8 @@ class MapUiBodyState extends State { late GoogleMapController _controller; bool _nightMode = false; String _mapStyle = ''; + bool _webCameraControlEnabled = true; + WebCameraControlPosition? _webCameraControlPosition; @override void initState() { @@ -72,6 +74,67 @@ class MapUiBodyState extends State { super.dispose(); } + Widget _webCameraControlToggler() { + return TextButton( + child: Text( + '${_webCameraControlEnabled ? 'disable' : 'enable'} web camera control'), + onPressed: () { + setState(() { + _webCameraControlEnabled = !_webCameraControlEnabled; + }); + }, + ); + } + + Widget _webCameraControlPositionToggler() { + return TextButton( + onPressed: () => showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Web camera control position'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + DropdownButton( + hint: const Text('Web camera control position'), + value: _webCameraControlPosition, + items: WebCameraControlPosition.values + .map( + (WebCameraControlPosition e) => + DropdownMenuItem( + value: e, + child: Text(e.name), + ), + ) + .toList(), + onChanged: (WebCameraControlPosition? value) { + setState( + () { + _webCameraControlPosition = value; + }, + ); + }, + ), + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text( + 'Ok', + ), + ) + ], + ), + ); + }, + ), + child: const Text( + 'change web camera control position', + ), + ); + } + Widget _compassToggler() { return TextButton( child: Text('${_compassEnabled ? 'disable' : 'enable'} compass'), @@ -264,6 +327,8 @@ class MapUiBodyState extends State { @override Widget build(BuildContext context) { final GoogleMap googleMap = GoogleMap( + webCameraControlEnabled: _webCameraControlEnabled, + webCameraControlPosition: _webCameraControlPosition, onMapCreated: onMapCreated, initialCameraPosition: _kInitialPosition, compassEnabled: _compassEnabled, @@ -324,6 +389,11 @@ class MapUiBodyState extends State { _myLocationButtonToggler(), _myTrafficToggler(), _nightModeToggler(), + if (kIsWeb) ...[ + _webCameraControlToggler(), + if (_webCameraControlEnabled) + _webCameraControlPositionToggler(), + ] ], ), ), diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart b/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart index d24f6f0995f..4fc90e25e0b 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/google_maps_flutter.dart @@ -56,6 +56,7 @@ export 'package:google_maps_flutter_platform_interface/google_maps_flutter_platf TileOverlay, TileOverlayId, TileProvider, + WebCameraControlPosition, WebGestureHandling, WeightedLatLng; diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart index 76bcad6e26c..4841a6197f4 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart @@ -95,6 +95,8 @@ class GoogleMap extends StatefulWidget { this.onMapCreated, this.gestureRecognizers = const >{}, this.webGestureHandling, + this.webCameraControlPosition, + this.webCameraControlEnabled = true, this.compassEnabled = true, this.mapToolbarEnabled = true, this.cameraTargetBounds = CameraTargetBounds.unbounded, @@ -349,6 +351,16 @@ class GoogleMap extends StatefulWidget { /// See [WebGestureHandling] for more details. final WebGestureHandling? webGestureHandling; + /// This setting controls how the API handles cameraControl button position on the map. Web only. + /// + /// See [WebCameraControlPosition] for more details. + final WebCameraControlPosition? webCameraControlPosition; + + /// This setting controls how the API handles cameraControl button on the map. Web only. + /// + /// See https://developers.google.com/maps/documentation/javascript/controls for more details. + final bool webCameraControlEnabled; + /// Identifier that's associated with a specific cloud-based map style. /// /// See https://developers.google.com/maps/documentation/get-map-id @@ -652,6 +664,8 @@ class _GoogleMapState extends State { /// Builds a [MapConfiguration] from the given [map]. MapConfiguration _configurationFromMapWidget(GoogleMap map) { return MapConfiguration( + webCameraControlPosition: map.webCameraControlPosition, + webCameraControlEnabled: map.webCameraControlEnabled, webGestureHandling: map.webGestureHandling, compassEnabled: map.compassEnabled, mapToolbarEnabled: map.mapToolbarEnabled, diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 1c723af8f61..4446dcb9abf 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.11.2 + +* Adds support to camera control button on web. + ## 2.11.1 * Updates READMEs and API docs. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart index 6abd6c641e8..79ab513df85 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart @@ -15,6 +15,8 @@ class MapConfiguration { /// as either a full configuration selection, or an update to an existing /// configuration where only non-null values are updated. const MapConfiguration({ + this.webCameraControlPosition, + this.webCameraControlEnabled, this.webGestureHandling, this.compassEnabled, this.mapToolbarEnabled, @@ -44,6 +46,16 @@ class MapConfiguration { /// See [WebGestureHandling] for more details. final WebGestureHandling? webGestureHandling; + /// This setting controls how the API handles cameraControl button position on the map. Web only. + /// + /// See [WebCameraControlPosition] for more details. + final WebCameraControlPosition? webCameraControlPosition; + + /// This setting controls how the API handles cameraControl button on the map. Web only. + /// + /// See https://developers.google.com/maps/documentation/javascript/controls for more details. + final bool? webCameraControlEnabled; + /// True if the compass UI should be shown. final bool? compassEnabled; @@ -123,6 +135,14 @@ class MapConfiguration { /// that are different from [other]. MapConfiguration diffFrom(MapConfiguration other) { return MapConfiguration( + webCameraControlPosition: + webCameraControlPosition != other.webCameraControlPosition + ? webCameraControlPosition + : null, + webCameraControlEnabled: + webCameraControlEnabled != other.webCameraControlEnabled + ? webCameraControlEnabled + : null, webGestureHandling: webGestureHandling != other.webGestureHandling ? webGestureHandling : null, @@ -188,6 +208,10 @@ class MapConfiguration { /// replacing the previous values. MapConfiguration applyDiff(MapConfiguration diff) { return MapConfiguration( + webCameraControlPosition: + diff.webCameraControlPosition ?? webCameraControlPosition, + webCameraControlEnabled: + diff.webCameraControlEnabled ?? webCameraControlEnabled, webGestureHandling: diff.webGestureHandling ?? webGestureHandling, compassEnabled: diff.compassEnabled ?? compassEnabled, mapToolbarEnabled: diff.mapToolbarEnabled ?? mapToolbarEnabled, @@ -219,6 +243,8 @@ class MapConfiguration { /// True if no options are set. bool get isEmpty => + webCameraControlPosition == null && + webCameraControlEnabled == null && webGestureHandling == null && compassEnabled == null && mapToolbarEnabled == null && @@ -251,6 +277,8 @@ class MapConfiguration { return false; } return other is MapConfiguration && + webCameraControlPosition == other.webCameraControlPosition && + webCameraControlEnabled == other.webCameraControlEnabled && webGestureHandling == other.webGestureHandling && compassEnabled == other.compassEnabled && mapToolbarEnabled == other.mapToolbarEnabled && @@ -278,6 +306,8 @@ class MapConfiguration { @override int get hashCode => Object.hashAll([ webGestureHandling, + webCameraControlPosition, + webCameraControlEnabled, compassEnabled, mapToolbarEnabled, cameraTargetBounds, diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart index 95c27d5bf95..effbeb825ab 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart @@ -44,4 +44,5 @@ export 'utils/marker.dart'; export 'utils/polygon.dart'; export 'utils/polyline.dart'; export 'utils/tile_overlay.dart'; +export 'web_camera_control_position.dart'; export 'web_gesture_handling.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart new file mode 100644 index 00000000000..2f16bc8a632 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart @@ -0,0 +1,143 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Identifiers used to specify the placement of controls on the map. +// Controls are positioned relative to other controls in the same layout position. +// Controls that are added first are positioned closer to the edge of the map. +// Usage of "logical values" +// (see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values) +// is recommended in order to be able to automatically support both +// left-to-right (LTR) and right-to-left (RTL) layout contexts. + +/* +Logical values in LTR: + ++----------------+ +| BSIS BSIC BSIE | +| ISBS IEBS | +| | +| ISBC IEBC | +| | +| ISBE IEBE | +| BEIS BEIC BEIE | ++----------------+ + +Logical values in RTL: + ++----------------+ +| BSIE BSIC BSIS | +| IEBS ISBS | +| | +| IEBC ISBC | +| | +| IEBE ISBE | +| BEIE BEIC BEIS | ++----------------+ + +Legacy values: + ++----------------+ +| TL TC TR | +| LT RT | +| | +| LC RC | +| | +| LB RB | +| BL BC BR | ++----------------+ +*/ + +// Elements in the top or bottom row flow towards the middle of the row. +// Elements in the left or right column flow towards the middle of the column. + +/// This setting controls how the API handles camera control button on the map +/// See https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition for more details. +enum WebCameraControlPosition { + /// Equivalent to BOTTOM_CENTER in both LTR and RTL. + blockEndInlineCenter, + + /// Equivalent to BOTTOM_LEFT in LTR, or BOTTOM_RIGHT in RTL. + blockEndInlineStart, + + /// EEquivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. + blockEndInlineEnd, + + /// Equivalent to TOP_CENTER in both LTR and RTL. + blockStartInlineCenter, + + /// Equivalent to TOP_LEFT in LTR, or TOP_RIGHT in RTL. + blockStartInlineStart, + + /// Equivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. + blockStartInlineEnd, + + /// Elements are positioned in the center of the bottom row. + /// Consider using BLOCK_END_INLINE_CENTER instead. + bottomCenter, + + /// Elements are positioned in the bottom left and flow towards the middle. + /// Elements are positioned to the right of the Google logo. + /// Consider using BLOCK_END_INLINE_START instead. + bottomLeft, + + /// Elements are positioned in the bottom right and flow towards the middle. + /// Elements are positioned to the left of the copyrights. + /// Consider using BLOCK_END_INLINE_END instead. + bottomRight, + + /// Equivalent to RIGHT_CENTER in LTR, or LEFT_CENTER in RTL. + inlineEndBlockCenter, + + /// Equivalent to RIGHT_BOTTOM in LTR, or LEFT_BOTTOM in RTL. + inlineEndBlockEnd, + + /// Equivalent to RIGHT_TOP in LTR, or LEFT_TOP in RTL. + inlineEndBlockStart, + + /// Equivalent to LEFT_CENTER in LTR, or RIGHT_CENTER in RTL. + inlineStartBlockCenter, + + /// Equivalent to LEFT_BOTTOM in LTR, or RIGHT_BOTTOM in RTL. + + inlineStartBlockEnd, + + /// Equivalent to LEFT_TOP in LTR, or RIGHT_TOP in RTL. + inlineStartBlockStart, + + /// Elements are positioned on the left, above bottom-left elements, + /// and flow upwards. Consider using INLINE_START_BLOCK_END instead. + leftBottom, + + /// Elements are positioned in the center of the left side. + /// Consider using INLINE_START_BLOCK_CENTER instead. + leftCenter, + + /// Elements are positioned on the left, below top-left elements, + /// and flow downwards. Consider using INLINE_START_BLOCK_START instead. + leftTop, + + /// Elements are positioned on the right, above bottom-right elements, + /// and flow upwards. Consider using INLINE_END_BLOCK_END instead. + rightBottom, + + /// Elements are positioned in the center of the right side. + /// Consider using INLINE_END_BLOCK_CENTER instead. + rightCenter, + + /// Elements are positioned on the right, below top-right elements, + /// and flow downwards. Consider using INLINE_END_BLOCK_START instead. + rightTop, + + /// Elements are positioned in the center of the top row. + /// Consider using BLOCK_START_INLINE_CENTER instead. + topCenter, + + /// Elements are positioned in the top left and flow towards the middle. + /// Consider using BLOCK_START_INLINE_START instead. + topLeft, + + /// Elements are positioned in the top right and flow towards the middle. + /// Consider using BLOCK_START_INLINE_END instead. + topRight, +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index 0fe686f03cd..dc218f09899 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.13 + +* Adds support to camera control button. + + ## 0.5.12 * Adds support for ground overlay. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart index 0eeddbc8b84..c8d9a818a27 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -88,6 +88,16 @@ gmaps.MapOptions _configurationAndStyleToGmapsOptions( options.gestureHandling = WebGestureHandling.auto.name; } + if (configuration.webCameraControlEnabled != null) { + options.cameraControl = configuration.webCameraControlEnabled; + } + + if (configuration.webCameraControlPosition != null) { + options.cameraControlOptions = gmaps.CameraControlOptions( + position: _toControlPosition(configuration.webCameraControlPosition!), + ); + } + if (configuration.fortyFiveDegreeImageryEnabled != null) { options.rotateControl = configuration.fortyFiveDegreeImageryEnabled; } @@ -730,3 +740,59 @@ gmaps.LatLng _pixelToLatLng(gmaps.Map map, int x, int y) { return projection.fromPointToLatLng(point)!; } + +/// Converts a [WebCameraControlPosition] to [gmaps.ControlPosition]. +gmaps.ControlPosition _toControlPosition( + WebCameraControlPosition webCameraControlPosition, +) { + switch (webCameraControlPosition) { + case WebCameraControlPosition.blockEndInlineCenter: + return gmaps.ControlPosition.BLOCK_END_INLINE_CENTER; + case WebCameraControlPosition.blockEndInlineEnd: + return gmaps.ControlPosition.BLOCK_END_INLINE_END; + case WebCameraControlPosition.blockEndInlineStart: + return gmaps.ControlPosition.BLOCK_END_INLINE_START; + case WebCameraControlPosition.blockStartInlineCenter: + return gmaps.ControlPosition.BLOCK_START_INLINE_CENTER; + case WebCameraControlPosition.blockStartInlineEnd: + return gmaps.ControlPosition.BLOCK_START_INLINE_END; + case WebCameraControlPosition.blockStartInlineStart: + return gmaps.ControlPosition.BLOCK_START_INLINE_START; + case WebCameraControlPosition.bottomCenter: + return gmaps.ControlPosition.BOTTOM_CENTER; + case WebCameraControlPosition.bottomLeft: + return gmaps.ControlPosition.BOTTOM_LEFT; + case WebCameraControlPosition.bottomRight: + return gmaps.ControlPosition.BOTTOM_RIGHT; + case WebCameraControlPosition.inlineEndBlockCenter: + return gmaps.ControlPosition.INLINE_END_BLOCK_CENTER; + case WebCameraControlPosition.inlineEndBlockEnd: + return gmaps.ControlPosition.INLINE_END_BLOCK_END; + case WebCameraControlPosition.inlineEndBlockStart: + return gmaps.ControlPosition.INLINE_END_BLOCK_START; + case WebCameraControlPosition.inlineStartBlockCenter: + return gmaps.ControlPosition.INLINE_START_BLOCK_CENTER; + case WebCameraControlPosition.inlineStartBlockEnd: + return gmaps.ControlPosition.INLINE_START_BLOCK_END; + case WebCameraControlPosition.inlineStartBlockStart: + return gmaps.ControlPosition.INLINE_START_BLOCK_START; + case WebCameraControlPosition.leftBottom: + return gmaps.ControlPosition.LEFT_BOTTOM; + case WebCameraControlPosition.leftCenter: + return gmaps.ControlPosition.LEFT_CENTER; + case WebCameraControlPosition.leftTop: + return gmaps.ControlPosition.LEFT_TOP; + case WebCameraControlPosition.rightBottom: + return gmaps.ControlPosition.RIGHT_BOTTOM; + case WebCameraControlPosition.rightCenter: + return gmaps.ControlPosition.RIGHT_CENTER; + case WebCameraControlPosition.rightTop: + return gmaps.ControlPosition.RIGHT_TOP; + case WebCameraControlPosition.topCenter: + return gmaps.ControlPosition.TOP_CENTER; + case WebCameraControlPosition.topLeft: + return gmaps.ControlPosition.TOP_LEFT; + case WebCameraControlPosition.topRight: + return gmaps.ControlPosition.TOP_RIGHT; + } +} From 9281be8c1e5097dfe21f2f0f6dcb30d1223a2eb4 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 15 Apr 2025 16:20:12 -0300 Subject: [PATCH 02/29] chore: update map_configuration_test.dart --- .../test/types/map_configuration_test.dart | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart index e34f32676e0..8e52b4b6082 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart @@ -12,6 +12,8 @@ void main() { group('diffs', () { // A options instance with every field set, to test diffs against. final MapConfiguration diffBase = MapConfiguration( + webCameraControlPosition: WebCameraControlPosition.topRight, + webCameraControlEnabled: false, webGestureHandling: WebGestureHandling.auto, compassEnabled: false, mapToolbarEnabled: false, @@ -59,6 +61,7 @@ void main() { expect(updated.padding, isNot(null)); expect(updated.trafficEnabled, isNot(null)); expect(updated.cloudMapId, null); + expect(updated.webCameraControlPosition, isNot(null)); }); test('handle webGestureHandling', () async { @@ -78,6 +81,42 @@ void main() { expect(empty.hashCode, isNot(diff.hashCode)); }); + test('handle webCameraControlPosition', () async { + const MapConfiguration diff = MapConfiguration( + webCameraControlPosition: WebCameraControlPosition.blockEndInlineEnd, + ); + + const MapConfiguration empty = MapConfiguration(); + final MapConfiguration updated = diffBase.applyDiff(diff); + + // A diff applied to empty options should be the diff itself. + expect(empty.applyDiff(diff), diff); + // The diff from empty options should be the diff itself. + expect(diff.diffFrom(empty), diff); + // A diff applied to non-empty options should update that field. + expect(updated.webCameraControlPosition, + WebCameraControlPosition.blockEndInlineEnd); + // The hash code should change. + expect(empty.hashCode, isNot(diff.hashCode)); + }); + + test('handle webCameraControlEnabled', () async { + const MapConfiguration diff = + MapConfiguration(webCameraControlEnabled: true); + + const MapConfiguration empty = MapConfiguration(); + final MapConfiguration updated = diffBase.applyDiff(diff); + + // A diff applied to empty options should be the diff itself. + expect(empty.applyDiff(diff), diff); + // The diff from empty options should be the diff itself. + expect(diff.diffFrom(empty), diff); + // A diff applied to non-empty options should update that field. + expect(updated.webCameraControlEnabled, true); + // The hash code should change. + expect(empty.hashCode, isNot(diff.hashCode)); + }); + test('handle compassEnabled', () async { const MapConfiguration diff = MapConfiguration(compassEnabled: true); @@ -435,6 +474,13 @@ void main() { expect(nullOptions.isEmpty, true); }); + test('is false with webCameraControlEnabled', () async { + const MapConfiguration diff = + MapConfiguration(webCameraControlEnabled: true); + + expect(diff.isEmpty, false); + }); + test('is false with compassEnabled', () async { const MapConfiguration diff = MapConfiguration(compassEnabled: true); From 25020bf6f84b6985f21fb99d94df0844c758b972 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 15 Apr 2025 16:20:55 -0300 Subject: [PATCH 03/29] chore: add dependecy_overrides --- .../google_maps_flutter/example/pubspec.yaml | 7 +++++++ .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 8 +++++++- .../google_maps_flutter_platform_interface/pubspec.yaml | 2 +- .../google_maps_flutter_web/pubspec.yaml | 8 +++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml index b686cbf766c..86cd2a9717f 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -21,6 +21,13 @@ dependencies: google_maps_flutter_android: ^2.16.0 google_maps_flutter_platform_interface: ^2.11.0 + +dependency_overrides: + google_maps_flutter_platform_interface: + path: ../../google_maps_flutter_platform_interface + google_maps_flutter_web: + path: ../../google_maps_flutter_web + dev_dependencies: build_runner: ^2.1.10 espresso: ^0.4.0 diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 9a23a1d5253..2c611c2f6e9 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.12.1 +version: 2.12.2 environment: sdk: ^3.6.0 @@ -26,6 +26,12 @@ dependencies: google_maps_flutter_platform_interface: ^2.11.0 google_maps_flutter_web: ^0.5.12 +dependency_overrides: + google_maps_flutter_platform_interface: + path: ../google_maps_flutter_platform_interface + google_maps_flutter_web: + path: ../google_maps_flutter_web + dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index 0c376f4400f..e632f1e1750 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.11.1 +version: 2.11.2 environment: sdk: ^3.4.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index de53daa7817..5eea7c471e7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 0.5.12 +version: 0.5.13 environment: sdk: ^3.4.0 @@ -28,6 +28,12 @@ dependencies: stream_transform: ^2.0.0 web: ">=0.5.1 <2.0.0" +dependency_overrides: + google_maps_flutter_platform_interface: + path: ../google_maps_flutter_platform_interface + + + dev_dependencies: flutter_test: sdk: flutter From b2d1d89602adf87b30e79499a82b12bc0ab2cfc6 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Mon, 21 Apr 2025 15:53:53 -0300 Subject: [PATCH 04/29] chore(step-1): make-deps-path-based --- .../google_maps_flutter/example/pubspec.yaml | 10 +++++----- .../google_maps_flutter/pubspec.yaml | 10 +++++----- .../google_maps_flutter_android/example/pubspec.yaml | 4 ++++ .../google_maps_flutter_android/pubspec.yaml | 4 ++++ .../google_maps_flutter_ios/example/ios14/pubspec.yaml | 4 ++++ .../google_maps_flutter_ios/example/ios15/pubspec.yaml | 4 ++++ .../example/shared/maps_example_dart/pubspec.yaml | 4 ++++ .../google_maps_flutter_ios/pubspec.yaml | 4 ++++ .../google_maps_flutter_web/example/pubspec.yaml | 9 ++++----- .../google_maps_flutter_web/pubspec.yaml | 5 +++-- 10 files changed, 41 insertions(+), 17 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml index 86cd2a9717f..a294973621b 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -22,11 +22,11 @@ dependencies: google_maps_flutter_platform_interface: ^2.11.0 -dependency_overrides: - google_maps_flutter_platform_interface: - path: ../../google_maps_flutter_platform_interface - google_maps_flutter_web: - path: ../../google_maps_flutter_web +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + google_maps_flutter_web: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_web} dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 2c611c2f6e9..a3cf30c2b85 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -26,11 +26,11 @@ dependencies: google_maps_flutter_platform_interface: ^2.11.0 google_maps_flutter_web: ^0.5.12 -dependency_overrides: - google_maps_flutter_platform_interface: - path: ../google_maps_flutter_platform_interface - google_maps_flutter_web: - path: ../google_maps_flutter_web +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + google_maps_flutter_web: {path: ../../../packages/google_maps_flutter/google_maps_flutter_web} dev_dependencies: flutter_test: diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index 4acca270819..6474773e083 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -33,3 +33,7 @@ flutter: uses-material-design: true assets: - assets/ +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 84779722eb1..2b836ab5576 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -37,3 +37,7 @@ topics: - google-maps - google-maps-flutter - map +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml index 947a78b4241..856ec01cb77 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml @@ -32,3 +32,7 @@ flutter: uses-material-design: true assets: - assets/ +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml index 947a78b4241..856ec01cb77 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml @@ -32,3 +32,7 @@ flutter: uses-material-design: true assets: - assets/ +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml index 071506ac425..202348d7ca4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml @@ -27,3 +27,7 @@ dev_dependencies: flutter: uses-material-design: true +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index 55c040865da..8b3bc5d8f5c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -35,3 +35,7 @@ topics: - google-maps - google-maps-flutter - map +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index a61f8043548..2f3724e441d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -28,9 +28,8 @@ flutter: assets: - assets/ +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins dependency_overrides: - # Override the google_maps_flutter dependency on google_maps_flutter_web. - # TODO(ditman): Unwind the circular dependency. This will create problems - # if we need to make a breaking change to google_maps_flutter_web. - google_maps_flutter_web: - path: ../ + google_maps_flutter_platform_interface: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + google_maps_flutter_web: {path: ../} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index 5eea7c471e7..e123d4933e6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -28,9 +28,10 @@ dependencies: stream_transform: ^2.0.0 web: ">=0.5.1 <2.0.0" +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins dependency_overrides: - google_maps_flutter_platform_interface: - path: ../google_maps_flutter_platform_interface + google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} From a5a5ff597177cbbf3343b8ea9a9e04d15b4e9d19 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Mon, 21 Apr 2025 16:14:00 -0300 Subject: [PATCH 05/29] chore(changelog): merge with upstream --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 2b86f43de2e..038c564c099 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,10 +1,10 @@ ## NEXT -* Adds support for camera control button on web. +* Updates README to indicate that Andoid SDK <21 is no longer supported. -## NEXT +## 2.12.2 -* Updates README to indicate that Andoid SDK <21 is no longer supported. +* Adds support for camera control button on web. ## 2.12.1 From a674307a7bbba01c6a18fa440e1d132fa845af03 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 19:43:53 -0300 Subject: [PATCH 06/29] chore: fix minor --- packages/google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 0690d9fbae3..838eb648d51 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.13.3 +version: 2.13.0 environment: sdk: ^3.6.0 From 67f8332023f10bd02bd30bf202ab769c4c31cc48 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 19:47:36 -0300 Subject: [PATCH 07/29] chore: improve webCameraControlEnabled description --- .../google_maps_flutter/lib/src/google_map.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart index 4841a6197f4..318995f1b8f 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart @@ -356,7 +356,7 @@ class GoogleMap extends StatefulWidget { /// See [WebCameraControlPosition] for more details. final WebCameraControlPosition? webCameraControlPosition; - /// This setting controls how the API handles cameraControl button on the map. Web only. + /// Enables or disables the Camera controls. Web only. /// /// See https://developers.google.com/maps/documentation/javascript/controls for more details. final bool webCameraControlEnabled; From 89fc4c47e1d70da79f68beb6b4191dcc0b1f055f Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 19:51:56 -0300 Subject: [PATCH 08/29] chore: add doc for WebCameraControlPosition? when is null --- .../google_maps_flutter/lib/src/google_map.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart index 318995f1b8f..1bc2333dc63 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart @@ -353,6 +353,8 @@ class GoogleMap extends StatefulWidget { /// This setting controls how the API handles cameraControl button position on the map. Web only. /// + /// If null, the Google Maps API will use its default camera control position. + /// /// See [WebCameraControlPosition] for more details. final WebCameraControlPosition? webCameraControlPosition; From 34bdf2c08de3c29a81b504698e7767f2c35378d9 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 19:59:49 -0300 Subject: [PATCH 09/29] chore: update changelog --- .../google_maps_flutter_platform_interface/CHANGELOG.md | 3 ++- .../lib/src/types/map_configuration.dart | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 209ef96e45a..ceaeb8d8e22 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.13.0 -* Adds support to camera control button on web. +* Adds support for disabling or moving the camera control button on web. + ## 2.12.1 * Fixes the `zIndex` issue in the `copyWith` method. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart index 79ab513df85..b694690071f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart @@ -48,6 +48,8 @@ class MapConfiguration { /// This setting controls how the API handles cameraControl button position on the map. Web only. /// + /// If null, the Google Maps API will use its default camera control position. + /// /// See [WebCameraControlPosition] for more details. final WebCameraControlPosition? webCameraControlPosition; From ce994aead8dbd0e1fa6d914ef915db4b5b01c23e Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 20:12:25 -0300 Subject: [PATCH 10/29] chore: remove duplicated doc --- .../types/web_camera_control_position.dart | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart index 2f16bc8a632..067a36eadb3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart @@ -10,44 +10,6 @@ // is recommended in order to be able to automatically support both // left-to-right (LTR) and right-to-left (RTL) layout contexts. -/* -Logical values in LTR: - -+----------------+ -| BSIS BSIC BSIE | -| ISBS IEBS | -| | -| ISBC IEBC | -| | -| ISBE IEBE | -| BEIS BEIC BEIE | -+----------------+ - -Logical values in RTL: - -+----------------+ -| BSIE BSIC BSIS | -| IEBS ISBS | -| | -| IEBC ISBC | -| | -| IEBE ISBE | -| BEIE BEIC BEIS | -+----------------+ - -Legacy values: - -+----------------+ -| TL TC TR | -| LT RT | -| | -| LC RC | -| | -| LB RB | -| BL BC BR | -+----------------+ -*/ - // Elements in the top or bottom row flow towards the middle of the row. // Elements in the left or right column flow towards the middle of the column. From 1e1e19f598372dec6e05a798b62b351ecb5986b0 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 20:21:13 -0300 Subject: [PATCH 11/29] fix: google_maps_flutter changelog --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index bf4483d94d5..c311fcd4e6a 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.13.0 + +* Adds support for camera control button on web. + ## 2.12.3 * Updates the example app to use the zIndexInt param instead of the deprecated zIndex. @@ -7,10 +11,6 @@ * Fixes memory leak by disposing stream subscriptions in `GoogleMapController`. * Updates README to indicate that Andoid SDK <21 is no longer supported. -## 2.12.2 - -* Adds support for camera control button on web. - ## 2.12.1 * Fixes typo in README. From c10458342f18c7a91a5abb0a2af618a5e3cdb812 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 6 Aug 2025 20:28:34 -0300 Subject: [PATCH 12/29] chore: remove overrides --- .../google_maps_flutter_android/example/pubspec.yaml | 6 +----- .../google_maps_flutter_android/pubspec.yaml | 6 +----- .../google_maps_flutter_ios/example/ios14/pubspec.yaml | 6 +----- .../google_maps_flutter_ios/example/ios15/pubspec.yaml | 6 +----- .../example/shared/maps_example_dart/pubspec.yaml | 4 ---- .../google_maps_flutter_ios/pubspec.yaml | 4 ---- 6 files changed, 4 insertions(+), 28 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index 473e6ac9148..902adf4218d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -32,8 +32,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/ -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + - assets/ \ No newline at end of file diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 7ddd6f57eb1..356d9602760 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -36,8 +36,4 @@ dev_dependencies: topics: - google-maps - google-maps-flutter - - map -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + - map \ No newline at end of file diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml index fdf5b9756f4..90d1c49549b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml @@ -31,8 +31,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/ -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + - assets/ \ No newline at end of file diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml index fdf5b9756f4..90d1c49549b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml @@ -31,8 +31,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/ -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} + - assets/ \ No newline at end of file diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml index 670c324ded1..d1404b7077b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml @@ -27,7 +27,3 @@ dev_dependencies: flutter: uses-material-design: true -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index c62078560c9..334bd86c020 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -35,7 +35,3 @@ topics: - google-maps - google-maps-flutter - map -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} From 48769d3d7e62351fbbf8edcbe0bfd5a612b9382b Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 11:38:46 -0300 Subject: [PATCH 13/29] chore: update google_maps_flutter_web version --- .../lib/src/convert.dart | 155 ++++++++---------- .../google_maps_flutter_web/pubspec.yaml | 2 +- 2 files changed, 72 insertions(+), 85 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart index db25752ade1..dfc3f767fd5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -174,32 +174,28 @@ List _mapStyles(String? mapStyleJson) { List styles = []; if (mapStyleJson != null) { try { - styles = - (json.decode( - mapStyleJson, - reviver: (Object? key, Object? value) { - if (value is Map && - _isJsonMapStyle(value as Map)) { - List stylers = []; - if (value['stylers'] != null) { - stylers = - (value['stylers']! as List) - .whereType>() - .map(MapStyler.fromJson) - .toList(); - } - return gmaps.MapTypeStyle() - ..elementType = value['elementType'] as String? - ..featureType = value['featureType'] as String? - ..stylers = stylers; - } - return value; - }, - ) - as List) - .where((Object? element) => element != null) - .cast() - .toList(); + styles = (json.decode( + mapStyleJson, + reviver: (Object? key, Object? value) { + if (value is Map && _isJsonMapStyle(value as Map)) { + List stylers = []; + if (value['stylers'] != null) { + stylers = (value['stylers']! as List) + .whereType>() + .map(MapStyler.fromJson) + .toList(); + } + return gmaps.MapTypeStyle() + ..elementType = value['elementType'] as String? + ..featureType = value['featureType'] as String? + ..stylers = stylers; + } + return value; + }, + ) as List) + .where((Object? element) => element != null) + .cast() + .toList(); // .toList calls are required so the JS API understands the underlying data structure. } on FormatException catch (e) { throw MapStyleException(e.message); @@ -259,9 +255,8 @@ gmaps.InfoWindowOptions? _infoWindowOptionsFromMarker(Marker marker) { // Add an outer wrapper to the contents of the infowindow, we need it to listen // to click events... - final HTMLElement container = - createDivElement() - ..id = 'gmaps-marker-${marker.markerId.value}-infowindow'; + final HTMLElement container = createDivElement() + ..id = 'gmaps-marker-${marker.markerId.value}-infowindow'; if (markerTitle.isNotEmpty) { final HTMLHeadingElement title = @@ -271,8 +266,8 @@ gmaps.InfoWindowOptions? _infoWindowOptionsFromMarker(Marker marker) { container.appendChild(title); } if (markerSnippet.isNotEmpty) { - final HTMLElement snippet = - createDivElement()..className = 'infowindow-snippet'; + final HTMLElement snippet = createDivElement() + ..className = 'infowindow-snippet'; // Firefox and Safari don't support Trusted Types yet. // See https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory#browser_compatibility @@ -280,10 +275,9 @@ gmaps.InfoWindowOptions? _infoWindowOptionsFromMarker(Marker marker) { _gmapsTrustedTypePolicy ??= window.trustedTypes.createPolicy( 'google_maps_flutter_sanitize', TrustedTypePolicyOptions( - createHTML: - (String html) { - return sanitizeHtml(html).toJS; - }.toJS, + createHTML: (String html) { + return sanitizeHtml(html).toJS; + }.toJS, ), ); @@ -448,9 +442,8 @@ Future _gmIconFromBitmapDescriptor( assert(iconConfig.length >= 2); // iconConfig[2] contains the DPIs of the screen, but that information is // already encoded in the iconConfig[1] - icon = - gmaps.Icon() - ..url = ui_web.assetManager.getAssetUrl(iconConfig[1]! as String); + icon = gmaps.Icon() + ..url = ui_web.assetManager.getAssetUrl(iconConfig[1]! as String); final gmaps.Size? size = _gmSizeFromIconConfig(iconConfig, 3); if (size != null) { @@ -509,18 +502,17 @@ Future _markerOptionsFromMarker( } gmaps.CircleOptions _circleOptionsFromCircle(Circle circle) { - final gmaps.CircleOptions circleOptions = - gmaps.CircleOptions() - ..strokeColor = _getCssColor(circle.strokeColor) - ..strokeOpacity = _getCssOpacity(circle.strokeColor) - ..strokeWeight = circle.strokeWidth - ..fillColor = _getCssColor(circle.fillColor) - ..fillOpacity = _getCssOpacity(circle.fillColor) - ..center = gmaps.LatLng(circle.center.latitude, circle.center.longitude) - ..radius = circle.radius - ..visible = circle.visible - ..zIndex = circle.zIndex - ..clickable = circle.consumeTapEvents; + final gmaps.CircleOptions circleOptions = gmaps.CircleOptions() + ..strokeColor = _getCssColor(circle.strokeColor) + ..strokeOpacity = _getCssOpacity(circle.strokeColor) + ..strokeWeight = circle.strokeWidth + ..fillColor = _getCssColor(circle.fillColor) + ..fillOpacity = _getCssOpacity(circle.fillColor) + ..center = gmaps.LatLng(circle.center.latitude, circle.center.longitude) + ..radius = circle.radius + ..visible = circle.visible + ..zIndex = circle.zIndex + ..clickable = circle.consumeTapEvents; return circleOptions; } @@ -530,28 +522,25 @@ visualization.HeatmapLayerOptions _heatmapOptionsFromHeatmap(Heatmap heatmap) { ); final visualization.HeatmapLayerOptions heatmapOptions = visualization.HeatmapLayerOptions() - ..data = - heatmap.data - .map( - (WeightedLatLng e) => - visualization.WeightedLocation() - ..location = gmaps.LatLng( - e.point.latitude, - e.point.longitude, - ) - ..weight = e.weight, + ..data = heatmap.data + .map( + (WeightedLatLng e) => visualization.WeightedLocation() + ..location = gmaps.LatLng( + e.point.latitude, + e.point.longitude, ) - .toList() - .toJS + ..weight = e.weight, + ) + .toList() + .toJS ..dissipating = heatmap.dissipating - ..gradient = - gradientColors == null - ? null - : [ - // Web needs a first color with 0 alpha - gradientColors.first.withAlpha(0), - ...gradientColors, - ].map(_getCssColorWithAlpha).toList() + ..gradient = gradientColors == null + ? null + : [ + // Web needs a first color with 0 alpha + gradientColors.first.withAlpha(0), + ...gradientColors, + ].map(_getCssColorWithAlpha).toList() ..maxIntensity = heatmap.maxIntensity ..opacity = heatmap.opacity ..radius = heatmap.radius.radius; @@ -631,8 +620,7 @@ List _ensureHoleHasReverseWinding( bool _isPolygonClockwise(List path) { double direction = 0.0; for (int i = 0; i < path.length; i++) { - direction = - direction + + direction = direction + ((path[(i + 1) % path.length].lat - path[i].lat) * (path[(i + 1) % path.length].lng + path[i].lng)); } @@ -744,19 +732,18 @@ void _applyCameraUpdate(gmaps.Map map, CameraUpdate update) { String urlFromMapBitmap(MapBitmap mapBitmap) { return switch (mapBitmap) { (final BytesMapBitmap bytesMapBitmap) => _bitmapBlobUrlCache.putIfAbsent( - bytesMapBitmap.byteData.hashCode, - () { - final Blob blob = Blob( - [bytesMapBitmap.byteData.toJS].toJS, - ); - return URL.createObjectURL(blob as JSObject); - }, - ), + bytesMapBitmap.byteData.hashCode, + () { + final Blob blob = Blob( + [bytesMapBitmap.byteData.toJS].toJS, + ); + return URL.createObjectURL(blob as JSObject); + }, + ), (final AssetMapBitmap assetMapBitmap) => ui_web.assetManager.getAssetUrl( - assetMapBitmap.assetName, - ), - _ => - throw UnimplementedError( + assetMapBitmap.assetName, + ), + _ => throw UnimplementedError( 'Only BytesMapBitmap and AssetMapBitmap are supported.', ), }; diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index da435958a90..5b1a8df3d06 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 0.5.13 +version: 0.5.14 environment: sdk: ^3.7.0 From bc8995ca65166e6b864dc08311850b54b247aea3 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 11:41:59 -0300 Subject: [PATCH 14/29] chore: update google_maps_flutter changelog --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 5 ++++- .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index e9c519906b8..b849769c493 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,6 +1,9 @@ -## 2.13.0 +## 2.14.0 * Adds support for camera control button on web. + +## 2.13.0 + * Updates minimum supported SDK version to Flutter 3.29/Dart 3.7. ## 2.12.3 diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index db7b1ed6c1f..004214ce51e 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.13.0 +version: 2.14.0 environment: sdk: ^3.7.0 From e1baafed213736b9369b1c670365d8d1584f52f7 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 11:43:44 -0300 Subject: [PATCH 15/29] chore: undo --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 5 +---- .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index b849769c493..e9c519906b8 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,9 +1,6 @@ -## 2.14.0 - -* Adds support for camera control button on web. - ## 2.13.0 +* Adds support for camera control button on web. * Updates minimum supported SDK version to Flutter 3.29/Dart 3.7. ## 2.12.3 diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 004214ce51e..db7b1ed6c1f 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.14.0 +version: 2.13.0 environment: sdk: ^3.7.0 From c2db98a2f9a9927a7ffef7fc030ddeabbd41e52a Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 11:45:32 -0300 Subject: [PATCH 16/29] chore: update web package changelog --- .../google_maps_flutter/google_maps_flutter_web/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index c4e4c87f922..1522575be0f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.5.14 -* Adds support to camera control button. +* Adds support for disabling or moving the camera control button on web. ## 0.5.13 From f39f1720c805f816edd18e07db1c00ad3e8b7ad1 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 11:49:46 -0300 Subject: [PATCH 17/29] chore: remove non doc-comments --- .../lib/src/types/web_camera_control_position.dart | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart index 067a36eadb3..d3d417557ba 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart @@ -2,17 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Identifiers used to specify the placement of controls on the map. -// Controls are positioned relative to other controls in the same layout position. -// Controls that are added first are positioned closer to the edge of the map. -// Usage of "logical values" -// (see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values) -// is recommended in order to be able to automatically support both -// left-to-right (LTR) and right-to-left (RTL) layout contexts. - -// Elements in the top or bottom row flow towards the middle of the row. -// Elements in the left or right column flow towards the middle of the column. - /// This setting controls how the API handles camera control button on the map /// See https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition for more details. enum WebCameraControlPosition { @@ -22,7 +11,7 @@ enum WebCameraControlPosition { /// Equivalent to BOTTOM_LEFT in LTR, or BOTTOM_RIGHT in RTL. blockEndInlineStart, - /// EEquivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. + /// Equivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. blockEndInlineEnd, /// Equivalent to TOP_CENTER in both LTR and RTL. @@ -61,7 +50,6 @@ enum WebCameraControlPosition { inlineStartBlockCenter, /// Equivalent to LEFT_BOTTOM in LTR, or RIGHT_BOTTOM in RTL. - inlineStartBlockEnd, /// Equivalent to LEFT_TOP in LTR, or RIGHT_TOP in RTL. From 1c436879b00f1f3b6345b1beff0445b850a8b555 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 12:02:37 -0300 Subject: [PATCH 18/29] chore: revert the newline removals from the Android and iOS pubspecs --- .../google_maps_flutter_android/example/pubspec.yaml | 2 +- .../google_maps_flutter_android/pubspec.yaml | 2 +- .../google_maps_flutter_ios/example/ios14/pubspec.yaml | 2 +- .../google_maps_flutter_ios/example/ios15/pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index 06539f45c21..11f5f9cf7fe 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -32,4 +32,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/ \ No newline at end of file + - assets/ diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 40c2fd4549d..346bd44e54e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -36,4 +36,4 @@ dev_dependencies: topics: - google-maps - google-maps-flutter - - map \ No newline at end of file + - map diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml index 4838b5a055e..fa834998717 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml @@ -31,4 +31,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/ \ No newline at end of file + - assets/ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml index 4838b5a055e..fa834998717 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml @@ -31,4 +31,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/ \ No newline at end of file + - assets/ From 8251ab01c10f45d3feb1d41a21b37b4641f363c4 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 12:19:04 -0300 Subject: [PATCH 19/29] feat: add cameraControl enablse/disable --- .../CHANGELOG.md | 5 +- .../lib/src/types/map_configuration.dart | 32 +++++++ .../lib/src/types/types.dart | 1 + .../types/web_camera_control_position.dart | 93 +++++++++++++++++++ .../pubspec.yaml | 2 +- .../test/types/map_configuration_test.dart | 51 ++++++++++ 6 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 20585d0257d..3641925e578 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.14.0 +* Adds support for disabling or moving the camera control button on web. * Updates minimum supported SDK version to Flutter 3.29/Dart 3.7. ## 2.13.0 @@ -247,4 +248,4 @@ ## 1.0.0 ... 1.0.0+5 -* Development. +* Development. \ No newline at end of file diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart index 960a4c425b1..5bf2a67a907 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/map_configuration.dart @@ -15,6 +15,8 @@ class MapConfiguration { /// as either a full configuration selection, or an update to an existing /// configuration where only non-null values are updated. const MapConfiguration({ + this.webCameraControlPosition, + this.webCameraControlEnabled, this.webGestureHandling, this.compassEnabled, this.mapToolbarEnabled, @@ -47,6 +49,18 @@ class MapConfiguration { /// See [WebGestureHandling] for more details. final WebGestureHandling? webGestureHandling; + /// This setting controls how the API handles cameraControl button position on the map. Web only. + /// + /// If null, the Google Maps API will use its default camera control position. + /// + /// See [WebCameraControlPosition] for more details. + final WebCameraControlPosition? webCameraControlPosition; + + /// This setting controls how the API handles cameraControl button on the map. Web only. + /// + /// See https://developers.google.com/maps/documentation/javascript/controls for more details. + final bool? webCameraControlEnabled; + /// True if the compass UI should be shown. final bool? compassEnabled; @@ -142,6 +156,14 @@ class MapConfiguration { /// that are different from [other]. MapConfiguration diffFrom(MapConfiguration other) { return MapConfiguration( + webCameraControlPosition: + webCameraControlPosition != other.webCameraControlPosition + ? webCameraControlPosition + : null, + webCameraControlEnabled: + webCameraControlEnabled != other.webCameraControlEnabled + ? webCameraControlEnabled + : null, webGestureHandling: webGestureHandling != other.webGestureHandling ? webGestureHandling @@ -218,6 +240,10 @@ class MapConfiguration { /// replacing the previous values. MapConfiguration applyDiff(MapConfiguration diff) { return MapConfiguration( + webCameraControlPosition: + diff.webCameraControlPosition ?? webCameraControlPosition, + webCameraControlEnabled: + diff.webCameraControlEnabled ?? webCameraControlEnabled, webGestureHandling: diff.webGestureHandling ?? webGestureHandling, compassEnabled: diff.compassEnabled ?? compassEnabled, mapToolbarEnabled: diff.mapToolbarEnabled ?? mapToolbarEnabled, @@ -250,6 +276,8 @@ class MapConfiguration { /// True if no options are set. bool get isEmpty => + webCameraControlPosition == null && + webCameraControlEnabled == null && webGestureHandling == null && compassEnabled == null && mapToolbarEnabled == null && @@ -283,6 +311,8 @@ class MapConfiguration { return false; } return other is MapConfiguration && + webCameraControlPosition == other.webCameraControlPosition && + webCameraControlEnabled == other.webCameraControlEnabled && webGestureHandling == other.webGestureHandling && compassEnabled == other.compassEnabled && mapToolbarEnabled == other.mapToolbarEnabled && @@ -311,6 +341,8 @@ class MapConfiguration { @override int get hashCode => Object.hashAll([ webGestureHandling, + webCameraControlPosition, + webCameraControlEnabled, compassEnabled, mapToolbarEnabled, cameraTargetBounds, diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart index 08c34d29ea7..85a7096a404 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/types.dart @@ -45,4 +45,5 @@ export 'utils/marker.dart'; export 'utils/polygon.dart'; export 'utils/polyline.dart'; export 'utils/tile_overlay.dart'; +export 'web_camera_control_position.dart'; export 'web_gesture_handling.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart new file mode 100644 index 00000000000..d3d417557ba --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart @@ -0,0 +1,93 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// This setting controls how the API handles camera control button on the map +/// See https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition for more details. +enum WebCameraControlPosition { + /// Equivalent to BOTTOM_CENTER in both LTR and RTL. + blockEndInlineCenter, + + /// Equivalent to BOTTOM_LEFT in LTR, or BOTTOM_RIGHT in RTL. + blockEndInlineStart, + + /// Equivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. + blockEndInlineEnd, + + /// Equivalent to TOP_CENTER in both LTR and RTL. + blockStartInlineCenter, + + /// Equivalent to TOP_LEFT in LTR, or TOP_RIGHT in RTL. + blockStartInlineStart, + + /// Equivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. + blockStartInlineEnd, + + /// Elements are positioned in the center of the bottom row. + /// Consider using BLOCK_END_INLINE_CENTER instead. + bottomCenter, + + /// Elements are positioned in the bottom left and flow towards the middle. + /// Elements are positioned to the right of the Google logo. + /// Consider using BLOCK_END_INLINE_START instead. + bottomLeft, + + /// Elements are positioned in the bottom right and flow towards the middle. + /// Elements are positioned to the left of the copyrights. + /// Consider using BLOCK_END_INLINE_END instead. + bottomRight, + + /// Equivalent to RIGHT_CENTER in LTR, or LEFT_CENTER in RTL. + inlineEndBlockCenter, + + /// Equivalent to RIGHT_BOTTOM in LTR, or LEFT_BOTTOM in RTL. + inlineEndBlockEnd, + + /// Equivalent to RIGHT_TOP in LTR, or LEFT_TOP in RTL. + inlineEndBlockStart, + + /// Equivalent to LEFT_CENTER in LTR, or RIGHT_CENTER in RTL. + inlineStartBlockCenter, + + /// Equivalent to LEFT_BOTTOM in LTR, or RIGHT_BOTTOM in RTL. + inlineStartBlockEnd, + + /// Equivalent to LEFT_TOP in LTR, or RIGHT_TOP in RTL. + inlineStartBlockStart, + + /// Elements are positioned on the left, above bottom-left elements, + /// and flow upwards. Consider using INLINE_START_BLOCK_END instead. + leftBottom, + + /// Elements are positioned in the center of the left side. + /// Consider using INLINE_START_BLOCK_CENTER instead. + leftCenter, + + /// Elements are positioned on the left, below top-left elements, + /// and flow downwards. Consider using INLINE_START_BLOCK_START instead. + leftTop, + + /// Elements are positioned on the right, above bottom-right elements, + /// and flow upwards. Consider using INLINE_END_BLOCK_END instead. + rightBottom, + + /// Elements are positioned in the center of the right side. + /// Consider using INLINE_END_BLOCK_CENTER instead. + rightCenter, + + /// Elements are positioned on the right, below top-right elements, + /// and flow downwards. Consider using INLINE_END_BLOCK_START instead. + rightTop, + + /// Elements are positioned in the center of the top row. + /// Consider using BLOCK_START_INLINE_CENTER instead. + topCenter, + + /// Elements are positioned in the top left and flow towards the middle. + /// Consider using BLOCK_START_INLINE_START instead. + topLeft, + + /// Elements are positioned in the top right and flow towards the middle. + /// Consider using BLOCK_START_INLINE_END instead. + topRight, +} diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index 643165f130e..7a8fdc763c6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.13.0 +version: 2.14.0 environment: sdk: ^3.7.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart index 5ce807556df..00c9e61c4c0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart @@ -12,6 +12,8 @@ void main() { group('diffs', () { // A options instance with every field set, to test diffs against. final MapConfiguration diffBase = MapConfiguration( + webCameraControlPosition: WebCameraControlPosition.topRight, + webCameraControlEnabled: false, webGestureHandling: WebGestureHandling.auto, compassEnabled: false, mapToolbarEnabled: false, @@ -62,6 +64,8 @@ void main() { expect(updated.liteModeEnabled, isNot(null)); expect(updated.padding, isNot(null)); expect(updated.trafficEnabled, isNot(null)); + expect(updated.cloudMapId, null); + expect(updated.webCameraControlPosition, isNot(null)); expect(updated.mapId, null); }); @@ -83,6 +87,45 @@ void main() { expect(empty.hashCode, isNot(diff.hashCode)); }); + test('handle webCameraControlPosition', () async { + const MapConfiguration diff = MapConfiguration( + webCameraControlPosition: WebCameraControlPosition.blockEndInlineEnd, + ); + + const MapConfiguration empty = MapConfiguration(); + final MapConfiguration updated = diffBase.applyDiff(diff); + + // A diff applied to empty options should be the diff itself. + expect(empty.applyDiff(diff), diff); + // The diff from empty options should be the diff itself. + expect(diff.diffFrom(empty), diff); + // A diff applied to non-empty options should update that field. + expect( + updated.webCameraControlPosition, + WebCameraControlPosition.blockEndInlineEnd, + ); + // The hash code should change. + expect(empty.hashCode, isNot(diff.hashCode)); + }); + + test('handle webCameraControlEnabled', () async { + const MapConfiguration diff = MapConfiguration( + webCameraControlEnabled: true, + ); + + const MapConfiguration empty = MapConfiguration(); + final MapConfiguration updated = diffBase.applyDiff(diff); + + // A diff applied to empty options should be the diff itself. + expect(empty.applyDiff(diff), diff); + // The diff from empty options should be the diff itself. + expect(diff.diffFrom(empty), diff); + // A diff applied to non-empty options should update that field. + expect(updated.webCameraControlEnabled, true); + // The hash code should change. + expect(empty.hashCode, isNot(diff.hashCode)); + }); + test('handle compassEnabled', () async { const MapConfiguration diff = MapConfiguration(compassEnabled: true); @@ -470,6 +513,14 @@ void main() { expect(nullOptions.isEmpty, true); }); + test('is false with webCameraControlEnabled', () async { + const MapConfiguration diff = MapConfiguration( + webCameraControlEnabled: true, + ); + + expect(diff.isEmpty, false); + }); + test('is false with compassEnabled', () async { const MapConfiguration diff = MapConfiguration(compassEnabled: true); From e919f3d3a1f2e8f407dffd39129b9b9c759815a0 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Alves Melo Date: Wed, 27 Aug 2025 12:23:41 -0300 Subject: [PATCH 20/29] Update packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../lib/src/types/web_camera_control_position.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart index d3d417557ba..dd7489d6ec1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart @@ -11,7 +11,7 @@ enum WebCameraControlPosition { /// Equivalent to BOTTOM_LEFT in LTR, or BOTTOM_RIGHT in RTL. blockEndInlineStart, - /// Equivalent to TOP_RIGHT in LTR, or TOP_LEFT in RTL. + /// Equivalent to BOTTOM_RIGHT in LTR, or BOTTOM_LEFT in RTL. blockEndInlineEnd, /// Equivalent to TOP_CENTER in both LTR and RTL. From a53dea06d76d84ab63b2b9b87eed7239860eecd6 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 16:28:20 -0300 Subject: [PATCH 21/29] chore: update docs --- .../types/web_camera_control_position.dart | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart index dd7489d6ec1..84b64cb282e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/web_camera_control_position.dart @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// This setting controls how the API handles camera control button on the map -/// See https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition for more details. +/// This setting controls how the API handles camera control button on the map. +/// +/// See https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition +/// for more details. enum WebCameraControlPosition { /// Equivalent to BOTTOM_CENTER in both LTR and RTL. blockEndInlineCenter, @@ -24,16 +26,21 @@ enum WebCameraControlPosition { blockStartInlineEnd, /// Elements are positioned in the center of the bottom row. + /// /// Consider using BLOCK_END_INLINE_CENTER instead. bottomCenter, /// Elements are positioned in the bottom left and flow towards the middle. + /// /// Elements are positioned to the right of the Google logo. + /// /// Consider using BLOCK_END_INLINE_START instead. bottomLeft, /// Elements are positioned in the bottom right and flow towards the middle. + /// /// Elements are positioned to the left of the copyrights. + /// /// Consider using BLOCK_END_INLINE_END instead. bottomRight, @@ -56,7 +63,9 @@ enum WebCameraControlPosition { inlineStartBlockStart, /// Elements are positioned on the left, above bottom-left elements, - /// and flow upwards. Consider using INLINE_START_BLOCK_END instead. + /// and flow upwards. + /// + /// Consider using INLINE_START_BLOCK_END instead. leftBottom, /// Elements are positioned in the center of the left side. @@ -64,30 +73,40 @@ enum WebCameraControlPosition { leftCenter, /// Elements are positioned on the left, below top-left elements, - /// and flow downwards. Consider using INLINE_START_BLOCK_START instead. + /// and flow downwards. + /// + /// Consider using INLINE_START_BLOCK_START instead. leftTop, /// Elements are positioned on the right, above bottom-right elements, - /// and flow upwards. Consider using INLINE_END_BLOCK_END instead. + /// and flow upwards. + /// + /// Consider using INLINE_END_BLOCK_END instead. rightBottom, /// Elements are positioned in the center of the right side. + /// /// Consider using INLINE_END_BLOCK_CENTER instead. rightCenter, /// Elements are positioned on the right, below top-right elements, - /// and flow downwards. Consider using INLINE_END_BLOCK_START instead. + /// and flow downwards. + /// + /// Consider using INLINE_END_BLOCK_START instead. rightTop, /// Elements are positioned in the center of the top row. + /// /// Consider using BLOCK_START_INLINE_CENTER instead. topCenter, /// Elements are positioned in the top left and flow towards the middle. + /// /// Consider using BLOCK_START_INLINE_START instead. topLeft, /// Elements are positioned in the top right and flow towards the middle. + /// /// Consider using BLOCK_START_INLINE_END instead. topRight, } From aff20e26c9e3b65760d3a93cfb6e7a1bb5c799ee Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 27 Aug 2025 17:46:13 -0300 Subject: [PATCH 22/29] chore: add webCameraControlPosition test --- .../test/types/map_configuration_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart index 00c9e61c4c0..d60dbe58772 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/map_configuration_test.dart @@ -521,6 +521,14 @@ void main() { expect(diff.isEmpty, false); }); + test('is false with webCameraControlPosition', () async { + const MapConfiguration diff = MapConfiguration( + webCameraControlPosition: WebCameraControlPosition.blockEndInlineCenter, + ); + + expect(diff.isEmpty, false); + }); + test('is false with compassEnabled', () async { const MapConfiguration diff = MapConfiguration(compassEnabled: true); From a4c3b7c330fd5ff9e3781fd911cbeb530b57e287 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Thu, 28 Aug 2025 15:12:03 -0300 Subject: [PATCH 23/29] chore: remove platform interface override --- .../google_maps_flutter/example/pubspec.yaml | 3 +-- .../google_maps_flutter_web/example/pubspec.yaml | 7 +------ .../google_maps_flutter_web/pubspec.yaml | 9 +-------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml index d3d1c2477e0..bd2646c28f5 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -19,13 +19,12 @@ dependencies: # the parent directory to use the current plugin's version. path: ../ google_maps_flutter_android: ^2.16.1 - google_maps_flutter_platform_interface: ^2.12.1 + google_maps_flutter_platform_interface: ^2.14.0 # FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. # See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} google_maps_flutter_web: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_web} dev_dependencies: diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index 052627fd6f4..e1223415430 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -8,7 +8,7 @@ environment: dependencies: flutter: sdk: flutter - google_maps_flutter_platform_interface: ^2.12.1 + google_maps_flutter_platform_interface: ^2.14.0 google_maps_flutter_web: path: ../ web: ^1.0.0 @@ -28,8 +28,3 @@ flutter: assets: - assets/ -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} - google_maps_flutter_web: {path: ../} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index 5b1a8df3d06..2677176c86d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -23,18 +23,11 @@ dependencies: flutter_web_plugins: sdk: flutter google_maps: ^8.0.0 - google_maps_flutter_platform_interface: ^2.12.1 + google_maps_flutter_platform_interface: ^2.14.0 sanitize_html: ^2.0.0 stream_transform: ^2.0.0 web: ">=0.5.1 <2.0.0" -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} - - - dev_dependencies: flutter_test: sdk: flutter From bd44dad25f691bd959319d17d05051ed0aa160ee Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Thu, 28 Aug 2025 15:12:24 -0300 Subject: [PATCH 24/29] chore: remove platform interface override --- packages/google_maps_flutter/google_maps_flutter/pubspec.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index db7b1ed6c1f..915262938c3 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -23,13 +23,12 @@ dependencies: sdk: flutter google_maps_flutter_android: ^2.16.1 google_maps_flutter_ios: ^2.15.4 - google_maps_flutter_platform_interface: ^2.12.1 + google_maps_flutter_platform_interface: ^2.14.0 google_maps_flutter_web: ^0.5.12 # FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. # See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins dependency_overrides: - google_maps_flutter_platform_interface: {path: ../../../packages/google_maps_flutter/google_maps_flutter_platform_interface} google_maps_flutter_web: {path: ../../../packages/google_maps_flutter/google_maps_flutter_web} dev_dependencies: From e11955e387036b941a8045891f843b8388b4bb48 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 2 Sep 2025 19:30:45 -0300 Subject: [PATCH 25/29] chore: remove dependency override --- .../google_maps_flutter/example/pubspec.yaml | 6 ------ .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 7 +------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml index bd2646c28f5..d8fcc8a840c 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -21,12 +21,6 @@ dependencies: google_maps_flutter_android: ^2.16.1 google_maps_flutter_platform_interface: ^2.14.0 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_web: {path: ../../../../packages/google_maps_flutter/google_maps_flutter_web} - dev_dependencies: build_runner: ^2.1.10 espresso: ^0.4.0 diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 915262938c3..b5f487c8c7f 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -24,12 +24,7 @@ dependencies: google_maps_flutter_android: ^2.16.1 google_maps_flutter_ios: ^2.15.4 google_maps_flutter_platform_interface: ^2.14.0 - google_maps_flutter_web: ^0.5.12 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins -dependency_overrides: - google_maps_flutter_web: {path: ../../../packages/google_maps_flutter/google_maps_flutter_web} + google_maps_flutter_web: ^0.5.14 dev_dependencies: flutter_test: From ba9375e983e166534762f4b14a662153f5867445 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 2 Sep 2025 19:33:28 -0300 Subject: [PATCH 26/29] chore: undo web example --- .../google_maps_flutter_web/example/pubspec.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index a31e7a7e9f2..d0a6543cd62 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -28,3 +28,9 @@ flutter: assets: - assets/ +dependency_overrides: + # Override the google_maps_flutter dependency on google_maps_flutter_web. + # TODO(ditman): Unwind the circular dependency. This will create problems + # if we need to make a breaking change to google_maps_flutter_web. + google_maps_flutter_web: + path: ../ \ No newline at end of file From 6c54f61b4941a54c86fc39da7f42b06d391426e5 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 2 Sep 2025 19:36:38 -0300 Subject: [PATCH 27/29] chore: undo line change --- .../google_maps_flutter_web/example/pubspec.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index d0a6543cd62..a31e7a7e9f2 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -28,9 +28,3 @@ flutter: assets: - assets/ -dependency_overrides: - # Override the google_maps_flutter dependency on google_maps_flutter_web. - # TODO(ditman): Unwind the circular dependency. This will create problems - # if we need to make a breaking change to google_maps_flutter_web. - google_maps_flutter_web: - path: ../ \ No newline at end of file From c7bf6d7ab69fa6f1fc9605eb577e06f903d8a85e Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Tue, 2 Sep 2025 19:37:45 -0300 Subject: [PATCH 28/29] chore: restore file --- .../google_maps_flutter_web/example/pubspec.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index a31e7a7e9f2..96e889984d0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -28,3 +28,9 @@ flutter: assets: - assets/ +dependency_overrides: + # Override the google_maps_flutter dependency on google_maps_flutter_web. + # TODO(ditman): Unwind the circular dependency. This will create problems + # if we need to make a breaking change to google_maps_flutter_web. + google_maps_flutter_web: + path: ../ From 9d7d258c1b8bbaf569f9cdcfedd1337425283023 Mon Sep 17 00:00:00 2001 From: Arthur Monteiro Date: Wed, 3 Sep 2025 10:35:57 -0300 Subject: [PATCH 29/29] chore: format file --- .../example/lib/map_ui.dart | 85 +++++++++---------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart b/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart index c0a5435367c..497caf7e2d4 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart @@ -77,7 +77,8 @@ class MapUiBodyState extends State { Widget _webCameraControlToggler() { return TextButton( child: Text( - '${_webCameraControlEnabled ? 'disable' : 'enable'} web camera control'), + '${_webCameraControlEnabled ? 'disable' : 'enable'} web camera control', + ), onPressed: () { setState(() { _webCameraControlEnabled = !_webCameraControlEnabled; @@ -88,50 +89,46 @@ class MapUiBodyState extends State { Widget _webCameraControlPositionToggler() { return TextButton( - onPressed: () => showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: const Text('Web camera control position'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - DropdownButton( - hint: const Text('Web camera control position'), - value: _webCameraControlPosition, - items: WebCameraControlPosition.values - .map( - (WebCameraControlPosition e) => - DropdownMenuItem( - value: e, - child: Text(e.name), - ), - ) - .toList(), - onChanged: (WebCameraControlPosition? value) { - setState( - () { - _webCameraControlPosition = value; + onPressed: + () => showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Web camera control position'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + DropdownButton( + hint: const Text('Web camera control position'), + value: _webCameraControlPosition, + items: + WebCameraControlPosition.values + .map( + (WebCameraControlPosition e) => + DropdownMenuItem( + value: e, + child: Text(e.name), + ), + ) + .toList(), + onChanged: (WebCameraControlPosition? value) { + setState(() { + _webCameraControlPosition = value; + }); + }, + ), + TextButton( + onPressed: () { + Navigator.pop(context); }, - ); - }, + child: const Text('Ok'), + ), + ], ), - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: const Text( - 'Ok', - ), - ) - ], - ), - ); - }, - ), - child: const Text( - 'change web camera control position', - ), + ); + }, + ), + child: const Text('change web camera control position'), ); } @@ -395,7 +392,7 @@ class MapUiBodyState extends State { _webCameraControlToggler(), if (_webCameraControlEnabled) _webCameraControlPositionToggler(), - ] + ], ], ), ),