deleteDocument method

  1. @override
Future<void> deleteDocument(
  1. String collection,
  2. String documentId
)
override

Deletes a document from Firestore by its ID.

This method deletes a document from the specified Firestore collection using its document ID.

collection: The name of the Firestore collection. documentId: The ID of the document to be deleted.

Returns a Future that resolves when the document is deleted.

Implementation

@override
Future<void> deleteDocument(String collection, String documentId) {
  // Delete the document from the collection using its ID
  return FirebaseFirestore.instance
      .collection(collection)
      .doc(documentId)
      .delete();
}