I'm new in Flutter. 2 months ago I have installed flutter SDK in windows. Now I have seen a lot of updates available.
I want to update "Flutter SDK".
How to update Flutter SDK to the latest version?
You can write
flutter upgrade
command in terminal to update flutter sdk
I want to upgrade most latest version. So I used below commands:
flutter channel dev
Flutter has 4 project branches / channels ie stable, master, dev, beta. First when we install it. flutter install stable channel.
If you want to switch :
flutter channel chanel_name
Then update that :
flutter upgrade
Using Tool Menu:
You can update in android studio using Tools so follow these steps Android Studio -> Tools -> Flutter -> Flutter Upgrade.
Using Command:
You can write a command in the terminal to update flutter SDK
flutter upgrade
Or if you have to upgrade it any way you can use
flutter upgrade --force
Open your terminal and type
flutter upgrade --force
--force overwrites local changes to your Flutter installation. As per the CLI: "Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove local changes, then re-run this command with --force."We can upgrade the flutter by simply using Flutter command forcefully.
Like this one :
flutter upgrade --force
But before that we will have to make sure & take a note of few things otherwise it can be risky & we might loss some of our work as well.
Important Note :
Hopefully this will help out everyone.