When I execute flutter pub get or pub get, these changes their pubspec.lock sometimes like below.
sdks:
- dart: ">=2.10.2 <=2.11.0-213.1.beta"
+ dart: ">=2.10.2 <2.11.0"
I thought pub get is nealy equal to CocoaPods command pod install which does not modify lock file.
Why pub get update lock file?
refering to the officiel docummentaion here
this is the answer :
When pub get gets new dependencies, it writes a lockfile to ensure that future gets will use the same versions of those dependencies. Application packages should check in the lockfile to source control; this ensures the application will use the exact same versions of all dependencies for all developers and when deployed to production. Library packages should not check in the lockfile, though, since they’re expected to work with a range of dependency versions.
If a lockfile already exists, pub get uses the versions of dependencies locked in it if possible. If a dependency isn’t locked, pub gets the latest version of that dependency that satisfies all the version constraints.
Seems like uncontrolled version changes and updates on bugfix and minor level.
There should be a command, which just uses the versions described within the lock file.
Otherwise reproduction of an exact version is nearly impossible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With