 class="language-dart"><code>Future doStuff(){
  return someAsyncOperation().then((result) {
    return someOtherAsyncOperation(result);
  });
}
</code></pre>
<p>If you do need to create a Future from scratch — for example,
when you're converting a callback-based API into a Future-based
one — you can use a Completer as follows:</p>
<pre class="language-dart"><code>class AsyncOperation {
  Completer _completer = new Completer();

  Future&lt;T&gt; doOperation() {
    _startOperation();
    return _comple