I'm creating a Todo App and I need to access the ids of my documents stored in firestore in order to delete them. But I can't figure out how to save it when I'm creating it. Here's the part in my Add screen where I create a new document.
_firestore.collection('todos').add({
'title' : title,
'type' : type,
'date' : dayDate,
'time' : _dayTime,
'category' : category,
'author' : loggedInUser.uid,
//'id' : doc.id
});
I don't know how to acess it. And also I display my tasks into cards and when i long press them I want them to delete from firestore but I can't bc I don't have their idea. Here's my empty function:
void deleteTask(){
_firestore.collection("todos").doc().delete();
}
If you have any ideas please tell me. Thanks guys!