Skip to content

[google_maps_flutter] Convert marker controllers to Swift - #12662

Merged
auto-submit[bot] merged 9 commits into
flutter:mainfrom
stuartmorgan-g:maps-swift-markers
Aug 31, 2026
Merged

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

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

This converts MarkerController and ClusterManagersController to Swift in the _sdk* packages.

The remaining Obj-C code will be migrated in a series of follow-up PRs to keep the scope of each PR reasonable for review.

The conversion process was:

  • Initial conversion via Gemini, with explicit instruction to keep the structure the same.
  • Side-by-side manual review of the old and new versions of the files.
  • Manual fixes and improvements.

Part of 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

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 27, 2026

@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 marker and cluster manager controllers from Objective-C to Swift across the google_maps_flutter_ios_sdk10, google_maps_flutter_ios_sdk9, and shared iOS codebases. The feedback recommends aligning the opening braces of function declarations to the same line in ConversionUtils.swift to adhere to Swift style guidelines. Additionally, it suggests simplifying the extraction of marker identifiers in pigeonCluster by replacing the filter and force-cast chain with a single, safer compactMap operation.

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

LGTM with a question

if let clusterManagerIdentifier = clusterManagerIdentifier {
let clusterManager = clusterManagersController?.clusterManager(
withIdentifier: clusterManagerIdentifier)
clusterManager?.add(marker)

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.

Does the marker not need to conform to GMUClusterItem?

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.

It's the reverse; it can't not conform to GMUClusterItem. The maps utils library that defines the GMU* types includes:

@interface GMSMarker (GMSMarker_GMUClusteritem) <GMUClusterItem>
@end

So the check that the Obj-C code had wasn't doing anything unless the type was somehow wrong, and with the stronger type checking of Swift that pointless check became a warning.

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

flutter/packages@d642322...7a7912f

2026-09-01 [email protected] [material_ui]
Migrate AppBar M3 template to use new gen_defaults script
(flutter/packages#12707)
2026-09-01 [email protected]
[vector_graphics] Fix deprecation lints (flutter/packages#12702)
2026-08-31 [email protected] [material_ui]
Standardize M3 and M3E token template base class names
(flutter/packages#12675)
2026-08-31 [email protected]
[vector_graphics_compiler] Fix deprecation issues in tests
(flutter/packages#12700)
2026-08-31 [email protected] [google_maps_flutter] Convert marker
controllers to Swift (flutter/packages#12662)
2026-08-31 [email protected] [material_ui, cupertino_ui, go_router]
Command to test dart fixes (flutter/packages#12390)
2026-08-31 [email protected] Roll Flutter from
c978386 to c8c5e3b (4 revisions) (flutter/packages#12706)
2026-08-31 [email protected] [tool]
Exempt AGENTS.md from version and changelog checks
(flutter/packages#12681)

If this roll has caused a breakage, revert this CL and stop the roller
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
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
)

This converts MarkerController and ClusterManagersController to Swift in the `_sdk*` packages.

The remaining Obj-C code will be migrated in a series of follow-up PRs to keep the scope of each PR reasonable for review.

The conversion process was:
- Initial conversion via Gemini, with explicit instruction to keep the structure the same.
- Side-by-side manual review of the old and new versions of the files.
- Manual fixes and improvements.

Part of flutter/flutter#119108

## Pre-Review Checklist

[^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.
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
)

This converts MarkerController and ClusterManagersController to Swift in the `_sdk*` packages.

The remaining Obj-C code will be migrated in a series of follow-up PRs to keep the scope of each PR reasonable for review.

The conversion process was:
- Initial conversion via Gemini, with explicit instruction to keep the structure the same.
- Side-by-side manual review of the old and new versions of the files.
- Manual fixes and improvements.

Part of flutter/flutter#119108

## Pre-Review Checklist

[^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.
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.

2 participants