ChatModel.fromSnapshot constructor

ChatModel.fromSnapshot(
  1. DocumentSnapshot<Map<String, Object?>> snapshot
)

Implementation

ChatModel.fromSnapshot(DocumentSnapshot<Map<String, Object?>> snapshot) : super.fromSnapshot(snapshot) {
  var data = snapshot.data()!;
  this.users = List<String>.from((data["users"] as Iterable?) ?? []);
  this.lastMessageReference = data["lastMessage"] as DocumentReference<Map<String, dynamic>>?;
  this.path = snapshot.reference.path;
  this.title = data["title"] as String?;
}