title: How to delete a subcollection from firestore flutter
body: <p>so am new using firestore to store data. at the moment i need to delete data already saved in the Firestore through my App. I have tried</p>
  
  <pre><code>  Future&lt;void&gt; removeDocument(String id, String userId){
      return ref.document(userId).collection(userId).document(id).delete().whenComplete((){
        print("DELETE DONE::");
      });
  
    }
  </code></pre>
  
  <p>But its not working.
  The thing is I used the userId to save the user details<a href="https://i.stack.imgur.com/AiKMg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AiKMg.png" alt="enter image description here"></a></p>
  
  <p>now I want to delete the data but it does not delete the data even though the print message shows in my Log.
  The method below is how i add data to the Firestore</p>
  
  <pre><code> Future&lt;void&gt; addDocument(Map data, String userId){
      return ref.document(userId).collection(userId).add(data);
    }
  
  
  void setupLocatorWorkout() {
    locatorWorkout.registerLazySingleton(() =&gt; Api('workout_goal'));
    locatorWorkout.registerLazySingleton(() =&gt; CRUDRemoteDataSource());
  }
  
  
  
  
   Api(this.path){
      print("$path");
      ref = _db.collection(path); // this is the base collection
    }
  </code></pre>
  
  <p>please what am i doing wrong here?
  Thank you!!!</p>