title: Return a value from Future in dart
body: <p>Can we return or get the value from a Future object in dart. By reading the docs i could understand that we can pass a function in then method of Future class, but still i am clueless how can we return the value.</p>
  
  <p>Consider following as pseudo code</p>
  
  <pre><code>Int getTotalPay(){
  Future&lt;int&gt; pension = getPensionFundAPI(); // a long running api call. don't wait here and call to next api
  int salary = getTotalSalary();
  //wait here till we get the int value received in Future when the above api call completes.
  int result = salary + pension;
  print(result);
  </code></pre>
  
  <p>return result;
      }</p>
  
  <p>i know i can make call to Future.then and pass a callback method in there. but my purpose is to return the result outside of then. same as we do in java and other oops language.</p>
  
  <p>is it possible in dart?</p>