You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5a23f82
Browse filesBrowse the repository at this point in the historyBrowse files
[google_maps_flutter] Convert overlay controllers to Swift (flutter#12638)
This converts GroundOverlayController and TileOverlayController 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.
This includes test changes beyond what we would normally expect for a language conversion PR (e.g., name changes from dropping the prefix) because the conversion to Swift exposed a latent issue in the tests. Several tests had a pattern where a helper method was creating a local `mapView` instance, using it to construct the subcontroller under test, and then returning that subcontroller—at which point the map view goes out of scope. The subcontrollers have weak references to the map view, so it can be deallocated before the test actually runs, and doing so causes the tests to fail (as many operations in the subcontroller no-op when the map view is nil). In cases where the helper is only used once, it can be inlined; in cases where it's used repeatedly we can instead return multiple values and keep the map view alive.
Part of 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.
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GroundOverlayControllerTests.swift
+33-20Lines changed: 33 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,12 @@ import Testing
9
9
10
10
@MainActorstructGroundOverlayControllerTests{
11
11
12
-
/// Returns a GroundOverlayController object instantiated with position and a mocked map
12
+
/// Returns a GroundOverlayController object instantiated with position, and its mocked map
13
13
/// instance.
14
+
///
15
+
/// The map must be retained for the life of the test.
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/RunnerTests-Bridging-Header.h
-6Lines changed: 0 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,5 @@
3
3
// found in the LICENSE file.
4
4
5
5
// Import private _Test.h headers from the plugin framework
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileOverlayControllerTests.swift
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileProviderControllerTests.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ class StubTileReceiver: NSObject, GMSTileReceiver {
17
17
// A tile provider that expects a single call to
18
18
// tileWithOverlayIdentifier:location:zoom:completion: on the main thread,
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -128,8 +128,8 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV
0 commit comments