title: Difference between .then() and .whenCompleted() methods when working with Futures?
body: <p>I'm exploring Futures in Dart, and I'm confused about these two methods that Future offers, <code>.then()</code> and <code>.whenCompleted()</code>. What's the main difference between them?</p>
  <p>Lets say I want to read a .txt using <code>.readAsString()</code>, I would do it like this:</p>
  <pre><code>void main(){
    File file = new File('text.txt');
    Future content = file.readAsString();
    content.then((data) {
      print(content);
    });  
  }
  </code></pre>
  <p>So <code>.then()</code> is like a callback that fires a function once the Future is completed.</p>
  <p>But I see there is also <code>.whenComplete()</code> that can also fire a function once Future completes. Something like this :</p>
  <pre><code>void main(){
    File file = new File('text.txt');
    Future content = file.readAsString();
    content.whenComplete(() {
      print(&quot;Completed&quot;);
    });
  }
  </code></pre>
  <p>The difference I see here is that <code>.then()</code> has access to data that was returned!
  What is <code>.whenCompleted()</code> used for? When should we choose one over the other?</p>