Skip to content

Conversation

@4rthurmonteiro
Copy link
Contributor

@4rthurmonteiro 4rthurmonteiro commented Aug 28, 2025

Platform web portion of #9089.

Part of flutter/flutter#167137

Pre-Review Checklist

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-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.

Footnotes

  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. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 adds support for enabling, disabling, and positioning the camera control button on the web. The implementation appears correct, and the core logic in convert.dart properly translates the new MapConfiguration options. I have provided one comment on the integration tests to address duplicated test names and code, suggesting a refactoring to improve clarity and maintainability.

return gmaps.ControlPosition.TOP_LEFT;
case WebCameraControlPosition.topRight:
return gmaps.ControlPosition.TOP_RIGHT;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be a return outside of this, to handle the case of an enum value being added, since it comes from a different package. See

// The enum comes from a different package, which could get a new value at
// any time, so provide a fallback that ensures this won't break when used
// with a version that contains new values. This is deliberately outside
// the switch rather than a `default` so that the linter will flag the
// switch as needing an update.
// ignore: dead_code
return gmaps.MapTypeId.ROADMAP;
for an example.

In this case I would suggest making the function return a nullable value so the fallback can be null, and then at the call site checking that this returns a non-null value before setting the value in the options class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Done.

@stuartmorgan-g stuartmorgan-g added the triage-web Should be looked at in web triage label Aug 28, 2025
sdk: flutter
flutter_web_plugins:
sdk: flutter
google_maps: ^8.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the MapOptions fields this PR is using were added in 8.1.0, which is why downgraded analysis is failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! done.

Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if Stuart's comments are addressed

Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@4rthurmonteiro
Copy link
Contributor Author

hey @stuartmorgan-g I updated the PR with your points.

@stuartmorgan-g stuartmorgan-g added autosubmit Merge PR when tree becomes green via auto submit App and removed triage-web Should be looked at in web triage labels Sep 2, 2025
@auto-submit auto-submit bot merged commit 89838c4 into flutter:main Sep 2, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Sep 3, 2025
flutter/packages@5d785a0...42bb347

2025-09-03 james@somethingwild.co.nz [google_maps_flutter] Fixes
exception when dispose is called while asynchronous update from
didUpdateWidget is executed (flutter/packages#9227)
2025-09-03 monteiroamelo@gmail.com [google_maps_flutter] Add
cameraControl enable/disable & position on web (flutter/packages#9089)
2025-09-03 stuartmorgan@google.com [tool] Only license-check checked-in
files (flutter/packages#9905)
2025-09-03 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes preloading ad while another was playing on
Android (flutter/packages#9904)
2025-09-02 31859944+LongCatIsLooong@users.noreply.github.com Update
FWFWebViewFlutterWKWebViewExternalAPITests.swift (flutter/packages#9922)
2025-09-02 31859944+LongCatIsLooong@users.noreply.github.com Update
Stubs for FlutterPluginRegistrar interface change
(flutter/packages#9923)
2025-09-02 43054281+camsim99@users.noreply.github.com
[camera_android_camerax] Update Android minimum SDK version
(flutter/packages#9945)
2025-09-02 engine-flutter-autoroll@skia.org Roll Flutter from
da5523a to 6b18740 (49 revisions) (flutter/packages#9926)
2025-09-02 stuartmorgan@google.com [various] Scrub pre-iOS-13 code
(flutter/packages#9849)
2025-09-02 monteiroamelo@gmail.com [google_maps_flutter_web] Add
cameraControl enable/disable & position on web (flutter/packages#9921)

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 flutter-ecosystem@google.com 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
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…er#174876)

flutter/packages@5d785a0...42bb347

2025-09-03 james@somethingwild.co.nz [google_maps_flutter] Fixes
exception when dispose is called while asynchronous update from
didUpdateWidget is executed (flutter/packages#9227)
2025-09-03 monteiroamelo@gmail.com [google_maps_flutter] Add
cameraControl enable/disable & position on web (flutter/packages#9089)
2025-09-03 stuartmorgan@google.com [tool] Only license-check checked-in
files (flutter/packages#9905)
2025-09-03 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes preloading ad while another was playing on
Android (flutter/packages#9904)
2025-09-02 31859944+LongCatIsLooong@users.noreply.github.com Update
FWFWebViewFlutterWKWebViewExternalAPITests.swift (flutter/packages#9922)
2025-09-02 31859944+LongCatIsLooong@users.noreply.github.com Update
Stubs for FlutterPluginRegistrar interface change
(flutter/packages#9923)
2025-09-02 43054281+camsim99@users.noreply.github.com
[camera_android_camerax] Update Android minimum SDK version
(flutter/packages#9945)
2025-09-02 engine-flutter-autoroll@skia.org Roll Flutter from
da5523a to 6b18740 (49 revisions) (flutter/packages#9926)
2025-09-02 stuartmorgan@google.com [various] Scrub pre-iOS-13 code
(flutter/packages#9849)
2025-09-02 monteiroamelo@gmail.com [google_maps_flutter_web] Add
cameraControl enable/disable & position on web (flutter/packages#9921)

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 flutter-ecosystem@google.com 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
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
…er#174876)

flutter/packages@5d785a0...42bb347

2025-09-03 james@somethingwild.co.nz [google_maps_flutter] Fixes
exception when dispose is called while asynchronous update from
didUpdateWidget is executed (flutter/packages#9227)
2025-09-03 monteiroamelo@gmail.com [google_maps_flutter] Add
cameraControl enable/disable & position on web (flutter/packages#9089)
2025-09-03 stuartmorgan@google.com [tool] Only license-check checked-in
files (flutter/packages#9905)
2025-09-03 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes preloading ad while another was playing on
Android (flutter/packages#9904)
2025-09-02 31859944+LongCatIsLooong@users.noreply.github.com Update
FWFWebViewFlutterWKWebViewExternalAPITests.swift (flutter/packages#9922)
2025-09-02 31859944+LongCatIsLooong@users.noreply.github.com Update
Stubs for FlutterPluginRegistrar interface change
(flutter/packages#9923)
2025-09-02 43054281+camsim99@users.noreply.github.com
[camera_android_camerax] Update Android minimum SDK version
(flutter/packages#9945)
2025-09-02 engine-flutter-autoroll@skia.org Roll Flutter from
da5523a to 6b18740 (49 revisions) (flutter/packages#9926)
2025-09-02 stuartmorgan@google.com [various] Scrub pre-iOS-13 code
(flutter/packages#9849)
2025-09-02 monteiroamelo@gmail.com [google_maps_flutter_web] Add
cameraControl enable/disable & position on web (flutter/packages#9921)

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 flutter-ecosystem@google.com 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants