Keeping your app's packages updated is important for security, performance, and getting new features. Luckily, Flutter makes this easy right from your command line.
Flutter CLI to the Rescue
To see which packages in your project are outdated, you can use a specific command provided by the Flutter command-line tool.
The flutter pub outdated
Command
Just open your terminal or command prompt, go to your project's folder, and type:
flutter pub outdated
What the Output Shows
This command will show you a list of your project's packages. It tells you the version you currently have, which version you could upgrade to, a resolvable version, and the very latest version available.
An asterisk [*]
next to a package name means the version you have is not the newest one.
Here's an example of what you might see:
Showing outdated packages.
[*] indicates versions that are not the latest available.
Package Name Current Upgradable Resolvable Latest
direct dependencies:
adaptive_dialog *1.3.0 1.4.0 1.4.0 1.4.0
cloud_firestore *3.1.6 3.1.10 3.1.10 3.1.10
cloud_functions *3.2.5 3.2.10 3.2.10 3.2.10
CI Tip
For automated checking, you can integrate this command into your Continuous Integration (CI) workflow. You can even extract the output as JSON. Running this check regularly (like weekly on your main branch) can help you stay informed about new package versions and notify you, maybe even via email, if updates are available.
Staying on top of updates helps keep your Flutter project healthy and ready for new possibilities!