Implemented 'to map' methods in the task and summary model
This commit is contained in:
parent
8498517b1e
commit
1869515bc3
2 changed files with 25 additions and 0 deletions
|
|
@ -39,4 +39,19 @@ class SummaryModel {
|
|||
completedFriday = map["completedFriday"];
|
||||
addedFriday = map["addedFriday"];
|
||||
}
|
||||
|
||||
Map<String, int> toMap() {
|
||||
return <String, int>{
|
||||
"completedMonday": completedMonday,
|
||||
"addedMonday": addedMonday,
|
||||
"completedTuesday": completedTuesday,
|
||||
"addedTuesday": addedTuesday,
|
||||
"completedWednesday": completedWednesday,
|
||||
"addedWednesday": addedWednesday,
|
||||
"completedThursday": completedThursday,
|
||||
"addedThursday": addedThursday,
|
||||
"completedFriday": completedFriday,
|
||||
"addedFriday": addedFriday,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,14 @@ class TaskModel {
|
|||
ownerUsername = firestoreMap["ownerUsername"],
|
||||
done = firestoreMap["done"],
|
||||
event = firestoreMap["event"];
|
||||
|
||||
Map<String, dynamic> toFirestoreMap() {
|
||||
return <String, dynamic>{
|
||||
"text": text,
|
||||
"priority": priority,
|
||||
"ownerUsername": ownerUsername,
|
||||
"done": done,
|
||||
"event": event,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue