Skip to content

Commit 77705cb

Browse files
[google_maps_flutter] Convert top-level classes to Swift in _sdk* packages (flutter#12307)
This converts GoogleMapsPlugin, GoogleMapFactory, and GoogleMapController to Swift, and restructures the source code to typical migration state of having the Swift code be the primary target, depending on a new `*_objc` target that contains the unmigrated code. Because `google_maps_flutter_ios` cannot adopt Swift (see discussion in linked issue), this removes that package from the code sharing. Going forward, development will be limited to the `_sdk*` packages. For reasons explained [here](flutter/flutter#119108 (comment)), the Pigeon API layer is still Objective-C for now, which does lead to some temporary non-ideal code in GoogleMapController. That will be cleaned up in the last step when we are able to switch to Swift Pigeon generation. 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. The last step was more extensive than usual because the init method had longstanding design issues (flutter/flutter#104121) that became hard errors under Swift. There was some refactoring of helper methods and reordering of initialization steps to make the code work with the strict two-phase init process. Part of flutter/flutter#119108 Fixes flutter/flutter#104121 ## 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.
1 parent 33512cb commit 77705cb

163 files changed

Lines changed: 3368 additions & 4073 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.18.5
2+
3+
* Updates README to indicate that this package will not receive feature updates
4+
going forward. Please see the README for information about adopting one of
5+
the maintained implementation packages.
6+
17
## 2.18.4
28

39
* Fixes a potential compilation issue in tile downscaling.
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Code sharing
22

3-
This package shares most of its code with the other `google_maps_flutter_ios_*`
4-
packages in this repository, so after changing any code files in this package
5-
run:
6-
`dart run tool/sync_shared_files.dart`
7-
8-
See [the shared directory README](../google_maps_flutter_ios_shared_code/README.md)
9-
for more details.
3+
This package is essentially frozen; future development is only expected to
4+
happen in the `_sdk*` variants, as this package cannot share code due to
5+
being unable to adopt Swift. Only critical fixes should be made in this
6+
package.

‎packages/google_maps_flutter/google_maps_flutter_ios/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The default iOS implementation of [`google_maps_flutter`][1].
55
This package will use Google Maps SDK 8.4, 9.x, or 10.x, depending on your
66
application's minimum deployment target.
77

8+
**Note**: This package will not receive new feature updates. All clients are
9+
encouraged to adopt one of the [SDK-specific implementations](#alternate-implementations).
10+
811
## Usage
912

1013
This package is [endorsed][2], which means you can simply use

‎packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter_ios
22
description: iOS implementation of the google_maps_flutter plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5-
version: 2.18.4
5+
version: 2.18.5
66

77
environment:
88
sdk: ^3.10.0

‎packages/google_maps_flutter/google_maps_flutter_ios/tool/run_tests.dart‎

Lines changed: 0 additions & 184 deletions
This file was deleted.

‎packages/google_maps_flutter/google_maps_flutter_ios/tool/sync_shared_files.dart‎

Lines changed: 0 additions & 142 deletions
This file was deleted.

‎packages/google_maps_flutter/google_maps_flutter_ios/tool/unshared_source_files.dart‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)