Background: Because the Version of Flutter updates quickly, sometimes a project has a stable version and wants to switch to the new version with new features, but each switch may be designed to change the environment variable, which can be troublesome. So with the tool FVM, Flutter Version Manage.

The installation

First, add homebrew tap: Brew Tap xinfeng-tech/ FVM

Perform the installation

brew install fvm

. Copy the following content to your bashrc. | ZSHRC… In the file

export FLUTTER_STORAGE_BASE_URL=http://mirrors.cnnic.cn/flutter 
export FVM_DIR="$HOME/.fvm"
source "/usr/local/opt/fvm/init.sh"
Copy the code

usage

  1. Prints FVM help information

Install a version of Flutter, for example 1.9.1. FVM install 1.9.1. Use the previous version FVM use 1.9.1 4. Set the alias FVM alias latest 1.9.1 5. List all the installed versions. FVM list 6. List the published versions



I have two versions installed so far



All versions are stored in this file, so when you switch, you copy the version you want into the current folder.

Then the path we point to in Studio is always current.