Skip to content

[google_maps_flutter] Convert remaining code to Swift - #12768

Merged
auto-submit[bot] merged 16 commits into
flutter:mainfrom
stuartmorgan-g:maps-swift-final
Sep 12, 2026
Merged

auto-submit[bot] merged 16 commits into
flutter:mainfrom
stuartmorgan-g:maps-swift-final

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Converts remaining code to Swift:

  • Converts the protocols defined for testability to Swift
    • Where possible, replaces manual passthrough classes with extensions that add protocol conformance to the actual class, reducing the amount of untestable code we need.
  • Switches Pigeon generation to Swift (which causes a lot of mechanical changes due to classes no longer having a prefix, and the constructors being standard Swift construction instead of bridging to Obj-C convenience constructors)
  • Uses Pigeon's Swift generator support for subclassing to replace the somewhat hacky nested classes in the interface definition with the actual subclassing that we wanted to express, simplifying some code and adding more type safety.
  • Scrubs NSObject conformance from cases where it's no longer necessary. (Class that implement Flutter plugin API protocols still need it, as those are Obj-C protocols.)

Unlike the other PRs, this does not contain any Gemini Obj-C -> Swift conversions (other than some simple protocols); this is mostly just a Pigeon generation change and a lot of mostly mechanical cleanup.

Fixes flutter/flutter#119108

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 converts the remaining Objective-C code to Swift for both the google_maps_flutter_ios_sdk9 and google_maps_flutter_ios_sdk10 packages. This includes updating the Pigeon configuration to generate Swift code, removing Objective-C files, and refactoring Swift implementation and test files to use the new Swift-generated Pigeon APIs. Two minor typos were identified in the changelog files.

Comment thread packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md Outdated
Comment thread packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md Outdated

@hellohuanlin hellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks clean!

func clusters(withIdentifier identifier: String) throws -> [PlatformCluster] {
guard let clusterManager = clusterManagerIdentifierToManagers[identifier] else {
error.pointee = FlutterError(
throw PigeonError(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice, just curious, was the error.pointee from the objc pigeon?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the AutoreleasingUnsafeMutablePointer<FlutterError?> error is the Swift expression of the Obj-C error out param object pattern (with FlutterError** in this case instead of NSError**).

return GMUGradient(
colors: colors,
startPoints: startPoints,
startPoints: startPoints.map({ $0 as NSNumber }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: startPoints.map { $0 as NSNumber }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed for all instances of map({ ... }) (there were some from the previous PRs in this sequence as well).

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 12, 2026
@auto-submit
auto-submit Bot merged commit ac146c5 into flutter:main Sep 12, 2026
13 checks passed
dkwingsmt pushed a commit to dkwingsmt/flutter that referenced this pull request Sep 15, 2026
…r#192809)

flutter/packages@9caa77c...bebbb57

2026-09-15 [email protected]
[google_maps_flutter_platform_interface] Add onPointOfInterestTap
support (flutter/packages#12752)
2026-09-14 [email protected] [google_maps_flutter] Adopts new
async/await Swift Pigeon support (flutter/packages#12860)
2026-09-14 [email protected]
[material_ui] Fix `todayBorder` color being overridden by
`todayForegroundColor` in `YearPicker` (flutter/packages#12697)
2026-09-13 [email protected] Roll Flutter from
2553f89 to 8b3e8f5 (4 revisions) (flutter/packages#12856)
2026-09-12 [email protected] [google_maps_flutter] Convert
remaining code to Swift (flutter/packages#12768)
2026-09-12 [email protected] Roll Flutter from
63b9518 to 2553f89 (62 revisions) (flutter/packages#12855)
2026-09-12 [email protected] Roll Flutter (stable) from
d3b14c8 to 9584c67 (15 revisions) (flutter/packages#12854)
2026-09-12 [email protected] [material_ui]
Update gen_defaults color helper (flutter/packages#12846)
2026-09-11 [email protected] [material_ui] Port
flutter/flutter flutter#185475 "Accessibility: Add semanticLabel to MenuAnchor"
(flutter/packages#12806)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: google_maps_flutter platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_maps_flutter] iOS Swift migration

2 participants