JoinedRoomUpdate.fromJson constructor

JoinedRoomUpdate.fromJson(
  1. Map<String, Object?> json
)

Implementation

JoinedRoomUpdate.fromJson(Map<String, Object?> json)
    : summary = json.tryGetFromJson('summary', RoomSummary.fromJson),
      state = json
          .tryGetMap<String, List<Object?>>('state')?['events']
          ?.map((i) => MatrixEvent.fromJson(i as Map<String, Object?>))
          .toList(),
      timeline = json.tryGetFromJson('timeline', TimelineUpdate.fromJson),
      ephemeral = json
          .tryGetMap<String, List<Object?>>('ephemeral')?['events']
          ?.map((i) => BasicRoomEvent.fromJson(i as Map<String, Object?>))
          .toList(),
      accountData = json
          .tryGetMap<String, List<Object?>>('account_data')?['events']
          ?.map((i) => BasicRoomEvent.fromJson(i as Map<String, Object?>))
          .toList(),
      unreadNotifications = json.tryGetFromJson(
        'unread_notifications',
        UnreadNotificationCounts.fromJson,
      );