Created the [FirestoreProvider], added the id attribute to the user, event and task models
This commit is contained in:
parent
5c2375fb21
commit
c1a0487071
5 changed files with 146 additions and 19 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:meta/meta.dart';
|
||||
|
||||
class TaskModel {
|
||||
final String id;
|
||||
final String text;
|
||||
final int priority;
|
||||
final String ownerUsername;
|
||||
|
|
@ -8,6 +9,7 @@ class TaskModel {
|
|||
final String event;
|
||||
|
||||
TaskModel({
|
||||
@required this.id,
|
||||
@required this.text,
|
||||
@required this.priority,
|
||||
@required this.ownerUsername,
|
||||
|
|
@ -15,8 +17,9 @@ class TaskModel {
|
|||
@required this.event,
|
||||
});
|
||||
|
||||
TaskModel.fromFirestore(Map<String, dynamic> firestoreMap)
|
||||
: text = firestoreMap["text"],
|
||||
TaskModel.fromFirestore(Map<String, dynamic> firestoreMap, String id)
|
||||
: id = id,
|
||||
text = firestoreMap["text"],
|
||||
priority = firestoreMap["priority"],
|
||||
ownerUsername = firestoreMap["ownerUsername"],
|
||||
done = firestoreMap["done"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue