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

[FR]: Path to directory #588

Open
2 tasks done
Zalezny opened this issue Oct 14, 2024 · 3 comments
Open
2 tasks done

[FR]: Path to directory #588

Zalezny opened this issue Oct 14, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Zalezny
Copy link

Zalezny commented Oct 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Missing get path of directory

Describe the solution

Good solution will be add 'path' variable
For declared asset directory in pubspec.yaml:
-assets/fonts/

And for gen code:
Assets.fonts.path return String path 'assets/fonts'

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Zalezny Zalezny added the enhancement New feature or request label Oct 14, 2024
@AlexV525
Copy link
Member

What is the use case of getting the directory?

@Zalezny
Copy link
Author

Zalezny commented Oct 16, 2024

This can be particularly useful when working with groups of assets, for example init easy localization:

EasyLocalization(
      supportedLocales: [Locale('en', 'US'), Locale('de', 'DE')],
      path: 'assets/translations', // <-- path
      fallbackLocale: Locale('en', 'US'),
      child: MyApp()
    ),

@AlexV525
Copy link
Member

Is the initialization only happened once?

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

3 participants
@AlexV525 @Zalezny and others