Skip to content

Commit 25d4fa4

Browse files
authored
[google_maps_flutter] Add a new zIndexInt param to marker and deprecate zIndex (#8012)
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* `zIndex` on marker is currently a double. This introduces inconsistency between its behaviours on android and ios since ios truncates it to an int. This PR aims to smooth out that difference by accepting an int param instead through the marker API in dart *List which issues are fixed by this PR. You must list at least one issue.* Fixes flutter/flutter#155897
1 parent 8929a93 commit 25d4fa4

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.12.3
2+
3+
* Updates the example app to use the zIndexInt param instead of the deprecated zIndex.
4+
15
## 2.12.2
26

37
* Fixes memory leak by disposing stream subscriptions in `GoogleMapController`.

packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_inspector.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ Marker _copyMarkerWithClusterManagerId(
889889
position: marker.position,
890890
rotation: marker.rotation,
891891
visible: marker.visible,
892-
zIndex: marker.zIndex,
892+
zIndexInt: marker.zIndexInt,
893893
onTap: marker.onTap,
894894
onDragStart: marker.onDragStart,
895895
onDrag: marker.onDrag,

packages/google_maps_flutter/google_maps_flutter/example/lib/place_marker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ class PlaceMarkerBodyState extends State<PlaceMarkerBody> {
249249

250250
Future<void> _changeZIndex(MarkerId markerId) async {
251251
final Marker marker = markers[markerId]!;
252-
final double current = marker.zIndex;
252+
final int current = marker.zIndexInt;
253253
setState(() {
254254
markers[markerId] = marker.copyWith(
255-
zIndexParam: current == 12.0 ? 0.0 : current + 1.0,
255+
zIndexIntParam: current == 12 ? 0 : current + 1,
256256
);
257257
});
258258
}

packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ dependencies:
1818
# The example app is bundled with the plugin so we use a path dependency on
1919
# the parent directory to use the current plugin's version.
2020
path: ../
21-
google_maps_flutter_android: ^2.16.0
22-
google_maps_flutter_platform_interface: ^2.11.0
21+
google_maps_flutter_android: ^2.16.1
22+
google_maps_flutter_platform_interface: ^2.12.1
2323

2424
dev_dependencies:
2525
build_runner: ^2.1.10

packages/google_maps_flutter/google_maps_flutter/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter
22
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5-
version: 2.12.2
5+
version: 2.12.3
66

77
environment:
88
sdk: ^3.6.0
@@ -21,9 +21,9 @@ flutter:
2121
dependencies:
2222
flutter:
2323
sdk: flutter
24-
google_maps_flutter_android: ^2.16.0
25-
google_maps_flutter_ios: ^2.15.0
26-
google_maps_flutter_platform_interface: ^2.11.0
24+
google_maps_flutter_android: ^2.16.1
25+
google_maps_flutter_ios: ^2.15.4
26+
google_maps_flutter_platform_interface: ^2.12.1
2727
google_maps_flutter_web: ^0.5.12
2828

2929
dev_dependencies:

0 commit comments

Comments
 (0)