Flutter 升级或回退记

1.flutter SDK链接
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
2.命令

flutter 相关命令

1.检查当前分支
flutter channel

2.切换分支
flutter channel beta
flutter channel master

3.升级flutter
flutter upgrade

3.升级后需匹配兼容的CocoaPods

1.命令
查看gem源是否是最新的:gem sources -l
查看 版本:gem -v
查看pods版本:pod --version

2.升级cocoapods:sudo gem install -n /usr/local/bin cocoapods —pre
会出现这个报错 “ERROR:  While executing gem ... (URI::InvalidURIError)
 URI must be ascii only "?gems=\u{2014}pre"”
解决方法:sudo gem install -n /usr/local/bin cocoapods  升级

4.版本回退

1.cd到flutter目录下
2.git reset --hard 7a4c33425ddd78c54aba07d86f3f9a4a0051769b(回退到哪个版本的提交记录号)