Closed
Description
flutter/flutter#132985 will allow a new type of asset declaration within the pubspec.yaml
file of Flutter projects. In particular, it will allow entries in the assets
list to either be strings (as they are today), or maps with a path
and a flavors
list. Consider this example:
# pubspec.yaml file for a Flutter project
# ...
flutter:
# ...
assets:
- assets/common/ # Nothing new here.
- path: assets/premium/ # Newly allowed asset declaration syntax.
flavors: # This is a list of arbitrary, nonempty strings.
- premium
Since the analyzer includes code to validate the assets
section within Flutter pubspecs, the analyzer raises warnings when validating pubspecs such as example one just mentioned:
andrewkolos-macbookpro:flavor_specific_assets andrewkolos$ flutter analyze
Analyzing flavor_specific_assets...
warning • Assets are required to be file paths (strings) • pubspec.yaml:22:7 • asset_not_string
Before this feature is landed, the analyzer code should be updated to account for the new syntax.