Skip to content

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

Open
stuartmorgan-g wants to merge 1 commit intoflutter:mainfrom
stuartmorgan-g:maps-zindex-deprecation
Open

[google_maps_flutter] Replace use of zIndex in examples and tests#11572
stuartmorgan-g wants to merge 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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant