platform_value_disallowed
Keys in the platforms
field can't have values.
Description
#The analyzer produces this diagnostic when a key in the platforms
map
has a value.
To learn more about specifying your package's supported platforms,
check out the documentation on platform declarations.
Example
#The following pubspec.yaml
produces this diagnostic because the key
web
has a value.
yaml
name: example
platforms:
web: "chrome"
Common fixes
#Omit the value and leave the key without a value:
yaml
name: example
platforms:
web:
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。