No matter which one of the Flutter release channels you follow, you can use the flutter command to upgrade your Flutter SDK and the packages that your app depends on.

One-time setup

For the flutter command to work correctly, your app’s pubspec.yaml file must require the Flutter SDK. For example, the following snippet specifies that the flutter and flutter_test packages require the Flutter SDK:

name: hello_world
    sdk: flutter
    sdk: flutter

Upgrading the Flutter SDK and packages

To update both the Flutter SDK and the packages that your app depends on, use the flutter upgrade command from the root of your app (the same directory that contains the pubspec.yaml file):

$ flutter upgrade

This command first gets the most recent version of the Flutter SDK that’s available on your Flutter channel. Then this command updates each package that your app depends on to the most recent compatible version.

If you want an even more recent version of the Flutter SDK, switch to a less stable Flutter channel and then run flutter upgrade.

Switching Flutter channels

Flutter has four release channels: stable, beta, dev, and master. We recommend using the stable channel unless you need a more recent release.

To view your current channel, use the following command:

$ flutter channel

To change to another channel, use flutter channel <channel-name>. Once you’ve changed your channel, use flutter upgrade to download the Flutter SDK and dependent packages. For example:

$ flutter channel dev
$ flutter upgrade

Upgrading packages only

If you’ve modified your pubspec.yaml file, or you want to update only the packages that your app depends upon (instead of both the packages and Flutter itself), then use one of the flutter pub commands.

To get all the dependencies listed in the pubspec.yaml file, without unnecessary updates, use the get command:

$ flutter pub get

To update to the latest compatible versions of all the dependencies listed in the pubspec.yaml file, use the upgrade command:

$ flutter pub upgrade

Keeping informed

We publish breaking change announcements to the Flutter announcements mailing list. You can also ask questions on the Flutter dev mailing list. Aside from subscribing to receive announcements, we’d love to hear from you!

Selecting a specific version

If you have a specific version of Flutter that you’d like to switch to, you can use the flutter version command:

$ flutter version v1.9.1+hotfix.3

To pin packages to specific versions, specify their versions explicitly in the pubspec.yaml file. For more details on the format of this file, see the pubspec.yaml documentation on dart.dev.

Latest flutter documents from Flutter. Enhanced Search by DeepKB.