title: How to get, set, update and delete data from the cloud firestore in Flutter?
body: <p>I tried some code but getting an exception.</p>
  
  <p>The Exception that I'm getting:
     <code>java.lang.IllegalArgumentException: Invalid document reference. Document references must have an even number of segments, but Users has 1</code></p>
  
  <p>I searched for it, according to <a href="https://stackoverflow.com/questions/53298957/invalid-document-reference-document-references-must-have-an-even-number-of-segm">this</a>, Document references must have an even number of segments <strong>like: Collection - document - Collection - document - Collection - document</strong></p>
  
  <p><strong>Query for getting data from firestore:</strong></p>
  
  <pre><code>String getIsNewUSer;
  Firestore.instance.collection('Users').document(uid).get().then((DocumentSnapshot document){
         print("document_build:$document");
          setState(() {
           getIsNewUSer=document['IsNewUser'];
           print("getIsNewUSe:$getIsNewUSer");
          });
  
      });
  
  </code></pre>
  
  <p><strong>Query for Updating data to the firestore:</strong></p>
  
  <pre><code>Firestore.instance
              .collection('Users')
              .document(uid)
              .updateData({
                "IsNewUser":"1"
              }).then((result){
                print("new USer true");
              }).catchError((onError){
               print("onError");
              });
  </code></pre>
  
  <p>These code line at I'm getting above Exception.</p>
  
  <p><strong>initState:</strong></p>
  
  <pre><code> void initState()  {
      super.initState();
      this.uid = '';
  
  FirebaseAuth.instance.currentUser().then((val){
        setState(() {
        this.uid= val.uid; 
         print("uid_init: $uid");
        });
     });
  
  }
  </code></pre>
  
  <p>Am I doing wrong?????..</p>