user13408251
user13408251

Reputation:

Flutter version constraints missunderstanding

Version Constraints is that means that if i use a package version ^2.0.1 that means if the developer of this certain packages update his package to 3.0.0, my application, which including this package will lose it although my application is released?

Upvotes: 0

Views: 103

Answers (1)

Herbert Poul
Herbert Poul

Reputation: 4893

  1. No, dependencies are only resolved at compile time. Once your application is released, those obviously won't change.
  2. No, if you have ^2.0.1 in your pubspec.yaml and run pub get the most recent version will be locked into pubspec.lock - let's say your dependency has released version 2.0.4 then pubspec.lock will contain that information. For applications it is hence recommended that you add pubspec.lock to your version control. Subsequent pub get will always fetch the locked 2.0.4 until you either change something in your dependencies or run pub upgrade. If you run pub upgrade and the package author has release 2.3.0 this new version will be included. On the other hand if the package author releases 3.0.0 it will still not be used, because ^2.0.1 means the same as >=2.0.1 <3.0.0

Upvotes: 1

Related Questions