SupergroupFullInfo.fromJson constructor

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

Parse from a json

Implementation

factory SupergroupFullInfo.fromJson(Map<String, dynamic> json) =>
    SupergroupFullInfo(
      photo: json['photo'] == null ? null : ChatPhoto.fromJson(json['photo']),
      description: json['description'],
      memberCount: json['member_count'],
      administratorCount: json['administrator_count'],
      restrictedCount: json['restricted_count'],
      bannedCount: json['banned_count'],
      linkedChatId: json['linked_chat_id'] ?? 0,
      slowModeDelay: json['slow_mode_delay'],
      slowModeDelayExpiresIn: json['slow_mode_delay_expires_in'],
      canGetMembers: json['can_get_members'],
      hasHiddenMembers: json['has_hidden_members'],
      canHideMembers: json['can_hide_members'],
      canSetStickerSet: json['can_set_sticker_set'],
      canSetLocation: json['can_set_location'],
      canGetStatistics: json['can_get_statistics'],
      canToggleAggressiveAntiSpam: json['can_toggle_aggressive_anti_spam'],
      isAllHistoryAvailable: json['is_all_history_available'],
      hasAggressiveAntiSpamEnabled: json['has_aggressive_anti_spam_enabled'],
      stickerSetId: int.tryParse(json['sticker_set_id'] ?? "") ?? 0,
      location: json['location'] == null
          ? null
          : ChatLocation.fromJson(json['location']),
      inviteLink: json['invite_link'] == null
          ? null
          : ChatInviteLink.fromJson(json['invite_link']),
      botCommands: List<BotCommands>.from((json['bot_commands'] ?? [])
          .map((item) => BotCommands.fromJson(item))
          .toList()),
      upgradedFromBasicGroupId: json['upgraded_from_basic_group_id'] ?? 0,
      upgradedFromMaxMessageId: json['upgraded_from_max_message_id'] ?? 0,
      extra: json['@extra'],
      clientId: json['@client_id'],
    );