Implemented method to add a task to firestore
This commit is contained in:
parent
5c46398be1
commit
9374108453
1 changed files with 6 additions and 0 deletions
|
|
@ -46,6 +46,12 @@ class FirestoreProvider {
|
|||
|
||||
//-------------------------Task related operations----------------------------
|
||||
|
||||
/// Adds a task to the tasks collection in firestore.
|
||||
Future<void> addTask(TaskModel task) async {
|
||||
final dataMap = task.toFirestoreMap();
|
||||
await firestore.collection('tasks').add(dataMap);
|
||||
}
|
||||
|
||||
/// Returns a stream of [List<Task>]
|
||||
///
|
||||
/// The [event] parameter is used to query tasks that are part of a certain
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue