delete method
Implementation
Future<bool> delete(String? docId) async {
if (docId == null || docId.trim().isEmpty) {
return false;
}
bool delete = true;
try {
final DocumentReference ref = _collection!.doc(docId);
delete = await ref.delete().then((_) {
return true;
}).catchError((Object ex) {
setError(ex);
return false;
});
} catch (ex) {
setError(ex);
delete = false;
}
return delete;
}