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
:
name: example
dependencies:
meta: ^1.0.2
Common fixes
#Add the missing package path
to the dependencies
field:
name: example
dependencies:
meta: ^1.0.2
path: any
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-1. View source or report an issue.