Skip to content
Copy link
Collaborator

Choose a reason for hiding this comment

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

The changes to this file can be reverted as well; we don't need to CHANGELOG an integration test comment.

Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.16.2

* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`.

## 2.16.1

* Removes obsolete code related to supporting SDK <21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,7 @@ Marker _copyMarkerWithClusterManagerId(
position: marker.position,
rotation: marker.rotation,
visible: marker.visible,
// The deprecated parameter is used here to avoid losing precision.
zIndex: marker.zIndex,
onTap: marker.onTap,
onDragStart: marker.onDragStart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../
google_maps_flutter_platform_interface: ^2.11.0
google_maps_flutter_platform_interface: ^2.12.1

dev_dependencies:
build_runner: ^2.1.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_android
description: Android implementation of the google_maps_flutter plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.16.1
version: 2.16.2

environment:
sdk: ^3.6.0
Expand All @@ -21,7 +21,7 @@ dependencies:
flutter:
sdk: flutter
flutter_plugin_android_lifecycle: ^2.0.1
google_maps_flutter_platform_interface: ^2.11.0
google_maps_flutter_platform_interface: ^2.12.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the PR again... do we actually need any of the changes to this file? It looks like the only actual change is to the integration tests and the example pubspec, and those don't require publishing the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case Im gonna close this PR. And since it doesn't need a new version, the main PR's overrides can all be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't it need to target the updated platform interface package though? Not sure if Im misunderstanding this line from the federated packages section

If new functionality is being added to the API surface of the app-facing package, be sure to update the version constraints of the implementation packages in its pubspec.yaml

Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't it need to target the updated platform interface package though?

What is "it" here? If it's google_maps_flutter_android, what part of the google_maps_flutter_android requires the new APIs added to the platform interface?

If it's the app-facing package (in the other PR), yes, because it's exporting that surface to clients.

Not sure if Im misunderstanding this line from the federated packages section

If new functionality is being added to the API surface of the app-facing package, be sure to update the version constraints of the implementation packages in its pubspec.yaml

See the explanation in the following sentence for the reason this would need to be done.

For example, if the platform interface adds a new Future<void> foo() { throw UnimplementedError(); }, and all the platforms are updated to implement foo(), and the app-facing package is updated to call foo(), we don't want a valid set of resolved packages where clients can get the updated version of the app-facing and platform interface packages, but not the implementation packages, such that everything compiles but all calls to foo() throw.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok got it. For android we dont't need a new version. I guess even web doesn't need a new version by the same logic since that's just a comment change?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess even web doesn't need a new version by the same logic since that's just a comment change?

Correct; IIRC the tooling will do the right thing with a comment-only change, but if not we can override the version check.

stream_transform: ^2.0.0

dev_dependencies:
Expand All @@ -30,7 +30,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.4.4
pigeon: ^22.6.0
pigeon: ^22.7.4
plugin_platform_interface: ^2.1.7

topics:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.15.3

* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`.
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.

## 2.15.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../../
google_maps_flutter_platform_interface: ^2.11.0
google_maps_flutter_platform_interface: ^2.12.1
maps_example_dart:
path: ../shared/maps_example_dart/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../../
google_maps_flutter_platform_interface: ^2.11.0
google_maps_flutter_platform_interface: ^2.12.1
maps_example_dart:
path: ../shared/maps_example_dart/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ class PlaceMarkerBodyState extends State<PlaceMarkerBody> {

Future<void> _changeZIndex(MarkerId markerId) async {
final Marker marker = markers[markerId]!;
final double current = marker.zIndex;
final int current = marker.zIndexInt;
setState(() {
markers[markerId] = marker.copyWith(
zIndexParam: current == 12.0 ? 0.0 : current + 1.0,
zIndexIntParam: current == 12 ? 0 : current + 1,
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../../../
google_maps_flutter_platform_interface: ^2.11.0
google_maps_flutter_platform_interface: ^2.12.1

dev_dependencies:
flutter_test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_ios
description: iOS implementation of the google_maps_flutter plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.15.2
version: 2.15.3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly, the only change to this package is to a file in the example app that's not the one visible on pub.dev, so this should be exempt from versioning.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Although, why is only the example changing for iOS? Shouldn't it be using zIndexInt instead of the deprecated zIndex now, since it can't use any fractional values anyway?

Copy link
Contributor Author

@Hari-07 Hari-07 Jun 10, 2025

Choose a reason for hiding this comment

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

You're right, not sure how that ended up getting removed or at what point. I think the reasonable thing to do would be to make ios's PlatformMarker expect an integral zIndex, so that this truncation would now be a type error to which we can pass zIndexInt

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed, the iOS changes look good here.

Based on the CI failure though, it appears that the Obj-C compiler flags 64-bit int assignment to 32-bit int assignment as lossy, but did not flag it when it was assigning a double to a 32-bit int. Odd, but you'll need to add an explicit cast here to make the analysis check happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's seems reasonable from flags.
-Wno-float-conversion looks like it allows implicit float conversion which is what was happening
-Wshorten-64-to-32 would disallow the long to int cast that's happening at the line you pointed out


environment:
sdk: ^3.6.0
Expand All @@ -19,7 +19,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
google_maps_flutter_platform_interface: ^2.11.0
google_maps_flutter_platform_interface: ^2.12.1
stream_transform: ^2.0.0

dev_dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.5.12+1

* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`.
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.

## 0.5.12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,5 +536,20 @@ void main() {
expect(icon2.anchor!.x, width * anchorOffset.dx);
expect(icon2.anchor!.y, height * anchorOffset.dy);
});

testWidgets('interpret correct zIndex in convertsion',
(WidgetTester tester) async {
const MarkerId markerId = MarkerId('1');

final Set<Marker> markers = <Marker>{
const Marker(markerId: markerId, zIndexInt: 4),
};

await controller.addMarkers(markers);

final gmaps.Marker? gmMarker = controller.markers[markerId]?.marker;
expect(gmMarker, isNotNull);
expect(gmMarker!.zIndex, 4);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
dependencies:
flutter:
sdk: flutter
google_maps_flutter_platform_interface: ^2.10.0
google_maps_flutter_platform_interface: ^2.12.1
google_maps_flutter_web:
path: ../
web: ^1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ gmaps.InfoWindowOptions? _infoWindowOptionsFromMarker(Marker marker) {

return gmaps.InfoWindowOptions()
..content = container
// The deprecated parameter is used here to avoid losing precision.
..zIndex = marker.zIndex;
// TODO(ditman): Compute the pixelOffset of the infoWindow, from the size of the Marker,
// and the marker.infoWindow.anchor property.
Expand Down Expand Up @@ -453,8 +454,8 @@ Future<gmaps.Icon?> _gmIconFromBitmapDescriptor(
return icon;
}

// Computes the options for a new [gmaps.Marker] from an incoming set of options
// [marker], and the existing marker registered with the map: [currentMarker].
/// Computes the options for a new [gmaps.Marker] from an incoming set of options
/// [marker], and the existing marker registered with the map: [currentMarker].
Future<gmaps.MarkerOptions> _markerOptionsFromMarker(
Marker marker,
gmaps.Marker? currentMarker,
Expand All @@ -465,6 +466,7 @@ Future<gmaps.MarkerOptions> _markerOptionsFromMarker(
marker.position.longitude,
)
..title = sanitizeHtml(marker.infoWindow.title ?? '')
// The deprecated parameter is used here to avoid losing precision.
..zIndex = marker.zIndex
..visible = marker.visible
..opacity = marker.alpha
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_web
description: Web platform implementation of google_maps_flutter
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 0.5.12
version: 0.5.12+1

environment:
sdk: ^3.6.0
Expand All @@ -23,7 +23,7 @@ dependencies:
flutter_web_plugins:
sdk: flutter
google_maps: ^8.0.0
google_maps_flutter_platform_interface: ^2.10.0
google_maps_flutter_platform_interface: ^2.12.1
sanitize_html: ^2.0.0
stream_transform: ^2.0.0
web: ">=0.5.1 <2.0.0"
Expand Down