asset_field_not_list
The value of the 'assets' field is expected to be a list of relative file paths.
Description
#The analyzer produces this diagnostic when the value of the assets
key
isn't a list.
Example
#The following code produces this diagnostic because the value of the
assets
key is a string when a list is expected:
yaml
name: example
flutter:
assets: assets/
Common fixes
#Change the value of the asset list so that it's a list:
yaml
name: example
flutter:
assets:
- assets/
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。