flutter_gen
flutter_gen copied to clipboard
[FR]: Add Localized Asset Generation
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the problem
Currently, FlutterGen is a fantastic tool for generating code related to assets, fonts, colors, and APIs in Flutter applications. However, it lacks the capability to generate localized assets easily.
In many internationalized applications, it's essential to provide localized versions of assets like images, with different languages or regions using the same asset but tailored to their needs. For instance, a logo used in English-speaking regions may be different from the one used in Portuguese-speaking regions.
This feature request aims to address this limitation by adding the ability to generate localized assets using FlutterGen.
Describe the solution
The solution involves enhancing FlutterGen to recognize and generate assets from localized directories. Specifically, it should:
-
Recognize language or region-specific directories within the assets directory, such as
/assets/enfor English and/assets/ptfor Portuguese. -
Allow users to provide assets in these localized directories. For example:
/assets/en/logo.pngfor the English version of the logo./assets/pt/logo.pngfor the Portuguese version of the logo.
-
Generate code that makes it easy to access these localized assets in Flutter, ensuring that the correct asset is used based on the application's current locale.
Additional context
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct