[google_maps_flutter] Android cluster pin info window onTap callback not firing#11390
[google_maps_flutter] Android cluster pin info window onTap callback not firing#11390elitree wants to merge 3 commits intoflutter:mainfrom
Conversation
01f4b2f to
1ef8250
Compare
There was a problem hiding this comment.
Code Review
This pull request adds support for info window tap events on clustered markers in the Google Maps Android plugin. It introduces the OnClusterItemInfoWindowClickListener interface, implements it in GoogleMapController, and updates ClusterManagersController and MarkersController to handle the event and notify the Flutter API. Unit tests are included to verify the implementation. Feedback suggests refactoring MarkersController to reduce code duplication between the info window tap handlers.
| /** | ||
| * Called when a cluster-managed marker's info window is tapped. Takes the Dart marker ID | ||
| * directly. | ||
| */ | ||
| void onClusterItemInfoWindowTap(String markerId) { | ||
| flutterApi.onInfoWindowTap(markerId, new NoOpVoidResult()); | ||
| } |
There was a problem hiding this comment.
To improve maintainability and reduce code duplication, you could refactor this new method and the existing onInfoWindowTap to share a common private method. The current implementation duplicates the call to flutterApi.onInfoWindowTap.
For example, you could introduce a private method that takes the Dart markerId and makes the API call. Then, both onInfoWindowTap (after resolving the googleMarkerId) and this new onClusterItemInfoWindowTap method could call that private method.
As described in flutter/flutter#184338, Google Maps Flutter Android has an issue where the cluster pin info window doesn't fire the
onTapcallback. That's the info window that shows when you tap a clustered pin (a pin which is part of a cluster manager). While the info window shows properly, theonTapdoesn't fire in Android, but properly fires in other platforms.Fixes flutter/flutter#184338
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