title: Error Message Dart 2.5 The for, if, and spread elements weren't supported until version 2.2.2
body: <p>Use of the spread (...) element produces the following error:</p>
  
  <p>"The for, if, and spread elements weren't supported until version 2.2.2, but this code is required to be able to run on earlier versions.
  Try updating the SDK constraints."</p>
  
  <p>Changing pubspec.yaml to:</p>
  
  <pre><code> environment:
      sdk: "&gt;=2.x &lt;3.0.0"
  </code></pre>
  
  <p>for values of x from 2.2 up to 5.0 doesn't remove the error. Autofix just sets it to ">=2.2.2 &lt;3.0.0".</p>
  
  <p>The code runs fine, it's just an annoyance as there is one instance of the error for each file it's used in - which leads to the Problem window being full of pointless messages. Is there the possibility that something is requiring a lower version of the sdk, and if so what/where might it be?</p>
  
  <hr>
  
  <p>Flutter 1.9.1+hotfix.6 • channel stable • <a href="https://github.com/flutter/flutter.git" rel="nofollow noreferrer">https://github.com/flutter/flutter.git</a></p>
  
  <p>Framework • revision 68587a0916 (6 weeks ago) • 2019-09-13 19:46:58 -0700</p>
  
  <p>Engine • revision b863200c37</p>
  
  <p>Tools • Dart 2.5.0</p>
  
  <p>Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.295], locale en-GB)</p>
  
  <p>Android toolchain - develop for Android devices (Android SDK version 29.0.1)</p>
  
  <p>Android Studio (version 3.4)</p>