title: How to check whether a user exists in firebase cloudstore or not in a flutter application while reigisteration is done?
body: <p>When i try to check whether a particular number exists in firebase collection or not I always get a null in return. What is the reason for that?</p>
  
  <p>How can I overcome this issue so that the function <code>_numberCheck()</code> returns a Boolean value which I can use for further processing?</p>
  
  <p>The code for the registration page is as follows:</p>
  
  <pre><code>    Future&lt;bool&gt; _numberCheck(mobileno) async {
      print("Start of the function");
      db
          .collection("transcriber_user_registeration")
          .getDocuments()
          .then((QuerySnapshot snapshot) {
        snapshot.documents.forEach((f) async {
          isPresent = true;
          isPresent = false;
          if ('${f.data['userid']}' == mobileno) {
            setState(() {
              isPresent = true;
            });
          } else {
            setState(() {
              isPresent = false;
            });
          }
        });
      });
  //    print(isPresent);
      return isPresent;
    }
  </code></pre>