Q:

What we add under dev_dependencies in flutter

I have a silly question regarding dev_dependencies in flutter, I am planning to use mock_cloud_firestore and in its installation page it says that we need to add it in the dependencies section of pubspec.yaml
I think mock_cloud_firestore is not a production dependency but a dev dependency if so why we need to add it under dependencies?
Also what we add under dev_dependencies?
Thanks.

A:

This issue is mentioned in Dart's official docs:

Pub supports two flavors of dependencies: regular dependencies and dev dependencies. Dev dependencies differ from regular dependencies in that dev dependencies of packages you depend on are ignored

Therefore, I believe it safer to put it under dependencies during development and remove it from pubspec when personal testing is finished. But below quote from the official doc is more clear:

The rule for deciding between a regular or dev dependency is simple: If the dependency is imported from something in your lib or bin directories, it needs to be a regular dependency. If it’s only imported from test, example, etc. it can and should be a dev dependency.

