What's the difference between pub dependencies and dev_dependencies?

前端 未结 2 954
长发绾君心
长发绾君心 2021-01-08 00:09

What is the difference in dependencies and dev_dependencies in a pubspec.yaml? It seems that when I run pub get the

2条回答
  •  长发绾君心
    2021-01-08 00:20

    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.

提交回复
热议问题