Dart SDK version error when getting dependencies

163

The reason was flutter console being in the beta channel, causing flutter to not upgrade to latest version. Fix was flutter channel dev then flutter upgrade in console.

Share:
163
Yi Li
Author by

Yi Li

Updated on December 06, 2022

Comments

  • Yi Li
    Yi Li over 1 year

    I'm trying to add the http and image Dart packages. After adding the dependencies in pubspec.yaml and attempt to "Get dependencies", I'm getting the version error.

    enter image description here

    I have attempted "Check for Update" in IntelliJ, reinstall Flutter and Dart plug in in IntelliJ, redownload Flutter, and ran "flutter upgrade" in Flutter Console, with no luck. It seems the Dart SDK that comes with Flutter has not been updated.

    I was able to download later version of Dart SDK independently, but if I just drop the dart-sdk folder of a newer version into the Flutter folder, I get more error still.

    How can I update the Dart SDK in the Flutter package, so I can add dependencies?