title: DART: syntax of future then
body: <p>I don´t understand the syntax of the <code>then()</code> clause.</p>
  
  <p><strong>1.</strong> <code>myFuture(6).then( (erg) =&gt; print(erg) )</code></p>
  
  <p>What´s <code>(erg) =&gt; expr</code> syntactically?</p>
  
  <p>I thougt it could be a function, but</p>
  
  <pre><code>then( callHandler2(erg)
  </code></pre>
  
  <p>doesn´t work, Error:</p>
  
  <pre><code>"Multiple markers at this line
  - The argument type 'void' cannot be assigned to the parameter type '(String) -&gt; 
   dynamic'
  - Undefined name 'erg'
  - Expected to find ')'"
  </code></pre>
  
  <p><strong>2.</strong> <code>myFuture(5).then( (erg) { callHandler(erg);}, 
                      onError: (e) =&gt; print (e)</code>  </p>
  
  <pre><code>What´s `onError: (e) =&gt; expr"` syntactically?
  </code></pre>
  
  <p><strong>3.</strong> Is there a difference between the <code>onError:</code> and the <code>.catchError(e)</code> variants?</p>