-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Flutter web add support for NetworkImage headers #85954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter web add support for NetworkImage headers #85954
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. 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. |
|
@jonas-martinez Can you please add a test for this? |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
@googlebot I fixed it. |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
@googlebot I fixed it. |
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@googlebot I consent. |
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@googlebot I consent. |
28ea584 to
f5aeaea
Compare
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #85954 at sha 2bcf390cf5c7a7925682df7bb8c4235619644e22 |
|
This PR needs a test. |
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #85954 at sha fe9e942012dc7c838ebc66bcda0c1af2e4d3f8ba |
|
(PR triage): @jonas-martinez do you still have plans to come back to this PR to add some tests? |
@goderbauer I recently tried to add some tests, I could not figure out a way to make them work properly. I will not be able to work on that for 2 weeks so during this time any idea or implementation about how to add good tests to this PR would be welcomed. Sorry for the delay |
|
We'd probably need a test that's similar to the engine variant (the first interesting test there is probably "skiaInstantiateWebImageCodec loads an image from the network"). Since the test would be testing web-specific functionality, I would suggest to also use conditional imports in the test and import When using conditional imports you need to provide both a web version and a mobile version. Since there's nothing to test for the mobile version, you can make it a noop, just an empty function that doesn't test anything (example). Here's a rough sketch: // network_image_web_test.dart
import '_network_image_web_io_test.dart' if (dart.library.html) '_network_image_web_test.dart';
void main() {
runTests();
}
// _network_image_web_io_test.dart
void runTests() {
// This is a web-specific test. Nothing to do for AOT engine.
}
// _network_image_web_test.dart
void runTests() {
test('loads an image from the network', () {
...
});
} |
3af46e6 to
fa3027c
Compare
Thank you @nt4f04uNd ! Problem solved |
|
(triage) Looks like all this needs is a secondary review now. I've asked on discord if somebody is up for it. |
|
What is the state with this feature ? |
This PR adds support for headers in the NetworkImage widget for Flutter Web. The documentation for the
headersproperty mentionsWhen running flutter on the web, headers are not used.which should not be the case or at least this property should be removed as it can be confusing.Our specific use case was that we needed to pass an
Authorizationheader using theImage.networkcomponent which was not possible using Flutter Web.Fixes 57187
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.