0
$fvm flutter run 
Running "flutter pub get" in flutterweb...                      
The current Dart SDK version is 2.13.4.

Because flutterweb requires SDK version >=2.14.0 <3.0.0, version solving failed.

I have this error.

Hoever --version is 2.14.2

$ dart --version
Dart SDK version: 2.14.2 (stable) (Wed Sep 15 12:32:06 2021 +0200) on "macos_x64"

in pubspec.yaml

environment:
  sdk: ">=2.14.0 <3.0.0"

Where should I check??

whitebear
  • 11,200
  • 24
  • 114
  • 237

2 Answers2

1

I did it this way: Open the cmd as Administrator, and run:

flutter upgrade

This works for me.

Code at cmd

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Nhan Trinh
  • 45
  • 1
  • 1
  • 7
1

Which Flutter version are you using? 2.5?

Because different flutter versions require different dart versions. You should try flutter upgrade and if that doesn't fix it, try flutter channel stable.

Mayank
  • 1,595
  • 1
  • 11
  • 26
  • I appreciate your help, I thought I have to upgrade dart itself, but flutter can upgrade dart as you told. – whitebear Sep 23 '21 at 05:14