Reputation: 28996
Let's say I'm having two packages in my pubspec.yaml
file.
abc: any
xyz: any
Now, I only want to update abc
package, how do I do that, is there any command like
flutter update abc
Upvotes: 26
Views: 20236
Reputation: 28996
To upgrade abc
package and leaving others as it is, run:
dart pub upgrade abc
To upgrade all the packages, run:
dart pub upgrade
Upvotes: 33
Reputation: 3911
First, comment that the packaging line in the pubspec.yaml
file and run flutter pub get
after successfully get packages to uncomment that line (if you want to upgrade/downgrade to a specific version that mentioned version too) it will upgrade to the latest version.
In your case:
step 1:
// abc: any
xyz: any
flutter pub get
step 2:
abd: any
xyz: any
So now abc
will upgrade to the latest version
Upvotes: 4
Reputation: 1003
Run this command in the terminal
pub upgrade abc args
where abc
is the package name you want to upgrade. Be sure you are in the project root directory.
Upvotes: 0
Reputation: 2236
If you are using Android Studio for Flutter you can install this plugin.
https://plugins.jetbrains.com/plugin/12693-flutter-enhancement-suite/
I'm not using Visual Studio, so I don't know if these plugins are what you need but you can check
https://marketplace.visualstudio.com/items?itemName=jeroen-meijer.pubspec-assist
https://marketplace.visualstudio.com/items?itemName=everettjf.pubspec-dependency-search
Upvotes: 0