-
Notifications
You must be signed in to change notification settings - Fork 17
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
image_cache #996
image_cache #996
Conversation
lib/widget/image.dart
Outdated
@@ -132,7 +134,9 @@ class ImageState extends WidgetState<EnsembleImage> { | |||
} | |||
|
|||
return CachedNetworkImage( |
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.
if (widget.controller.cache)
use Image.network
else
use CachedNetworkImage
I have made the required changes however, the problem persists in the web side. The native side requires you to do hot restart for the image.network to work again. In the flutter image_provider they have added this as a todo
For now the fix that is provided is to basically add timestamp with the date of last-modified from the cache-headers to provide a difference url if the images changes in the url |
That's fine. Please use the timestamp as you have had. Go ahead and merge that part in. |
78b5c81
to
892e96f
Compare
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 doesn't seem right to me. @vusters has to review this before it is approved.
final http.Response response = await http | ||
.get(Uri.parse("${url}timeStamp=${DateTime.now().toString()}")); | ||
DateTime lastModifiedDateTime = | ||
parseHttpDate("${response.headers['last-modified']}"); |
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.
what if the last-modified header is not present. You will end up sending "null" as the parameter.
How will that work?
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.
@fullstackctp please see this comment as well
4620573
to
172ad73
Compare
@@ -537,6 +537,10 @@ | |||
"type": "string", | |||
"description": "A unique identifier for this widget" | |||
}, | |||
"cache": { | |||
"type": "boolean", | |||
"description": "To put the image in the cache" |
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.
makek sure you add "... default true."
For the ticket #967