Skip to content

[google_maps_flutter] Add missing exports#11196

Open
stuartmorgan-g wants to merge 1 commit intoflutter:mainfrom
stuartmorgan-g:maps-advanced-marker-export
Open

[google_maps_flutter] Add missing exports#11196
stuartmorgan-g wants to merge 1 commit intoflutter:mainfrom
stuartmorgan-g:maps-advanced-marker-export

Conversation

@stuartmorgan-g
Copy link
Collaborator

This adds exports that should have been in #7882, but I missed in review.

Like much of the google_maps_flutter APIs currently, advanced markers rely on clients using types that are defined in the platform interface package. This re-exports them, and fixes the examples to not import the platform interface.

Ideally we would have more separation between the API layers, but this is deeply ingrained in the API design of the plugin at this point, so changing it would require a comprehensive overhaul.

Pre-Review Checklist

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

Like much of the `google_maps_flutter` APIs currently, advanced markers
rely on clients using types that are defined in the platform interface
package. This re-exports them, and fixes the examples to not import the
platform interface.

Ideally we would have more separation between the API layers, but this
is deeply ingrained in the API design of the plugin at this point, so
changing it would require a comprehensive overhaul.
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 correctly adds missing re-exports for advanced marker-related classes from the google_maps_flutter_platform_interface package into the main google_maps_flutter package. The example files have been updated to reflect these changes by removing direct imports from the platform interface, which improves the API's consistency and usability. The changelog and pubspec.yaml have also been updated appropriately. The changes are well-aligned with the pull request's objective.

@stuartmorgan-g
Copy link
Collaborator Author

@jokerttu I ran into one potentially thorn issue here that I completely missed in review: one of the example pages is calling GoogleMapsFlutterPlatform.instance.isAdvancedMarkersAvailable and I can't remove that because there's no passthrough from the app-facing package. I was going to add one, but then I noticed that it takes a map ID. But the only way to get a map ID is to have made a MapWidget. And the marker type is a parameter to the MapWidget constructor.

Don't clients need to know whether advanced marker support is available before passing the advanced marker type to MapWidget? Is it a mistake in the platform interface that the query takes a map ID?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant