Dart Version Different in Pub Runner Than `flutter --version`

Viewed 224

Here are the results of the flutter --version command:

Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4d7946a68d (2 days ago) • 2021-03-18 17:24:33 -0700
Engine • revision 3459eb2436
Tools • Dart 2.12.2

Whenever I try to save my pubspec.yaml, I get this output:

The current Dart SDK version is 2.10.3.
...
Because adaptive_theme 2.0.0 requires SDK version >=2.12.0 <3.0.0 and no versions of adaptive_theme match >2.0.0 <3.0.0, adaptive_theme ^2.0.0 is forbidden.

I have this exact project on another computer with the same pubspec.yaml, same pubspec.lock, same flutter version. Everything is the same, but this one doesn't work.

EDIT: Here is my environment from pubspec.yaml:

environment:
  sdk: ">=2.7.0 <3.0.0"
1 Answers

I think the reason is that computer has Dart SDK installed with different version of Dart SDK embedded in Flutter.

Related