-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Update image_list example to use https instead of http #39124
Conversation
Update image_list test to use locally set up https server to validate performance of image loading over https(rather than http) protocol. Https requires more back-and-forward communication before image bytes are sent to the client, shows clear signs of throughput affected by how busy flutter UI isolate is.
It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
|
@@ -19,7 +19,7 @@ class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkIm | |||
/// Creates an object that fetches the image at the given URL. | |||
/// | |||
/// The arguments [url] and [scale] must not be null. | |||
const NetworkImage(this.url, { this.scale = 1.0, this.headers }) | |||
const NetworkImage(this.url, { this.scale = 1.0, this.headers, this.certificate }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately yet another constructor parameter that is not web portable
Immediate need here is for image_list example to spin up local https(rather than http) server.
Since this parameter needs to be sent to image loading isolate it can't be native-wrapper class, which SecurityContext is. |
I think for the purposes of this test we can, I will give it a try. |
Definitely not, because it will constrain our ability to remove dart:io code for the web, where it isn't supported. |
Thanks for the suggestion @goderbauer . Created #39525 which uses |
Can we close this PR in favor of #39525? |
Sorry, I should have been more careful with checking |
Since the image isolate PR got rolled back: Is this PR still relevant for the time being? Seems like we can currently achieve the same with HttpOverrides? Should we close it for now and revisit once we have decided what to do with loading images in a separate isolate? |
Good point, I changed this PR so it is only about updating image_list example to use https instead of http. |
examples/image_list/lib/main.dart
Outdated
@override | ||
HttpClient createHttpClient(SecurityContext context) { | ||
return super.createHttpClient( | ||
SecurityContext()..setTrustedCertificatesBytes(certificate.codeUnits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering: Should this modify the context that gets passed in instead of creating a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Update image_list test to use locally set up https server to validate performance of image loading over https(rather than http) protocol. Https requires more back-and-forward communication before image bytes are sent to the client, shows clear signs of throughput affected by how busy flutter UI isolate is.
Updated
image_list
test to use locally set up https server to validate performance of image loading over https(rather than http) protocol. Https requires more back-and-forward communication before image bytes are sent to the client, shows clear signs of throughput affected by how busy flutter UI isolate is.