title: FLUTTER FIRESTORE -Query the field and get document id and check other field
body: <p>am trying to get the searched value(userid) which is in the field of a document in firestore I want to check the other fields(status) of the document I tried this method but failed</p>
  
  <pre><code>handlesubmit(BuildContext context)async{
  
  final QuerySnapshot searcheduserid=
                 await Firestore.instance.collection('users')
              .where('userid',isEqualTo: userid).limit(1).getDocuments();
  
  final userdocid=searcheduserid.documents.map((doc)=&gt;doc.documentID);
  
  final DocumentSnapshot getuserdoc= await Firestore.instance.collection('users')
                        .document(userdocid).get();
  
  final userstatus = getuserdoc.data['status'];
  //  I GET AN ERROR HERE ERROR SAYS
  
  // METHOD [](status) was called on null
  
      if(userstatus==null){
          return showdialog( context,'the entered user id status does not exist');
      }
  }
  </code></pre>