The current Dart SDK version is 2.10.4. how can I change the version into a upper version .? In a beta or dev channel

Viewed 46919

Because classbe depends on cupertino_icons >=1.0.1 which requires SDK version >=2.12.0-0 <3.0.0, version solving failed. Running "flutter pub get" in classbe... pub get failed (1; Because classbe depends on cupertino_icons >=1.0.1 which requires SDK version >

3 Answers

Update your pubspec.yaml depending on the flutter channel you want to work on:

If you are on stable channel :

environment:
  sdk: ">=2.10.5 <3.0.0"

dependencies:
  cupertino_icons: ^1.0.0

If you are on beta channel :

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  cupertino_icons: ^1.0.1

Then if you are on stable channel (or beta),

flutter channel stable
# or flutter channel beta
flutter upgrade
flutter pub get
flutter channel beta
flutter upgrade

If you work on Windows do the following:

Open PowerShell as Admin use

choco install dart-sdk

or to upgrade

choco upgrade dart-sdk

By default, the SDK is installed at C:\tools\dart-sdk

Than go to your IDE and check the location of your Dart SDK. For Intellij use

File->Settings->Language & Framework->Dart->Dart SDK path

Her paste C:\tools\dart-sdk (by default)

Related