Skip to content

[google_maps_flutter] Replace use of zIndex in examples and tests#11572

Merged
auto-submit[bot] merged 1 commit intoflutter:mainfrom
stuartmorgan-g:maps-zindex-deprecation
Apr 29, 2026
Merged

[google_maps_flutter] Replace use of zIndex in examples and tests#11572
auto-submit[bot] merged 1 commit intoflutter:mainfrom
stuartmorgan-g:maps-zindex-deprecation

Conversation

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

Replaces uses of the deprecated zIndex in examples and tests with the preferred zIndexInt.

This doesn't change the production use of zIndex in google_maps_flutter_web, as that could change behavior, so should stay for now.

Replaces uses of the deprecated `zIndex` in examples and tests with the
preferred `zIndexInt`.

This doesn't change the production use of `zIndex` in
google_maps_flutter_web, as that could change behavior, so should stay
for now.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the deprecated double-based zIndex property with the integer-based zIndexInt across the Google Maps Flutter Android and iOS packages, including their respective examples and tests. The changes update marker creation, z-index modification logic, and test assertions to use the new integer property. Reviewer feedback suggests further consistency by updating parameter names and test expectation properties to fully utilize the zIndexInt API.

rotation: marker.rotation,
visible: marker.visible,
zIndex: marker.zIndex.toInt(),
zIndex: marker.zIndexInt,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex parameter, consider using zIndexInt here as well, as it is the preferred parameter for AdvancedMarker.

Suggested change
zIndex: marker.zIndexInt,
zIndexInt: marker.zIndexInt,

expect(firstChanged.rotation, object2new.rotation);
expect(firstChanged.visible, object2new.visible);
expect(firstChanged.zIndex, object2new.zIndex);
expect(firstChanged.zIndex, object2new.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstChanged.zIndex, object2new.zIndexInt);
expect(firstChanged.zIndexInt, object2new.zIndexInt);

expect(firstAdded.rotation, object3.rotation);
expect(firstAdded.visible, object3.visible);
expect(firstAdded.zIndex, object3.zIndex);
expect(firstAdded.zIndex, object3.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstAdded.zIndex, object3.zIndexInt);
expect(firstAdded.zIndexInt, object3.zIndexInt);

rotation: marker.rotation,
visible: marker.visible,
zIndex: marker.zIndex.toInt(),
zIndex: marker.zIndexInt,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex parameter, consider using zIndexInt here as well, as it is the preferred parameter for AdvancedMarker.

Suggested change
zIndex: marker.zIndexInt,
zIndexInt: marker.zIndexInt,

expect(firstChanged.rotation, object2new.rotation);
expect(firstChanged.visible, object2new.visible);
expect(firstChanged.zIndex, object2new.zIndex);
expect(firstChanged.zIndex, object2new.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstChanged.zIndex, object2new.zIndexInt);
expect(firstChanged.zIndexInt, object2new.zIndexInt);

expect(firstChanged.rotation, object2new.rotation);
expect(firstChanged.visible, object2new.visible);
expect(firstChanged.zIndex, object2new.zIndex);
expect(firstChanged.zIndex, object2new.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstChanged.zIndex, object2new.zIndexInt);
expect(firstChanged.zIndexInt, object2new.zIndexInt);

expect(firstAdded.rotation, object3.rotation);
expect(firstAdded.visible, object3.visible);
expect(firstAdded.zIndex, object3.zIndex);
expect(firstAdded.zIndex, object3.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstAdded.zIndex, object3.zIndexInt);
expect(firstAdded.zIndexInt, object3.zIndexInt);

rotation: marker.rotation,
visible: marker.visible,
zIndex: marker.zIndex.toInt(),
zIndex: marker.zIndexInt,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex parameter, consider using zIndexInt here as well, as it is the preferred parameter for AdvancedMarker.

Suggested change
zIndex: marker.zIndexInt,
zIndexInt: marker.zIndexInt,

expect(firstChanged.rotation, object2new.rotation);
expect(firstChanged.visible, object2new.visible);
expect(firstChanged.zIndex, object2new.zIndex);
expect(firstChanged.zIndex, object2new.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstChanged.zIndex, object2new.zIndexInt);
expect(firstChanged.zIndexInt, object2new.zIndexInt);

expect(firstAdded.rotation, object3.rotation);
expect(firstAdded.visible, object3.visible);
expect(firstAdded.zIndex, object3.zIndex);
expect(firstAdded.zIndex, object3.zIndexInt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To fully migrate away from the deprecated zIndex property, consider using zIndexInt on the expected object as well, assuming it has been updated in the platform interface.

Suggested change
expect(firstAdded.zIndex, object3.zIndexInt);
expect(firstAdded.zIndexInt, object3.zIndexInt);

Copy link
Copy Markdown
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

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

LGTM

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 29, 2026
@auto-submit auto-submit Bot merged commit 5653b5a into flutter:main Apr 29, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD override: no changelog needed Override the check requiring CHANGELOG updates for most changes p: google_maps_flutter platform-android platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants