What's the difference between pub dependencies and dev_dependencies?
dev_dependencies
are dependencies that are not available for code in the resulting application, but only for tests, examples, tools, or to add executable tools like for code generation to your project.
dev_dependencies
of any dependencies in your project (dependencies
or dev_dependencies
) are always ignored when you publish to pub.dev.
See also https://dart.dev/tools/pub/pubspec
There are two types of dependencies, one is regular and the other is dev.
dependencies:
Regular dependencies are listed under dependencies:—these are packages that anyone using your package will also need.
dev_dependencies:
Dependencies that are only needed in the development phase of the package itself are listed under dev_dependencies.
If your package (say A) depends on another package (say B) (which further has dev-dependencies
), then your package (A) simply ignores the dev-dependencies
used by that package (B here).
However, your package (A) depends on the packages (which are specified under dependency
) of (B) package.