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
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.