title: How can I use async in a named constructor?
body: <p>I created a class, and I want to use async in a named constructor or a method in the class that is accessible outside the class.  When making the named constructer return a <code>Future</code> type, I get an error saying: <code>Constructors can't have a return type</code>.</p>
  
  <p>I then tried removing the <code>Future</code> type, and I still get an error saying <code>The modifier 'async' can't be applied to the body of a constructor</code>. </p>
  
  <p>How can I use async in a named constructor?</p>
  
  <pre><code>class HttpService {
    Future&lt;void&gt; HttpService.getAll() async {
      final response = await http.get(
        Uri.encodeFull('http://localhost:4000/'),
        headers: {'headers': 'application/json'},
      );
  
      if (response.statusCode == 200) {}
    }
  }
  </code></pre>
  
  <p>I am new to oop, so I may be using it wrong? Any guidance is accepted.</p>