File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed
packages/google_maps_flutter/google_maps_flutter_platform_interface Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.12.1
2
+
3
+ * Fixes the ` zIndex ` issue in the ` copyWith ` method.
4
+
1
5
## 2.12.0
2
6
3
7
* Deprecates ` zIndex ` parameter in ` Marker ` in favor of ` zIndexInt ` .
Original file line number Diff line number Diff line change @@ -280,6 +280,8 @@ class Marker implements MapsObject<Marker> {
280
280
ValueChanged <LatLng >? onDragEndParam,
281
281
ClusterManagerId ? clusterManagerIdParam,
282
282
}) {
283
+ assert (zIndexParam == null || zIndexIntParam == null ,
284
+ 'Only one of zIndexParam and zIndexIntParam can be provided' );
283
285
return Marker (
284
286
markerId: markerId,
285
287
alpha: alphaParam ?? alpha,
@@ -292,8 +294,7 @@ class Marker implements MapsObject<Marker> {
292
294
position: positionParam ?? position,
293
295
rotation: rotationParam ?? rotation,
294
296
visible: visibleParam ?? visible,
295
- zIndex: zIndexParam ?? zIndex,
296
- zIndexInt: zIndexIntParam ?? zIndexInt,
297
+ zIndex: zIndexIntParam? .toDouble () ?? zIndexParam ?? zIndex,
297
298
onTap: onTapParam ?? onTap,
298
299
onDragStart: onDragStartParam ?? onDragStart,
299
300
onDrag: onDragParam ?? onDrag,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5
5
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
6
6
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7
- version : 2.12.0
7
+ version : 2.12.1
8
8
9
9
environment :
10
10
sdk : ^3.6.0
Original file line number Diff line number Diff line change @@ -201,5 +201,25 @@ void main() {
201
201
expect (marker.zIndexInt, 5 );
202
202
expect (marker.zIndex, 5.00 );
203
203
});
204
+
205
+ test ('zIndexInt param copyWith' , () {
206
+ const Marker marker = Marker (
207
+ markerId: MarkerId ('ABC123' ),
208
+ zIndexInt: 5 ,
209
+ );
210
+ final Marker copy = marker.copyWith (zIndexIntParam: 10 );
211
+ expect (copy.zIndexInt, 10 );
212
+ expect (copy.zIndex, 10.0 );
213
+ });
214
+
215
+ test ('zIndex param copyWith' , () {
216
+ const Marker marker = Marker (
217
+ markerId: MarkerId ('ABC123' ),
218
+ zIndexInt: 5 ,
219
+ );
220
+ final Marker copy = marker.copyWith (zIndexParam: 10.0 );
221
+ expect (copy.zIndexInt, 10 );
222
+ expect (copy.zIndex, 10.0 );
223
+ });
204
224
});
205
225
}
You can’t perform that action at this time.
0 commit comments