Skip to content
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

Method in the CacheStore to know if a key is in the memory cache #355

Closed
2 tasks done
vinicius0026 opened this issue Dec 10, 2021 · 0 comments
Closed
2 tasks done

Comments

@vinicius0026
Copy link
Contributor

🚀 Feature Requests

I need a way to synchronously know if a given key is present in the cache.

Contextualize the feature

In our app, we use the same image with different sizes (e.g., a small version for a listing page with a link and a large version on the details page). We want to show the smaller version of the image while the larger one is loading. The URLs for each size are different (as is the cache key).

I know that the actual file might be removed and the key will still be in the memory cache, but that's fine - this is a best-effort thing and doesn't need to be always accurate (although in our case it will very likely be in the cache bc we're reusing an image that was visible in the previous screen).

Describe the feature

Expose a method to check if a given key is in the memory cache.

Platforms affected (mark all that apply)

  • 📱 iOS
  • 🤖 Android

I have opened a PR (#354) adding a method to the cache_store.dart class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants