-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_maps_flutter_web] Omit styles when cloudMapId is set #9869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[google_maps_flutter_web] Omit styles when cloudMapId is set #9869
Conversation
When `cloudMapId` is set, styles must be omitted to avoid conflicts. Now we set `MapOptions.mapId` and leave `styles` null in that case. Tests: add `cloud_map_styles_test` (web integration) to verify: - cloudMapId present ⇒ styles omitted, mapId set - no cloudMapId ⇒ styles applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses an issue where using cloudMapId for cloud-based styling on the web would fail if the style property was also present. The change correctly omits setting styles on the map when a cloudMapId is provided. New integration tests are added to verify that styles are omitted when cloudMapId is present, and applied when it's not. The implementation is correct, but my feedback points out the use of a deprecated cloudMapId property, suggesting to use the current mapId property instead. This is to adhere to the project's style guide, which recommends following Effective Dart style, including avoiding deprecated members.
...gle_maps_flutter/google_maps_flutter_web/example/integration_test/cloud_map_styles_test.dart
Show resolved
Hide resolved
...gle_maps_flutter/google_maps_flutter_web/example/integration_test/cloud_map_styles_test.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
Linux analyze_downgraded stableFailing after 6m — Linux analyze_downgraded stable error - lib/src/convert.dart:103:21 - The getter 'mapId' isn't defined for the type 'MapConfiguration'. Try importing the library that defines 'mapId', correcting the name to the name of an existing getter, or defining a getter or field named 'mapId'. - undefined_getter 1 issue found.
When `cloudMapId` is set, styles must be omitted to avoid conflicts. Now we set `MapOptions.mapId` and leave `styles` null in that case. Tests: add `cloud_map_styles_test` (web integration) to verify: - cloudMapId present ⇒ styles omitted, mapId set - no cloudMapId ⇒ styles applied
Linux analyze_downgraded stableFailing after 6m — Linux analyze_downgraded stable error - lib/src/convert.dart:103:21 - The getter 'mapId' isn't defined for the type 'MapConfiguration'. Try importing the library that defines 'mapId', correcting the name to the name of an existing getter, or defining a getter or field named 'mapId'. - undefined_getter 1 issue found.
e65b28e to
08c8c84
Compare
…into fix-maps-web-style-conflict-v2
mdebbar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
c98003a to
b9b4b66
Compare
packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart
Outdated
Show resolved
Hide resolved
packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md
Outdated
Show resolved
Hide resolved
….5.14+1 - Revert the unnecessary code move; keep the logic in its original location. - Update pubspec and CHANGELOG to 0.5.14+1 (pre-1.0 bugfix).
…into fix-maps-web-style-conflict-v2
- Update pubspec and CHANGELOG to 0.5.14+2
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
flutter/packages@42bb347...98580c6 2025-09-04 [email protected] [mustache_template] Initial import (flutter/packages#9944) 2025-09-04 [email protected] [google_maps_flutter_web] Omit styles when cloudMapId is set (flutter/packages#9869) 2025-09-03 [email protected] [go_router_builder] Fix unnecessary whitespace in generated `RelativeGoRouteData` (flutter/packages#9875) 2025-09-03 [email protected] [google_maps_flutter_web] Stop listening to map events when disposed (flutter/packages#9250) 2025-09-03 [email protected] [flutter_svg] loader buffer fix (flutter/packages#9898) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@42bb347...98580c6 2025-09-04 [email protected] [mustache_template] Initial import (flutter/packages#9944) 2025-09-04 [email protected] [google_maps_flutter_web] Omit styles when cloudMapId is set (flutter/packages#9869) 2025-09-03 [email protected] [go_router_builder] Fix unnecessary whitespace in generated `RelativeGoRouteData` (flutter/packages#9875) 2025-09-03 [email protected] [google_maps_flutter_web] Stop listening to map events when disposed (flutter/packages#9250) 2025-09-03 [email protected] [flutter_svg] loader buffer fix (flutter/packages#9898) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@42bb347...98580c6 2025-09-04 [email protected] [mustache_template] Initial import (flutter/packages#9944) 2025-09-04 [email protected] [google_maps_flutter_web] Omit styles when cloudMapId is set (flutter/packages#9869) 2025-09-03 [email protected] [go_router_builder] Fix unnecessary whitespace in generated `RelativeGoRouteData` (flutter/packages#9875) 2025-09-03 [email protected] [google_maps_flutter_web] Stop listening to map events when disposed (flutter/packages#9250) 2025-09-03 [email protected] [flutter_svg] loader buffer fix (flutter/packages#9898) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…#9869) When `cloudMapId` is set, styles must be omitted to avoid conflicts. Now we set `MapOptions.mapId` and leave `styles` null in that case. Tests: add `cloud_map_styles_test` (web integration) to verify: - cloudMapId present ⇒ styles omitted, mapId set - no cloudMapId ⇒ styles applied Fixes flutter/flutter#161951 **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
flutter/packages@42bb347...98580c6 2025-09-04 [email protected] [mustache_template] Initial import (flutter/packages#9944) 2025-09-04 [email protected] [google_maps_flutter_web] Omit styles when cloudMapId is set (flutter/packages#9869) 2025-09-03 [email protected] [go_router_builder] Fix unnecessary whitespace in generated `RelativeGoRouteData` (flutter/packages#9875) 2025-09-03 [email protected] [google_maps_flutter_web] Stop listening to map events when disposed (flutter/packages#9250) 2025-09-03 [email protected] [flutter_svg] loader buffer fix (flutter/packages#9898) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
When
cloudMapIdis set, styles must be omitted to avoid conflicts. Now we setMapOptions.mapIdand leavestylesnull in that case.Tests: add
cloud_map_styles_test(web integration) to verify:Fixes flutter/flutter#161951
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3