unknown_ platform
Details about the 'unknown_platform' diagnostic produced by the Dart analyzer.
The platform '{0}' is not a recognized platform.
Description
#
The analyzer produces this diagnostic when an unknown platform
name is used as a key in the platforms map. 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 platform browser is
unknown.
name: example
platforms:
browser:
Common fixes
#
If you can rely on automatic platform detection, then omit the
top-level platforms key.
name: example
If you need to manually specify the list of supported
platforms, then write the platforms field as a
map with known platform names as keys.
name: example
platforms:
# These are the known platforms
android:
ios:
linux:
macos:
web:
windows:
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.