title: How to automatically upgrade Flutter dependencies
body: <p>My Flutter project has a dependency <code>flutter_dotenv</code> at version <code>^2.0.1</code> and I want to automatically upgrade to the new version <code>^2.0.2</code>.</p>
  
  <p>I am running the following command to upgrade it:</p>
  
  <pre><code>flutter pub upgrade
  </code></pre>
  
  <p>Reference: <a href="https://flutter.dev/docs/development/tools/sdk/upgrading#upgrading-packages-only" rel="noreferrer">Upgrading packages only</a></p>
  
  <blockquote>
    <p>To update to the latest compatible versions of all the dependencies
    listed in the pubspec.yaml file, use the upgrade command:</p>
    
    <p>flutter pub upgrade</p>
  </blockquote>
  
  <p>However nothing seems to happen. <code>pubspec.yaml</code> does not change, and the console output does not mention of a new version (which would be enough).</p>
  
  <p>My <code>pubspec.yaml</code> looks like this:</p>
  
  <pre><code>environment:
    sdk: "&gt;=2.1.0 &lt;3.0.0"
  
  dependencies:
    flutter:
      sdk: flutter
    flutter_dotenv: ^2.0.1
    cupertino_icons: ^0.1.2
  
  dev_dependencies:
    flutter_test:
      sdk: flutter
  
  flutter:
    uses-material-design: true
  </code></pre>