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

Add Image provider which takes an id, and an async function to fetch url from that id #983

Open
2 tasks
akshdeep-singh opened this issue Oct 30, 2024 · 0 comments

Comments

@akshdeep-singh
Copy link

akshdeep-singh commented Oct 30, 2024

🚀 Feature Requests

Add Image provider which takes an id, and an async function to fetch url from that id as input.

Contextualize the feature

Images stored in cloud storages (Firebase Storage, AWS S3, etc.) have async functions to get url for files stored. I need a way to check cache before getting the url, via an id (path of image on cloud storage), such that if cache has an entry for the specified id, it will load image from cache, otherwise it will fetch url for that id, and then the same steps as it does.

Describe the feature

CachedStorageImageProvider(
  String id,
  Future<String> Function(String id) fetchUrl,
) 

The fetch url function should be called after checking cache and image not present in cache.

Platforms affected (mark all that apply)

  • 📱 iOS
  • 🤖 Android
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

1 participant