Closed Process-ing closed 1 month ago
That only applies for regular packages.
For regular packages, don't commit the pubspec.lock file. Regenerating the
pubspec.lock
file lets you test your package against the latest compatible versions of its dependencies. 1
In case of application packages (i.e., packages that contain a program or app, with a main entrypoint):
Application packages should check their lockfiles into source control, so that everyone working on the application and every location the application is deployed has a consistent set of dependencies. Because their dependencies are constrained by the lockfile, application packages usually specify any for their dependencies' version constraints. 2
For application packages, we recommend that you commit the
pubspec.lock
file. Versioning thepubspec.lock
file ensures changes to transitive dependencies are explicit. Each time the dependencies change due todart pub upgrade
or a change inpubspec.yaml
the difference will be apparent in the lock file. 1
[1] Private Files Dart.dev [2] Application package. Dart.dev
From the Dart documentation: