Suppose I have analyzer package that is a transitive dependency set to 2.8.0^ and latest version 3.0.0 is available.So using dart pub upgrade will upgrade it or I have to manually make it ^3.0.0 in pubspec.yaml and then run pub get
CodePudding user response:
It will automatically update the dependencies when you use dart pub upgrade
If there is a dependency say ^2.7.0 with you and there is a newer version (2.8.0) available, it will automatically upgrade to ^3.0.0 unless there is any dependency constraints.
You could use dart pub upgrade --major-versions
so that ^2.8.0 can be upgraded to ^3.0.0.
Anyway you'll be suggested to use this command when using dart pub upgrade
I was upgrading webview_flutter
from ^2.8.0 to 3.0.0:
- I had to run
dart pub upgrade
(checked what new dependencies are there). - It suggested me to run
dart pub outdated
. - I saw
webview_flutter
was not upgraded. - It suggested me to run
dart pub upgrade --major-versions
. - I did it, and the version upgraded in
.yaml
file
Look here for more about the command.