TopChatCategory.fromJson constructor

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

Implementation

factory TopChatCategory.fromJson(Map<String, dynamic> json)  {
  switch(json["@type"]) {
    case TopChatCategoryUsers.CONSTRUCTOR:
      return TopChatCategoryUsers.fromJson(json);
    case TopChatCategoryBots.CONSTRUCTOR:
      return TopChatCategoryBots.fromJson(json);
    case TopChatCategoryGroups.CONSTRUCTOR:
      return TopChatCategoryGroups.fromJson(json);
    case TopChatCategoryChannels.CONSTRUCTOR:
      return TopChatCategoryChannels.fromJson(json);
    case TopChatCategoryInlineBots.CONSTRUCTOR:
      return TopChatCategoryInlineBots.fromJson(json);
    case TopChatCategoryCalls.CONSTRUCTOR:
      return TopChatCategoryCalls.fromJson(json);
    case TopChatCategoryForwardChats.CONSTRUCTOR:
      return TopChatCategoryForwardChats.fromJson(json);
    default:
      return const TopChatCategory();
  }
}