10
votes

I'm getting the following error due to Dart version of my flutter setup when I run the flutter get packages command:

[project_name] flutter packages get Running "flutter packages get" in project_name...
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.

Because project depends on intl_translation >=0.14.0+1 <0.17.0 which requires SDK version >=1.12.0 <2.0.0, version solving failed. pub get failed (1) exit code 1

My framework version:

Flutter 0.6.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 9299c02cf7 (2 weeks ago) • 2018-08-16 00:35:12 +0200
Engine • revision e3687f70c7
Tools • Dart 2.1.0-dev.0.0.flutter-be6309690f

I would like to learn if there's some kind of command to lower dart-sdk version of the flutter framework, thanks in advance.

3
Why do you limit intl_translations to <0.17.0? intl_translations: ^0.17.0 works for me. - Günter Zöchbauer
intl_translation: "^0.16.7" with intl: ^0.15.4 in implementation, so I didn't want to change it - Canberk Ozcelik
Then you can't switch to a Flutter version that includes Dart 2. - Günter Zöchbauer
Actually, the problem seems version of Dart 2.1.0, I only need Dart 2.0.0 - Canberk Ozcelik
It's unlikely 2.1.0, but instead 2.0.0 that causes the problem. If a dependency has 2.0.0-... this is lower than 2.0.0. - Günter Zöchbauer

3 Answers

7
votes

In the Flutter install directory execute

git checkout v"0.5.0" // for example

You can check which versions are available in the Flutter GitHub repository https://github.com/flutter/flutter

1
votes

You can only change the Dart version if you change to a Flutter version that contains the desired Dart version.

Change the dependency to

dev_dependencies:
  intl_translations: ^0.17.0
0
votes

Add following dependency in pubspec.yaml file

version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"