Feature Request: Modify Prefix and View Cache Keys
Problem to solve
The current implementation of the Images class lacks flexibility in two areas:
- Changing the prefix value after instantiation.
- Viewing all the keys present in the image cache.
Proposal
I propose the addition of two features to the Images class:
-
Change Prefix Value:
- Implement a method like
setPrefix(String newPrefix)that updates the_prefixvariable and ensures all cached paths are updated accordingly.
- Implement a method like
-
View Cache Keys:
- Implement a method like
List<String> getCacheKeys()that returns a list of all keys currently stored in the_assetsmap.
- Implement a method like
These enhancements would greatly improve the flexibility and usability of the Images class.
More information
These features would align with the asset management practices seen in other frameworks and libraries, making it easier for developers to manage assets dynamically and ensure better cache management.
Other
- [x] Are you interested in working on a PR for this?
Sound like good additions!
- I would use a setter here instead (and expose a getter)
- For this one I would just do
List<String> get keys => _assets.keys;
You didn't check the box for working on a PR for this, so I guess we'll wait for someone else to pick this up (if you don't change your mind).
ill do it ty
I just had a look at images, and it already provides a setter for for the prefix, so it is only the getter for the keys that is needed.
I just had a look at images, and it already provides a setter for for the
prefix, so it is only the getter for the keys that is needed.
Is this issue still open? Looks like the only information is regarding the setter, but wasn't sure if this comment was meant to say that part of it has already been resolved. Would like to try and work this if there's anything left here 🙂
@aalberti333 I think it is all done! If you're here due to the hacktoberfest tag, our whole repo has the hacktoberfest tag on it so you can do any issue, even if it's not marked hacktoberfest (we've been pretty bad at tagging up issues this year, I'll try to look into that tomorrow). :)