Change flutter channels

I am still learning flutter, I remember when I test flutter gallery , on the document it let me change to master channel, after some days…

Change flutter channels

I am still learning flutter, I remember when I test flutter gallery , on the document it lets me change to master channel, after some days, I forget how to change channels, so I searched it again and keep it here to help me remember it.

List flutter channels

To list flutter channels, just run the flutter channel command$ flutter channel
Flutter channels:
* master
 beta
 stable

Change flutter channel

For example, I want to change to stable channel, then I can use the following command:$ flutter channel stable
Switching to flutter channel 'stable'...
git: Switched to branch 'stable'
git: Your branch is behind 'origin/stable' by 1 commit, and can be fast-forwarded.
git:   (use "git pull" to update your local branch)
Successfully switched to flutter channel 'stable'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'

Upgrade flutter

According to the message above, I need to upgrade the flutter, but sometimes, it will failed by local changes, so I need add --force flag to run the command like below:flutter upgrade --force