Room.fromJson constructor
Implementation
factory Room.fromJson(Map<String, dynamic> json, Client client) {
final room = Room(
client: client,
id: json['id'],
membership: Membership.values.singleWhere(
(m) => m.toString() == 'Membership.${json['membership']}',
orElse: () => Membership.join,
),
notificationCount: json['notification_count'],
highlightCount: json['highlight_count'],
prev_batch: json['prev_batch'],
summary: RoomSummary.fromJson(Map<String, dynamic>.from(json['summary'])),
);
if (json['last_event'] != null) {
room._lastEvent = Event.fromJson(json['last_event'], room);
}
return room;
}