Implemented method to add a task to firestore

This commit is contained in:
Mariano Uvalle 2019-02-23 15:22:24 -06:00
parent 5c46398be1
commit 9374108453

View file

@ -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