Party.fromSnapshot constructor
Constructor used to create a Party instance from a DocumentSnapshot
,
which is, essentially, a Map
.
Implementation
Party.fromSnapshot(DocumentSnapshot snapshot) {
privacy = new Privacy();
name = snapshot['name'];
place = snapshot['place'];
description = snapshot['description'];
imageUrl = snapshot['imageUrl'];
fromDayTime = snapshot['fromDayTime'];
toDayTime = snapshot['toDayTime'];
privacy.type = snapshot['privacy'];
catalogue = new Catalogue.fromFirestore(snapshot['catalogue']);
if (snapshot['organiserUid'] != null) {
organiserUid = snapshot['organiserUid'];
}
id = snapshot.documentID;
// TODO: implement the user and the Pinder-points
rating = 3.5;
ratingNumber = 23;
pinderPoints = 6;
}