Skip to content

[google_maps_flutter_ios] Add onPointOfInterestTap support - #12882

Closed
tenninebt wants to merge 2 commits into
flutter:mainfrom
tenninebt:google-maps-poi-ios
Closed

tenninebt wants to merge 2 commits into
flutter:mainfrom
tenninebt:google-maps-poi-ios

Conversation

@tenninebt

@tenninebt tenninebt commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Divergence from #11872 (intentional):

  • Ported to the post–ObjC→Swift GoogleMapController on main (same behavior; not a replay of the old ObjC files)
  • Skips frozen google_maps_flutter_ios — that package no longer takes feature updates (see its README); use sdk9/sdk10 instead
  • Reuses existing Swift MapsCallbackApiProtocol / MapEventDelegate instead of the ObjC-only FGMMapsCallbackApiProtocol wrapper from the combined PR

Part of #11872 / flutter/flutter#60695.

Depends on published google_maps_flutter_platform_interface 2.17.0.

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter.
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue] that this PR fixes in the description above.
  • I followed the [version and CHANGELOG] instructions, using [semantic versioning] and the [repository CHANGELOG style].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.

Forward GMSMapView POI taps to PointOfInterestTapEvent for sdk9/sdk10
(and shared source), with Dart and native unit coverage, targeting
platform interface 2.17.0.
@stuartmorgan-g stuartmorgan-g added the triage-ios Should be looked at in iOS triage label Sep 16, 2026
///
/// This exists to add AnyObject to the requirements, so that references to it can be weak.
protocol MapEventDelegate: AnyObject, MapsCallbackApiProtocol {}
protocol MapEventDelegate: AnyObject, MapsCallbackApiProtocol, TileProviderDelegate {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why was this changed? Providing tiles has nothing to do with event delegation.

If these changes were made so that you only have to inject one object instead of two, please don't do that. The fact that the default implementation is the same object is irrelevant to testing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed — that was a mistake. I had merged TileProviderDelegate into MapEventDelegate so a single test fake could cover both roles; that’s the wrong tradeoff and unrelated to POI.

Reverted: MapEventDelegate is only MapsCallbackApiProtocol again, and MapsCallbackApi: TileProviderDelegate is restored as on main.

assetProvider: AssetProvider,
binaryMessenger: FlutterBinaryMessenger
binaryMessenger: FlutterBinaryMessenger,
callbackHandler: MapEventDelegate? = nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please follow the pattern all the other dependency injection uses, where it's non-optional, and the default value is set from the convenience initializer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks — updated to match the existing DI pattern: callbackHandler is required on the designated initializer, and the convenience initializers supply a MapsCallbackApi default (same approach as assetProvider).

@tenninebt

Copy link
Copy Markdown
Contributor Author

Hey, sorry, still draft, just rebased with quick fixes but not yet ready, I should have been explicit.

@tenninebt

Copy link
Copy Markdown
Contributor Author

Superseded by #12880 (consolidated Android/iOS/web implementations PR).

@tenninebt tenninebt closed this Sep 18, 2026
auto-submit Bot pushed a commit that referenced this pull request Sep 24, 2026
…ns (#12880)

## Summary

- Platform implementations of `onPointOfInterestTap` for **Android**, **iOS** (`sdk9` / `sdk10` + shared source), and **web**
- Depends on published `google_maps_flutter_platform_interface` 2.17.0 from #12752
- Federated implementations PR (per [Changing federated plugins](https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins)); app-facing package will follow in a separate PR

**Notes**
- Frozen `google_maps_flutter_ios` is intentionally unchanged (no new features per that package’s README); iOS support is in `google_maps_flutter_ios_sdk9` / `google_maps_flutter_ios_sdk10`
- iOS DI follows the Swift controller conventions (required `callbackHandler` on the designated initializer)

Supersedes the separate drafts #12881 (web) and #12882 (iOS).

Part of #11872 / flutter/flutter#60695.

## Pre-Review Checklist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants