-1

I am facing a problem that really isn't making any sense, a problem that started when I wanted to use the "http" and "provide" dependencies by entering them into the pubspec.yaml file.

pubspec.yaml

pub get won't run due to the dart version being lower than 2.16.1 even though when I run dart --version it informs me that I do have the latest dart version (2.16.1).

cmd results

I tried finding answers on the internet including on the https://dart.dev/ site. I really don't know what else to do at this point, as this is for my assignment due on the 25th of March 2022. please help.

ibhavikmakwana
  • 8,948
  • 4
  • 20
  • 39

1 Answers1

0

In your pubspec.yaml, just above where your screenshot cuts off, there is a line that looks like this.

environment:
  sdk: ">=2.14.0 <3.0.0"

Update this to the following:

environment:
  sdk: ">=2.16.1 <3.0.0"

You updated Dart on your local machine, but you never updated your project to reflect that it should use this version (or a higher version).

Tim Jacobs
  • 1,023
  • 1
  • 8
  • 14