preface

When there’s a new version of Flutter, want to give it a try? Upgrade, open silly eyes, various errors, the new version may have a lot of things to adapt support. Go back? Maybe a flutter doctor will try and downgrade the cache, then the flutter doctor will try again, if the speed becomes too slow, it will be enough for a cup of tea. If you want multiple versions of the Flutter to be local, you can switch between them quickly and easily, happily. Fortunately, FVM, an unofficial tool, can do just that.

FVM is introduced

FVM: short for flutter Version Manager. This tool allows us to
  1. Install multiple versions of the Flutter SDK locally.
  2. Specify a FLUTTER version for your project and quickly switch versions.
Sidekick: An application that primarily provides a GUI for Flutter FVM.
  1. Using FVM is easy and quick
  2. Flutter Stable /beta/dev contains the current Flutter stable/beta/dev and historical versions for easy download and use
  3. There are some third treding/ Morst used packages/ FLUTTER Favorites of FLUTTER.

Installation and use of FVM

FVM installation

Github is the author of github

Take macOS as an example.

brew tap leoafarias/fvm
brew install fvm
Copy the code

The default flutter SDK cache path is ~/ FVM /versions

ZSH is used as the default Shell on a Mac. ZSH is used as the default Shell on a Mac

FVM installs the Flutter SDK

FVM install dev // Installs the latest preview version of flutter 1.22.6Copy the code

FVM installed flutter version deleted

FVM remove 1.22.6 // Uninstall version 1.22.6Copy the code

FVM lists installed versions

~ (master *) » FVM list Cache Directory: / Users/nickName/FVM/versions 2.2.2 1.22.6Copy the code

FVM Displays information about the current version of flutter

fvm flutter --version
Copy the code

The previous flutter commands were preceded by FVM for example

  • fvm flutter clean
  • fvm flutter pub get

After that, take AS for example. Open the Preferences for the AS. Set the flutter SDK path. The corresponding DART SDK path is automatically filled

fvm flavor for project

Flavor: Like FVM, Flutter is configured with multiple FLUTTER SDK versions per project environment or release type.

// ~/your_flutter_project. FVM /fvm_config.json {"flutterSdkVersion": "1.22.6", "flavors": {"stable": "stable", "dev": "Dev" "production", "1.22.6", "beta" : "Beta ",}} // It has the following configurations: /* Give version a name, Json */ FVM use {version} --flavor {flavor_name} // List flavors FVM of the current project configuration flavor {flavor_name} fvm flavorCopy the code

Sidekick

Very practical and convenient. Specific use does not expand said, download to see very clear.

other

Befovy/FVM, a go based version management tool for Flutter, is basically the same as Leoafarias/FVM, depending on your preference. And finally, to Leo Afarias/FVM of Leo Farias, star.