7.7 C
New York
Saturday, December 2, 2023

How to check your Flutter and Dart versions

This short article is about checking Flutter SDK and Dart SDK versions that are installed on your computer. In addition, you’ll also learn how to upgrade your Flutter SDK, find out which Flutter channel is being used and how to change it.

Checking Dart SDK Version

To see your Dart SDK version, open your terminal (or command prompt) and run the following command:Advertisements

dart --version

The output will look similar to this:

Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "macos_x64"

Checking Flutter SDK Version and Channel

To know your Flutter SDK version, execute the command below:

flutter --version

The output will provide a bunch of information including the Flutter SDK version, which channel is in use, etc.

Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (5 days ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2

AdvertisementsAnother command that can give you what you want:

flutter doctor

You’ll see something like below in your terminal window:

Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, 2.10.3, on macOS 12.1 21C52 darwin-x64, locale en)
[?] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[?] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[?] Chrome - develop for the web
[?] Android Studio (version 4.2)
[?] VS Code (version 1.65.0)
[?] Connected device (2 available)
[?] HTTP Host Availability

• No issues found!

If you need more details, just perform the “flutter doctor” command with the “-v” flag:

flutter doctor -v
Advertisements

Then the output will be so informative. Here’s mine:

[?] Flutter (Channel stable, 2.10.3, on macOS 12.1 21C52 darwin-x64, locale en)
    • Flutter version 2.10.3 at /Users/goodman/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (5 days ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[?] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/goodman/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/goodman/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[?] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[?] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[?] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      ?? https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      ?? https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[?] VS Code (version 1.65.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[?] Connected device (2 available)
    • iPhone 11 Pro (mobile) • 15850EF2-E8A1-4420-815A-C1A3A33ABE9B • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 99.0.4844.51

[?] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

If you only want to see your current Flutter channel, use this:

flutter channel

The output will look like below:

Flutter channels:
  master
  dev
  beta
* stable

Upgrading Flutter SDK and Switching Flutter channels

In order to upgrade your Flutter SDK, run the following:

flutter upgrade

Flutter has 4 channels: “stable”, “beta”, “dev”, and “master”. To change your channel, use this command:

flutter channel [channel-name]

Wrapping Up

You’ve t learned a few useful commands to use when developing apps with Flutter. Continue exploring more fascinating stuff in Flutter by taking a look at these articles:

You can also check out our Flutter topic page or Dart topic page for the latest tutorials and examples.

Advertisements

Related Articles

Latest Articles