flutter2/3版本切换,除了fvm,还可以看看puro
Mac安装方式
dash
curl -o- https://puro.dev/install.sh | PURO_VERSION="1.4.5" bash
因为puro安装flutter需要依赖git, 请确保mac支持git命令行
dash
brew install git
快速开始
先看效果
1.创建flutter环境
这里的 my_env
是自定义的环境名称标志, 比如上图的 f2105
就是 flutter 2.10.5
版本
下面是创建的四个方式, 选喜欢的去用就行
dash
# Create new environment from a release channel
puro create my_env stable
# Or from a version
puro create my_env 3.3.6
# Or from a commit
puro create my_env d9111f6
# Or from a fork
puro create my_env --fork git@github.com:pingbird/flutter.git
2.查询puro 可支持的flutter版本,选中一个去创建就行
dash
puro ls-versions --all
推荐 添加上 --all
查看更多版本
dash
Flutter 3.19.4 | 9h | 68bfaea224 | Dart 3.3.2
Flutter 3.19.3 | 2w | ba39319843 | Dart 3.3.1
Flutter 3.19.2 | 3w | 7482962148 | Dart 3.3.0
Flutter 3.19.1 | 4w | abb292a07e | Dart 3.3.0
Flutter 3.19.0 | 1mo | bae5e49bc2 | Dart 3.3.0
Flutter 3.16.9 | 2mo | 41456452f2 | Dart 3.2.6
Flutter 3.16.8 | 2mo | 67457e669f | Dart 3.2.5
Flutter 3.16.7 | 2mo | ef1af02aea | Dart 3.2.4
Flutter 3.16.6 | 2mo | 46787ee49c | Dart 3.2.3
Flutter 3.16.5 | 3mo | 78666c8dc5 | Dart 3.2.3
Flutter 3.16.4 | 3mo | 2e9cb0aa71 | Dart 3.2.3
Flutter 3.16.3 | 3mo | b0366e0a3f | Dart 3.2.3
Flutter 3.16.2 | 4mo | 9e1c857886 | Dart 3.2.2
Flutter 3.16.1 | 4mo | 7f20e5d18c | Dart 3.2.1
Flutter 3.16.0 | 4mo | db7ef5bf9f | Dart 3.2.0
Flutter 3.13.9 | 5mo | d211f42860 | Dart 3.1.5
Flutter 3.13.8 | 5mo | 6c4930c4ac | Dart 3.1.4
Flutter 3.13.7 | 5mo | 2f708eb839 | Dart 3.1.3
Flutter 3.13.6 | 6mo | ead455963c | Dart 3.1.3
Flutter 3.13.5 | 6mo | 12fccda598 | Dart 3.1.2
Flutter 3.13.4 | 6mo | 367f9ea16b | Dart 3.1.2
Flutter 3.13.3 | 6mo | a625ad4ea9 | Dart 3.1.1
Flutter 3.13.2 | 7mo | ff5b5b5fa6 | Dart 3.1.0
Flutter 3.13.1 | 7mo | e1e47221e8 | Dart 3.1.0
Flutter 3.13.0 | 7mo | efbf63d9c6 | Dart 3.1.0
Flutter 3.10.6 | 8mo | f468f3366c | Dart 3.0.6
Flutter 3.10.5 | 9mo | 796c8ef792 | Dart 3.0.5
Flutter 3.10.4 | 9mo | 682aa387cf | Dart 3.0.3
我这里选择创建一个 3.3.1的版本,所以可以这样写
dash
puro create F3031 3.3.1
查看一下目前各版本
dash
puro ls
3.切换环境
切换到flutter3
切换到flutter 2