Flutter 升级命令无法正常工作,出现错误 'You are not currently on a release branch'

Flutter upgrade command not working getting error 'You are not currently on a release branch'

Flutter upgrade 命令不工作收到错误 '你目前不在发布分支上。使用 git 查看官方分支 ('stable'、'beta'、'dev' 或 'master')'

1.从终端

转到你的flutter存储路径
cd path

2。命中命令

git checkout stable

3。命中命令

flutter upgrade