Skip to content

Conversation

@harryterkelsen
Copy link
Contributor

@harryterkelsen harryterkelsen commented Jul 9, 2025

Fixes #163288
Fixes #164405

The previous behavior of RenderWebImage for layout and positioning did not work for all values of BoxFit and AlignmentGeometry. This PR gets RenderWebImage to properly lay out and offset its child (the <img> element).

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@harryterkelsen harryterkelsen requested a review from mdebbar July 9, 2025 21:33
@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 9, 2025
// sized image would need to put the sub-rectangle given by
// `Alignment.inscribe` at the origin, and then scale that offset by the
// same scale computed above to get the offset for the child.
final Rect sourceRect = _resolvedAlignment!.inscribe(sourceSize, Offset.zero & inputSize);
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not taking into account _flipHorizontally here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

matchTextDirection support isn't implemented yet. I'll file an issue for it

@harryterkelsen
Copy link
Contributor Author

Thanks! I made a more robust example app to work out issues in the implementation. Everything seems to work correctly now:

Screen.Recording.2025-07-10.at.2.20.14.PM.mov

@harryterkelsen
Copy link
Contributor Author

harryterkelsen commented Jul 10, 2025

This breaks a customer test which depends on NetworkImage.toString(). I updated NetworkImage.toString() to show the values for webHtmlElementStrategy and headers since those are used in == so I think they should be in the toString()

I have a fix here: flutter/packages#9590

Once it lands I'll update the customer_tests

harryterkelsen added a commit to flutter/packages that referenced this pull request Jul 11, 2025
This is needed to land flutter/flutter#171916,
which updates `NetworkImage.toString()`. Checking against `toString()`
is flaky anyways.

## Pre-Review Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] page, which explains my
responsibilities.
- [x] I read and followed the [relevant style guides] and ran [the
auto-formatter].
- [x] I signed the [CLA].
- [x] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [x] I [linked to at least one issue that this PR fixes] in the
description above.
- [x] I updated `pubspec.yaml` with an appropriate new version according
to the [pub versioning philosophy], or I have commented below to
indicate which [version change exemption] this PR falls under[^1].
- [x] I updated `CHANGELOG.md` to add a description of the change,
[following repository CHANGELOG style], or I have commented below to
indicate which [CHANGELOG exemption] this PR falls under[^1].
- [x] I updated/added any relevant documentation (doc comments with
`///`).
- [x] I added new tests to check the change I am making, or I have
commented below to indicate which [test exemption] this PR falls
under[^1].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

[^1]: Regular contributors who have demonstrated familiarity with the
repository guidelines only need to comment if the PR is not
auto-exempted by repo tooling.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[relevant style guides]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[the auto-formatter]:
https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[linked to at least one issue that this PR fixes]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[pub versioning philosophy]: https://dart.dev/tools/pub/versioning
[version change exemption]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version
[following repository CHANGELOG style]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style
[CHANGELOG exemption]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog
[test exemption]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
@harryterkelsen
Copy link
Contributor Author

flutter/packages PR has landed. Now waiting for the flutter/tests PR to land so I can update the tests.version

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

LGTM

@harryterkelsen harryterkelsen added this pull request to the merge queue Jul 16, 2025
Merged via the queue into flutter:master with commit 97aae2a Jul 16, 2025
149 checks passed
@harryterkelsen harryterkelsen deleted the networkimage-aspectratio-distorted branch July 16, 2025 21:04
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 17, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 17, 2025
flutter/flutter@c2739f0...9c626d9

2025-07-17 [email protected] Roll Skia from 5b4afa58289a to 3673a1f26a63 (1 revision) (flutter/flutter#172274)
2025-07-17 [email protected] Roll Fuchsia Linux SDK from JRFUXSNXExcfjVYvA... to HXdm7P0a4ZJVm_TE-... (flutter/flutter#172268)
2025-07-17 [email protected] Roll Dart SDK from d71df90177e4 to 486f9c0663bc (1 revision) (flutter/flutter#172269)
2025-07-17 [email protected] Roll Skia from 3ad1aace3e02 to 5b4afa58289a (3 revisions) (flutter/flutter#172264)
2025-07-17 [email protected] Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (flutter/flutter#172090)
2025-07-17 [email protected] Licenses cpp 716 (flutter/flutter#172261)
2025-07-16 [email protected] Remove emoji from ci.yaml, because we still live with CP1252 for some silly reason (flutter/flutter#172256)
2025-07-16 [email protected] Roll Skia from bf3f9b77d3a8 to 3ad1aace3e02 (11 revisions) (flutter/flutter#172255)
2025-07-16 [email protected] Sync `CHANGELOG.md` (3.32.7) to `master` branch (flutter/flutter#172253)
2025-07-16 [email protected] Properly lay out and position RenderWebImage (flutter/flutter#171916)
2025-07-16 [email protected] Remove dead link in the doc index. (flutter/flutter#172240)
2025-07-16 [email protected] Roll Dart SDK from 766ee8029b11 to d71df90177e4 (1 revision) (flutter/flutter#172243)
2025-07-16 [email protected] Fix use of `Join-Path` in `last_engine_commit.ps1`(poweshell) (flutter/flutter#172242)
2025-07-16 [email protected] Marks Linux_pixel_7pro integration_ui_driver to be unflaky (flutter/flutter#172213)
2025-07-16 [email protected] [skwasm] Decrease reliance on finalizers/GC (flutter/flutter#172187)
2025-07-16 [email protected] Use `release-*.version` to simplify `last_engine_commit.sh` (no branch operations) (flutter/flutter#172236)
2025-07-16 [email protected] Roll Skia from 59be8479c637 to bf3f9b77d3a8 (7 revisions) (flutter/flutter#172233)
2025-07-16 [email protected] [web] Remove all usages of js_util. (flutter/flutter#171871)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 28, 2025
Fixes flutter#163288
Fixes flutter#164405

The previous behavior of `RenderWebImage` for layout and positioning did
not work for all values of `BoxFit` and `AlignmentGeometry`. This PR
gets `RenderWebImage` to properly lay out and offset its child (the
`<img>` element).

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
This is needed to land flutter/flutter#171916,
which updates `NetworkImage.toString()`. Checking against `toString()`
is flaky anyways.

## Pre-Review Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] page, which explains my
responsibilities.
- [x] I read and followed the [relevant style guides] and ran [the
auto-formatter].
- [x] I signed the [CLA].
- [x] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [x] I [linked to at least one issue that this PR fixes] in the
description above.
- [x] I updated `pubspec.yaml` with an appropriate new version according
to the [pub versioning philosophy], or I have commented below to
indicate which [version change exemption] this PR falls under[^1].
- [x] I updated `CHANGELOG.md` to add a description of the change,
[following repository CHANGELOG style], or I have commented below to
indicate which [CHANGELOG exemption] this PR falls under[^1].
- [x] I updated/added any relevant documentation (doc comments with
`///`).
- [x] I added new tests to check the change I am making, or I have
commented below to indicate which [test exemption] this PR falls
under[^1].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

[^1]: Regular contributors who have demonstrated familiarity with the
repository guidelines only need to comment if the PR is not
auto-exempted by repo tooling.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[relevant style guides]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[the auto-formatter]:
https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[linked to at least one issue that this PR fixes]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[pub versioning philosophy]: https://dart.dev/tools/pub/versioning
[version change exemption]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version
[following repository CHANGELOG style]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style
[CHANGELOG exemption]:
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog
[test exemption]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…r#9641)

flutter/flutter@c2739f0...9c626d9

2025-07-17 [email protected] Roll Skia from 5b4afa58289a to 3673a1f26a63 (1 revision) (flutter/flutter#172274)
2025-07-17 [email protected] Roll Fuchsia Linux SDK from JRFUXSNXExcfjVYvA... to HXdm7P0a4ZJVm_TE-... (flutter/flutter#172268)
2025-07-17 [email protected] Roll Dart SDK from d71df90177e4 to 486f9c0663bc (1 revision) (flutter/flutter#172269)
2025-07-17 [email protected] Roll Skia from 3ad1aace3e02 to 5b4afa58289a (3 revisions) (flutter/flutter#172264)
2025-07-17 [email protected] Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (flutter/flutter#172090)
2025-07-17 [email protected] Licenses cpp 716 (flutter/flutter#172261)
2025-07-16 [email protected] Remove emoji from ci.yaml, because we still live with CP1252 for some silly reason (flutter/flutter#172256)
2025-07-16 [email protected] Roll Skia from bf3f9b77d3a8 to 3ad1aace3e02 (11 revisions) (flutter/flutter#172255)
2025-07-16 [email protected] Sync `CHANGELOG.md` (3.32.7) to `master` branch (flutter/flutter#172253)
2025-07-16 [email protected] Properly lay out and position RenderWebImage (flutter/flutter#171916)
2025-07-16 [email protected] Remove dead link in the doc index. (flutter/flutter#172240)
2025-07-16 [email protected] Roll Dart SDK from 766ee8029b11 to d71df90177e4 (1 revision) (flutter/flutter#172243)
2025-07-16 [email protected] Fix use of `Join-Path` in `last_engine_commit.ps1`(poweshell) (flutter/flutter#172242)
2025-07-16 [email protected] Marks Linux_pixel_7pro integration_ui_driver to be unflaky (flutter/flutter#172213)
2025-07-16 [email protected] [skwasm] Decrease reliance on finalizers/GC (flutter/flutter#172187)
2025-07-16 [email protected] Use `release-*.version` to simplify `last_engine_commit.sh` (no branch operations) (flutter/flutter#172236)
2025-07-16 [email protected] Roll Skia from 59be8479c637 to bf3f9b77d3a8 (7 revisions) (flutter/flutter#172233)
2025-07-16 [email protected] [web] Remove all usages of js_util. (flutter/flutter#171871)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
Fixes flutter#163288
Fixes flutter#164405

The previous behavior of `RenderWebImage` for layout and positioning did
not work for all values of `BoxFit` and `AlignmentGeometry`. This PR
gets `RenderWebImage` to properly lay out and offset its child (the
`<img>` element).

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
Fixes flutter#163288
Fixes flutter#164405

The previous behavior of `RenderWebImage` for layout and positioning did
not work for all values of `BoxFit` and `AlignmentGeometry`. This PR
gets `RenderWebImage` to properly lay out and offset its child (the
`<img>` element).

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
github-merge-queue bot pushed a commit that referenced this pull request Oct 20, 2025
Fix a bug introduced by 97aae2a (#171916), where `hashCode` is giving
different results for values which `==` says are equal. Which broke
caching for uses of `Image.network` widget when `headers` map was
passed.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
Fixes flutter#163288
Fixes flutter#164405

The previous behavior of `RenderWebImage` for layout and positioning did
not work for all values of `BoxFit` and `AlignmentGeometry`. This PR
gets `RenderWebImage` to properly lay out and offset its child (the
`<img>` element).

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…#176831)

Fix a bug introduced by 97aae2a (flutter#171916), where `hashCode` is giving
different results for values which `==` says are equal. Which broke
caching for uses of `Image.network` widget when `headers` map was
passed.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Web] image is cached with webHtmlElementStrategy The image aspect ratio is distorted when using the webHtmlElementStrategy property.

2 participants