oneWithID method

Future<void> oneWithID(
  1. Type type,
  2. String documentID, {
  3. String? subcollection,
})

Deletes a document from Firestore by its type and document ID.

Implementation

Future<void> oneWithID(Type type, String documentID, { String? subcollection }) {
  DocumentReference ref = FS.instance.collection(type.toString()).doc(documentID);
  if (subcollection != null) {
    ref = FS.instance.collection(type.toString()).doc(subcollection).collection(subcollection).doc(documentID);
  }
  return ref.delete();
}