Giter VIP home page Giter VIP logo

Comments (6)

yelkamel avatar yelkamel commented on July 29, 2024

that should be great

from firebase_image.

lukepighetti avatar lukepighetti commented on July 29, 2024

@mattreid1 if you can recommend a strategy to implement this I will get it done and make a PR

from firebase_image.

mattreid1 avatar mattreid1 commented on July 29, 2024

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?

from firebase_image.

lukepighetti avatar lukepighetti commented on July 29, 2024

Check the PR I made, #27

from firebase_image.

mattreid1 avatar mattreid1 commented on July 29, 2024

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.

from firebase_image.

lukepighetti avatar lukepighetti commented on July 29, 2024

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.

from firebase_image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.