Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.12.1

* Fixes the `zIndex` issue in the `copyWith` method.

## 2.12.0

* Deprecates `zIndex` parameter in `Marker` in favor of `zIndexInt`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ class Marker implements MapsObject<Marker> {
ValueChanged<LatLng>? onDragEndParam,
ClusterManagerId? clusterManagerIdParam,
}) {
assert(zIndexParam == null || zIndexIntParam == null,
'Only one of zIndexParam and zIndexIntParam can be provided');
return Marker(
markerId: markerId,
alpha: alphaParam ?? alpha,
Expand All @@ -292,8 +294,7 @@ class Marker implements MapsObject<Marker> {
position: positionParam ?? position,
rotation: rotationParam ?? rotation,
visible: visibleParam ?? visible,
zIndex: zIndexParam ?? zIndex,
zIndexInt: zIndexIntParam ?? zIndexInt,
zIndex: zIndexIntParam?.toDouble() ?? zIndexParam ?? zIndex,
onTap: onTapParam ?? onTap,
onDragStart: onDragStartParam ?? onDragStart,
onDrag: onDragParam ?? onDrag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.12.0
version: 2.12.1

environment:
sdk: ^3.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,25 @@ void main() {
expect(marker.zIndexInt, 5);
expect(marker.zIndex, 5.00);
});

test('zIndexInt param copyWith', () {
const Marker marker = Marker(
markerId: MarkerId('ABC123'),
zIndexInt: 5,
);
final Marker copy = marker.copyWith(zIndexIntParam: 10);
expect(copy.zIndexInt, 10);
expect(copy.zIndex, 10.0);
});

test('zIndex param copyWith', () {
const Marker marker = Marker(
markerId: MarkerId('ABC123'),
zIndexInt: 5,
);
final Marker copy = marker.copyWith(zIndexParam: 10.0);
expect(copy.zIndexInt, 10);
expect(copy.zIndex, 10.0);
});
});
}