Fixed flutter version on pubspec.yaml

Viewed 634

When you create a flutter project it creates a pubspec.yaml with:

environment:
  sdk: ">=2.7.0 <3.0.0"
  1. Why is this version not fixed? like sdk: 1.17.5
  2. How can I define it to have only one flutter and dart version supported?

Im worried about this since we can get build problems or runtime issues that are not reproducible because of an internal version change.

1 Answers

I was able to set the version fixed for flutter and dart with the environment block:

environment:
  sdk: "2.8.4" # Dart
  flutter: 1.17.5

with that the pubspec.lock does have the fixed version:

sdks:
  dart: "2.8.4"
  flutter: "1.17.5"
Related