-
Notifications
You must be signed in to change notification settings - Fork 68
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
Feature request: easy way to pre-cache by url #26
Comments
that should be great |
@mattreid1 if you can recommend a strategy to implement this I will get it done and make a PR |
In one of my tests I actually run something like this if I'm not mistaken.... void setBytes() async {
Uint8List imageBytes =
(await FirebaseImage('gs://xxxxxxxxx.appspot.com/xxxx.jpg')
.getBytes()); // This fetches the image
setState(() {
bLength = imageBytes.length;
});
} Would something like this achieve what you need? |
Check the PR I made, #27 |
Take a look at the PR I just made #33. It's async, avoids logic duplication, very simple, null safe and throws a descriptive error if the developer has accidentally disabled caching. You can use it by calling this anywhere in the code. FirebaseImage('gs://xxxxxxxxx.appspot.com/xxxx.jpg').preCache(); Might be worth me disabling the max file size limit for pre-caches (or setting it high e.g. 50MB). Thoughts? If you're happy this solves the issue, I'll publish this. |
I'm not able to test it right this moment but if that does cache the image so it's instant retrieval the next time you make a FirebaseImage with that URL than I much prefer your solution and I'd be happy for my PR and this issue to be closed. |
We'd love to be able to fire off a command to pre-cache a Firestore image url.
ie
The text was updated successfully, but these errors were encountered: