preface

Currently, the official version of Flutter SDK has been updated to 2.2.+. When upgrading projects before the latest version, the biggest change should be adaptation to air safety. Then new projects will be developed in the latest VERSION of Flutter…. This will involve switching the Flutter version back and forth. Is this really good? If you downgrade in the traditional way:

  • 1, must/must/must/must/must/must
  • 2、flutter doctor -v
  • 3.

Update:

  • 1, the flutter of the upgrade
  • 2、flutter doctor -v
  • 3. It’s okay to switch back and forth, but it’s inefficient. So as a Flutter developer, you need to know how to better manage Flutter versions, so I recommend that you check this out

FVM address: pub.flutter-io.cn/packages/fv…

Benefits of using FVM

One of the advantages of using FVM is to be able to manage and cache multiple Flutter SDK versions and switch between them quickly. The other is to be able to specify the Flutter version globally or individually for a particular project.

Install the FVM

Its official document has written very detailed, I will not copy and paste, according to the steps to install and use should be ok

  • FVM. App /docs/gettin…

Install FVM and type FVM to see if it is successful. If FVM uses the boot prompt, it is successful

  • 2. You can then install different Versions of Flutter and use them
Install FVM installCopy the code

The above picture shows that I have installed the SDK for Flutter V2.2.3. Of course, I can also install multiple versions of Flutter that I may need to switch between later.

View the installed version:

fvm list
Copy the code
  • 3. To set the global version, run the following command:
fvm global {version}
Copy the code

For example, I set up the global FLUTTER version in 2.2.3, FVM Global 2.2.3

If you want to cut back to 1.22.6, you can do FVM Global 1.22.6, which is much more convenient.

Finally, a common use scenario is to use a particular version of FLUTTER for a particular project, using the following command:

fvm use {version}
Copy the code
  • 4, FVM installation is complete, finally remember to add FVM configuration path:
export PATH="$HOME/fvm/default/bin:$PATH"
Copy the code