title: Flutter returning a bool type from a Future<bool> Method
body: <p>This question is quite similar to <a href="https://stackoverflow.com/questions/52477468/flutter-futurebool-vs-bool-type">this</a> but the explanation didn't quite help for my use-case. I have a method of type Future that return a bool performing a query to cloud firestore to check if the username the user is entering already exists.</p>
  <pre><code>static Future&lt;bool&gt; doesNameAlreadyExist(String value, String 
  name) async{
  final QuerySnapshot result = await Firestore.instance
    .collection('users')
    .where(value, isEqualTo: name)
    .limit(1)
    .getDocuments();
    final List&lt;DocumentSnapshot&gt; documents = result.documents;
   return  documents.length == 1;
  </code></pre>
  <p>}</p>
  <p>When i call that method here i get this error <a href="https://i.stack.imgur.com/JLohQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JLohQ.png" alt="enter image description here" /></a></p>
  <p>Is there a way to get a return type of bool from a Future</p>