missing_dependency
Missing a dependency on imported package '{0}'.
Description
#The analyzer produces this diagnostic when there's a package that has been imported in the source but is not listed as a dependency of the importing package.
Example
#The following code produces this diagnostic because the package path
is
not listed as a dependency, while there is an import statement
with package path
in the source code of package example
:
yaml
name: example
dependencies:
meta: ^1.0.2
Common fixes
#Add the missing package path
to the dependencies
field:
yaml
name: example
dependencies:
meta: ^1.0.2
path: any
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。