fromJson static method

KeyboardButtonTypeRequestChat? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static KeyboardButtonTypeRequestChat? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return KeyboardButtonTypeRequestChat(
    id: (json['id'] as int?) ?? 0,
    chatIsChannel: (json['chat_is_channel'] as bool?) ?? false,
    restrictChatIsForum: (json['restrict_chat_is_forum'] as bool?) ?? false,
    chatIsForum: (json['chat_is_forum'] as bool?) ?? false,
    restrictChatHasUsername:
        (json['restrict_chat_has_username'] as bool?) ?? false,
    chatHasUsername: (json['chat_has_username'] as bool?) ?? false,
    chatIsCreated: (json['chat_is_created'] as bool?) ?? false,
    userAdministratorRights: ChatAdministratorRights.fromJson(
      tdMapFromJson(json['user_administrator_rights']),
    ),
    botAdministratorRights: ChatAdministratorRights.fromJson(
      tdMapFromJson(json['bot_administrator_rights']),
    ),
    botIsMember: (json['bot_is_member'] as bool?) ?? false,
    requestTitle: (json['request_title'] as bool?) ?? false,
    requestUsername: (json['request_username'] as bool?) ?? false,
    requestPhoto: (json['request_photo'] as bool?) ?? false,
  );
}