Room.fromJson constructor

Room.fromJson(
  1. Map<String, dynamic> json,
  2. Client client
)

Implementation

factory Room.fromJson(Map<String, dynamic> json, Client client) => 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'])),
    );