[google_maps_flutter] Add support for mapType, fullscreen, and Street View controls on web#11955
[google_maps_flutter] Add support for mapType, fullscreen, and Street View controls on web#11955puneetkukreja98 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for mapTypeControlEnabled, fullscreenControlEnabled, and streetViewControlEnabled on the web platform across the google_maps_flutter, google_maps_flutter_platform_interface, and google_maps_flutter_web packages, along with corresponding unit and integration tests. Feedback from the reviewer highlights the need to update the dependency constraints for google_maps_flutter_platform_interface in the pubspec files of both google_maps_flutter and google_maps_flutter_web to prevent potential compilation failures.
| 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.17.1 | ||
| version: 2.17.2 |
There was a problem hiding this comment.
Since this PR introduces new public parameters (mapTypeControlEnabled, fullscreenControlEnabled, streetViewControlEnabled) to the GoogleMap widget, this is a backward-compatible feature addition. According to Semantic Versioning, this requires a minor version bump (to 2.18.0) rather than a patch bump (to 2.17.2). Additionally, because google_maps_flutter now uses the new fields of MapConfiguration introduced in google_maps_flutter_platform_interface, you must update the dependency on google_maps_flutter_platform_interface in this pubspec.yaml to require the new version (e.g., ^2.16.0). Otherwise, compilation will fail if an older version of the platform interface is resolved.
version: 2.18.0| 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.6.2+3 | ||
| version: 0.6.3 |
There was a problem hiding this comment.
Because google_maps_flutter_web now uses the new fields of MapConfiguration in convert.dart, you must update its dependency on google_maps_flutter_platform_interface in this pubspec.yaml to require the new version (e.g., ^2.16.0). Otherwise, compilation will fail if an older version of the platform interface is resolved.
This PR adds support for mapTypeControlEnabled, fullscreenControlEnabled, and streetViewControlEnabled on Flutter web.
Previously, these options were not exposed through the GoogleMap widget and were internally defaulted to false in MapConfiguration.
This change propagates these parameters through google_maps_flutter, google_maps_flutter_platform_interface, and google_maps_flutter_web, allowing developers to explicitly enable or disable these controls.
To preserve backward compatibility, the existing behavior is maintained by defaulting these options to false when they are not provided by the user.
I created a sample app and tested the changes using dependency_overrides. Attaching a video for reference.
google_maps_flutter_rec.mov
Fixes flutter/flutter#104111.
Pre-Review Checklist
[shared_preferences]///).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