Skip to content

[google_maps_flutter] Android cluster pin info window onTap callback not firing#11390

Open
elitree wants to merge 3 commits intoflutter:mainfrom
ReportAll:fix/marker-info-window-clusters
Open

[google_maps_flutter] Android cluster pin info window onTap callback not firing#11390
elitree wants to merge 3 commits intoflutter:mainfrom
ReportAll:fix/marker-info-window-clusters

Conversation

@elitree
Copy link
Copy Markdown
Contributor

@elitree elitree commented Mar 30, 2026

As described in flutter/flutter#184338, Google Maps Flutter Android has an issue where the cluster pin info window doesn't fire the onTap callback. 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, the onTap doesn't fire in Android, but properly fires in other platforms.

Fixes flutter/flutter#184338

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

@elitree elitree force-pushed the fix/marker-info-window-clusters branch from 01f4b2f to 1ef8250 Compare March 30, 2026 14:47
Copy link
Copy Markdown

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

Comment on lines +310 to +316
/**
* 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());
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

@stuartmorgan-g stuartmorgan-g added the triage-android Should be looked at in Android triage label Mar 30, 2026
@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: google_maps_flutter platform-android triage-android Should be looked at in Android triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_maps_flutter] Android clustered pin marker info window onTap not firing

2 participants