-
-
Notifications
You must be signed in to change notification settings - Fork 891
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
feat: Add support for base64 encoded images to be manually added to Images cache. #3008
Conversation
@@ -49,6 +49,14 @@ class Images { | |||
_assets[name] = _ImageAsset.fromImage(image); | |||
} | |||
|
|||
/// Transform the base64 encoded image into an [Image] and adds it into the | |||
/// cache. | |||
Future<void> addBase64EncodedImage(String name, String base64Data) async { |
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.
Future<void> addBase64EncodedImage(String name, String base64Data) async { | |
Future<void> addFromBase64Data(String name, String base64Data) async { |
Maybe? That it's an image should already be implicit from the cache name
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.
Agreed! updated
@erickzanardo I just stumbled upon this method which is already in the |
@spydon not really, that method will fetch from cache if the image is already there, the method that I introduced will always force the cache to be updated. |
Ah, alright, it seems like it should just have been a flag to this method instead of a new method then? We should really standardize how the caches work for V2, it feels quite unstructured now. |
Yeah, agree on the flag, that was what I thought at first, but I preferred to follow the other method |
Makes sense, I'll put it in the V2 list that we should look through the cache classes :) |
Sounds good!!!! |
Description
Adds a method so base64 encoded images can be manually added to the Images cache.
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Related Issues
Replace or remove this text.