Provider: can't use dart 2.3.0 with provider

Created on 14 May 2019  Â·  5Comments  Â·  Source: rrousselGit/provider

my pubspec.yaml has
sdk: ">=2.1.0 <3.0.0"

If I use 2.3.0 features I get

The for, if and spread elements were not supported until version 2.2.2, but this code is required to be able to run on earlier versions.
Try updating the SDK constraints.

if I change the pubspec.yaml to 2.3.0 as the lower bound then flutter get spits back
Running "flutter packages get" in flutter_provider...
The current Dart SDK version is 2.3.0-dev.0.5.flutter-a1668566e5.

Because flutter_provider requires SDK version >=2.3.0 <3.0.0, version solving failed.
pub get failed (1)
exit code 1

here is my flutter --version
Flutter 1.5.4-hotfix.2 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (2 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

Most helpful comment

I think you're using the wrong package. This package is provider, not flutter_provider.

cc @rrousselGit: please edit the description of this git repo (not the README, but the "title" at the top. The (optional) URL should point to https://pub.dartlang.org/packages/provider.

@stocksp, to address your issue, try changing your pubspec.yaml to say:

sdk: ">=2.3.0-dev.0.5.flutter-a1668566e5 <3.0.0"

And let us know if that fixed your issue. But again, it's a different package. This package's SDK constraints are >=2.0.0 <3.0.0.

All 5 comments

I think you're using the wrong package. This package is provider, not flutter_provider.

cc @rrousselGit: please edit the description of this git repo (not the README, but the "title" at the top. The (optional) URL should point to https://pub.dartlang.org/packages/provider.

@stocksp, to address your issue, try changing your pubspec.yaml to say:

sdk: ">=2.3.0-dev.0.5.flutter-a1668566e5 <3.0.0"

And let us know if that fixed your issue. But again, it's a different package. This package's SDK constraints are >=2.0.0 <3.0.0.

@filiph done

@filiph your sdk: entry did the the trick! FYI my projects name is flutter_provider (I am using the correct package), sorry for the confusion ... and thanks a million for the fix.

Oh! Sorry for the confusion on my part, then. Glad this helped.

For posterity: in semantic versioning (as pub interprets it), 2.3.0-dev.0.5.flutter-a1668566e5 is _not_ considered >=2.3.0, because it's a development version. Only 2.3.0 and up are considered >=2.3.0. This is what you want, because otherwise alpha versions and release candidates would be used where you expect stable stuff.

Just setting sdk constraints to sdk: ">=2.2.2 <3.0.0" will get rid of this warning.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sanekyy picture sanekyy  Â·  5Comments

FaizanKamal7 picture FaizanKamal7  Â·  6Comments

rrousselGit picture rrousselGit  Â·  3Comments

guopeng1994 picture guopeng1994  Â·  4Comments

hou3172568 picture hou3172568  Â·  4Comments