ChatThreadEvent.fromJson constructor

ChatThreadEvent.fromJson(
  1. Map map
)

Implementation

factory ChatThreadEvent.fromJson(Map map) {
  String from = map["from"];
  ChatThreadOperation type = ChatThreadOperation.values[map["type"]];
  ChatThread? chatThread = map.getValue<ChatThread>(
    "thread",
    callback: (map) {
      if (map == null) {
        return null;
      }
      return ChatThread.fromJson(map);
    },
  );

  return ChatThreadEvent._private(
    type: type,
    from: from,
    chatThread: chatThread,
  );
}