title: Rewrite sort((a, b) =>) to being async
body: <p>I am having a method which should sort a <code>List&lt;OuterClass&gt;</code>. The problem is, that in order to sort, I need to retrieve the <code>InnerClass</code>, which I only get via an async call.</p>
  <pre class="lang-dart prettyprint-override"><code>class OuterClass {
    final Uuid innerClassId;
  }
  
  class InnerClass {
    final Uuid id;
    final String name;
  }
  
  class InnerClassRepository {
    Future&lt;InnerClass&gt; getById(Uuid id) async { ...
  }
  </code></pre>
  <p>And here is an example how I want to sort a list</p>
  <pre class="lang-dart prettyprint-override"><code>Future&lt;List&lt;OuterClass&gt;&gt; sortOuterClassList(List&lt;OuterClass&gt; sourceList) async {
    return sourceList.sort((a, b) async {
    
      var innerClassA = await _innerClassRepository.getById(a.innerClassId);
      var innerClassB = await _innerClassRepository.getById(b.innerClassId);
  
      return innerClassA.name.compareTo(innerClassB.name);
    }
  }
  </code></pre>
  <p>The problem is, that the <code>sort()</code> method is a synchronous function, so I am not able to call an async one. Is there a way to rewrite the <code>sort()</code> method? Else how would you write the this function <code>sortOuterClassList()</code>?</p>