We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create the folders for: - assets/images/1x/ - assets/images/2x/ - assets/images/3x/
Code for the assets in this folders are not generated.
Question: How does flutter gen handle images for different resolutions? This could be done automatically.
The text was updated successfully, but these errors were encountered:
Hi @SerggioC! Thanks for using FlutterGen.
Actually, this was done automatically. If you arrange the file structure properly then those resolution-aware images will be handled properly by the flutter framework. You can check this post: https://medium.com/@nileshsenta1991/flutter-resolution-aware-image-assets-234c82216cef.
For example:
.../brand_logo.png .../2.0x/brand_logo.png .../3.0x/brand_logo.png
flutter: assets: - assets/brand_logo.png
Image( image: Assets.brandLogo.image(), )
Sorry, something went wrong.
Hi @lcdsmao So I was defining this folders in pubspec.yaml, that is the error.
assets: - assets/images/1x/ - assets/images/2x/ - assets/images/3x/
So we just need to put the images in the correct density folders (2.0x, 3.0x) and set pubspec:
assets: - assets/images/
And the image is loaded with the correct density.
image: Assets.brandLogo.image(),
Thanks for the help!
No branches or pull requests
Create the folders for:
- assets/images/1x/
- assets/images/2x/
- assets/images/3x/
Code for the assets in this folders are not generated.
Question: How does flutter gen handle images for different resolutions? This could be done automatically.
The text was updated successfully, but these errors were encountered: