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

[Feature] Create master class with all the other one as field #18

Closed
bounty1342 opened this issue Mar 6, 2020 · 5 comments
Closed

[Feature] Create master class with all the other one as field #18

bounty1342 opened this issue Mar 6, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@bounty1342
Copy link

Hey,

I think it would be easier to always import the same base class, with all the generated class as field>
Then we can use Class.subclass.img to retrieve the image.

It would be even better, if this could match the directory :

  • assets
    • images
      • root
        • logo_small.png
        • logo_full.png
      • onboarding
        • logo_small.png
        • logo_full.png
      • login
        • bar
          • bar.png
          • icon.png
        • button
          • icon.png
          • button.png
    • svg
      • 1 x
      • 2x

Then we can access Assets.images.login.bar.icon pretty easily.

  1. Only one import to figure out
  2. Easier to find the right image, without looking at the assets folder

Let me know what you thinks about it.
Regards

@BirjuVachhani
Copy link
Owner

@bounty1342 How do you propose to achieve this: Assets.images.login.bar.icon?

@bounty1342
Copy link
Author

@BirjuVachhani : this is a very naive solution,
Link

This could surely be perfected.

@BirjuVachhani
Copy link
Owner

@bounty1342
This makes sense but don't you think managing assets by screens or modules will complicate things like:

  1. reusability - Although it can be reused easily, the path it represents tells a different story.
  2. You have list all the folders in pubspec.yaml

@bounty1342
Copy link
Author

Don't want to speak about everybody but my asset folder is already organized like this :
image

I presume one alternative could also be : Assets.images_login_bar_icon

If you want a file to be used by several view, you place it in the cross path (directory wise), or at the root...

@BirjuVachhani BirjuVachhani added the enhancement New feature or request label Mar 17, 2020
@BirjuVachhani
Copy link
Owner

Closing this as I'm having no plans for this in near future.

BirjuVachhani added a commit that referenced this issue Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants