Eternalcode
Eternalcode

Reputation: 2412

What does the pubspec.yaml's environment mean in this context?

I notice the environment variable in the intl package's pubspec.yaml says that it supports between the sdk '1.4.0 to 2.0.0'

I found the description of the environment variable here

But, That particular version's numer_format.dart has the null aware operators that are not introduced until 1.12.0.

Am I understanding the definition of the pubspec's environment variable correctly?

Thanks

Upvotes: 9

Views: 11313

Answers (3)

Heshan Sandeepa
Heshan Sandeepa

Reputation: 3687

environment:
sdk: ">=2.16.1 <=3.1.0"

This means the Dart SDK version.

packages & dependencies of your project must be supported above the SDK range.

Upvotes: 3

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657929

environment:
  sdk: '>1.3.0 <= 2.0.0'

is not related to operating system environment variables, it is just a constraint for the environment where the package is supposed to work, and the only setting currently supported is the Dart SDK version. The version range is according to the semantic versioning used in Dart for the SDK and pub packages.

Upvotes: 6

Alexandre Ardhuin
Alexandre Ardhuin

Reputation: 76323

You are correct the SDK constraint should be modified to something like >=1.12.0 <2.0.0. You can file an issue (or even better submit a Pull-request).

Upvotes: 3

Related Questions