RoomsUpdate.fromJson constructor

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

Implementation

RoomsUpdate.fromJson(Map<String, Object?> json) {
  join = json.tryGetMap<String, Object?>('join')?.catchMap(
        (k, v) =>
            MapEntry(k, JoinedRoomUpdate.fromJson(v as Map<String, Object?>)),
      );
  invite = json.tryGetMap<String, Object?>('invite')?.catchMap(
        (k, v) => MapEntry(
          k,
          InvitedRoomUpdate.fromJson(v as Map<String, Object?>),
        ),
      );
  leave = json.tryGetMap<String, Object?>('leave')?.catchMap(
        (k, v) =>
            MapEntry(k, LeftRoomUpdate.fromJson(v as Map<String, Object?>)),
      );
  knock = json.tryGetMap<String, Object?>('knock')?.catchMap(
        (k, v) =>
            MapEntry(k, KnockRoomUpdate.fromJson(v as Map<String, Object?>)),
      );
}