So you are getting the “Try updating the SDK constraints” message:
Here I am trying to use the collection spread operator, but this Flutter project has to support Dart 2.1.0 through 3.0.0 according to what is specified in my
# pubspec.yaml # ... environment: sdk: ">=2.1.0 <3.0.0"
As the collection spread operator was introduced in Dart 2.2.2, we need to update the lower boundary:
# pubspec.yaml # ... environment: sdk: ">=2.2.2 <3.0.0"
(Clicking the “Quick Fix” link in VS Code will do this for us! But it won't save the file.)
flutter pub get and voilà, warning gone!