-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Page URL
https://docs.flutter.dev/development/ui/assets-and-images/
Page source
https://github.com/flutter/website/tree/main/src/development/ui/assets-and-images.md
Describe the problem
Asset variants states:
When an asset’s path is specified in the assets section of pubspec.yaml, the build process looks for any files with the same name in adjacent subdirectories. Such files are then included in the asset bundle along with the specified asset.
As of flutter/flutter@cb5b5c34, this is no longer the case. The flutter tool's automatic addition of files to the asset bundle is now limited to resolution-aware image assets. For example, if a project's pubspec.yaml file declares mountain.png as an asset, then 2.0x/mountain.png would be bundled, but night-time/mountain.png would not.
The change has understandably caused confusion (for example, flutter/flutter#121474), and this page should be updated.
Expected fix
Consider updating Declaring resolution-aware image assets to describe the automatic bundling of resolution-aware variants. Then, Asset variants can be deleted entirely.
Additional context
No response