Dart version is still same even after updating Flutter

I need the latest version of the dart to use a package in android studio. So I tried to update flutter and checked the dart version. The version got updated as shown below. But the dart --version still shows the old version being used by the app

flutter --version

Flutter 2.3.0-0.1.pre • channel dev • https://github.com/flutter/flutter.git

Framework • revision d72bfb8d07 (7 days ago) • 2021-04-26 06:05:55 -0700

Engine • revision de6e1adf97

Tools • Dart 2.14.0 (build 2.14.0-18.0.dev)

dart --version

Dart SDK version: 2.10.5 (stable) (Unknown timestamp) on "linux_x64"

enter image description here

1 answer

  • answered 2021-05-03 12:09 Christian

    Dart version compatibility depends on your pubspec.yaml. If you want to force 2.12.0 you can declare:

      sdk: ">=2.12.0 <3.0.0"