Lately, I had only been working on Laravel projects and other web apps and did not get much time to delve into Flutter code. That also meant, the Flutter SDK was not updated in a while and neither were the associated flutter packages.
It turns out, updating Flutter SDK and Flutter Packages was a very simple affair. Here’s how you do it:
Step 1: Update the Flutter SDK
Open your terminal, use type the following command:
flutter upgrade
In case the above command doesn’t work for you, try the same command but with the –force flag this time. The command would now look like this:
flutter upgrade --force
In case your SDK is already up to date, you will see a relevant message in the terminal, like what is shown below:
Step 2: Update Flutter Packages and dependencies
Next in line is upgrading the Flutter dependencies. In order to do that, go to your project’s root directory and run the following command:
flutter pub upgrade
This should upgrade all your project dependencies.
That’s all about upgrading the Flutter SDK & Flutter packages.