MessageSource.fromJson constructor

MessageSource.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MessageSource.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case MessageSourceChatHistory.CONSTRUCTOR:
      return MessageSourceChatHistory.fromJson(json);
    case MessageSourceMessageThreadHistory.CONSTRUCTOR:
      return MessageSourceMessageThreadHistory.fromJson(json);
    case MessageSourceForumTopicHistory.CONSTRUCTOR:
      return MessageSourceForumTopicHistory.fromJson(json);
    case MessageSourceHistoryPreview.CONSTRUCTOR:
      return MessageSourceHistoryPreview.fromJson(json);
    case MessageSourceChatList.CONSTRUCTOR:
      return MessageSourceChatList.fromJson(json);
    case MessageSourceSearch.CONSTRUCTOR:
      return MessageSourceSearch.fromJson(json);
    case MessageSourceChatEventLog.CONSTRUCTOR:
      return MessageSourceChatEventLog.fromJson(json);
    case MessageSourceNotification.CONSTRUCTOR:
      return MessageSourceNotification.fromJson(json);
    case MessageSourceScreenshot.CONSTRUCTOR:
      return MessageSourceScreenshot.fromJson(json);
    case MessageSourceOther.CONSTRUCTOR:
      return MessageSourceOther.fromJson(json);
    default:
      return const MessageSource();
  }
}