deleteData method

Future<bool> deleteData(
  1. String documentPath
)

Deletes a Firestore document.

  • documentPath: Path to the Firestore document.

Returns true if successful, false otherwise.

Implementation

Future<bool> deleteData(String documentPath) async {
  try {
    await _firestore.doc(documentPath).delete();
    debugPrint('Document deleted successfully.');
    return true;
  } catch (e) {
    debugPrint('Error deleting document: $e');
    return false;
  }
}