create static method

Chat create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "chat",
  3. String special_return_type = "chat",
  4. num? id,
  5. ChatType? type,
  6. String? title,
  7. ChatPhotoInfo? photo,
  8. num? accent_color_id,
  9. num? background_custom_emoji_id,
  10. num? profile_accent_color_id,
  11. num? profile_background_custom_emoji_id,
  12. ChatPermissions? permissions,
  13. Message? last_message,
  14. List<ChatPosition>? positions,
  15. List<ChatList>? chat_lists,
  16. MessageSender? message_sender_id,
  17. BlockList? block_list,
  18. bool? has_protected_content,
  19. bool? is_translatable,
  20. bool? is_marked_as_unread,
  21. bool? view_as_topics,
  22. bool? has_scheduled_messages,
  23. bool? can_be_deleted_only_for_self,
  24. bool? can_be_deleted_for_all_users,
  25. bool? can_be_reported,
  26. bool? default_disable_notification,
  27. num? unread_count,
  28. num? last_read_inbox_message_id,
  29. num? last_read_outbox_message_id,
  30. num? unread_mention_count,
  31. num? unread_reaction_count,
  32. ChatNotificationSettings? notification_settings,
  33. ChatAvailableReactions? available_reactions,
  34. num? message_auto_delete_time,
  35. EmojiStatus? emoji_status,
  36. ChatBackground? background,
  37. String? theme_name,
  38. ChatActionBar? action_bar,
  39. BusinessBotManageBar? business_bot_manage_bar,
  40. VideoChat? video_chat,
  41. ChatJoinRequestsInfo? pending_join_requests,
  42. num? reply_markup_message_id,
  43. DraftMessage? draft_message,
  44. String? client_data,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static Chat create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "chat",
  String special_return_type = "chat",
  num? id,
  ChatType? type,
  String? title,
  ChatPhotoInfo? photo,
  num? accent_color_id,
  num? background_custom_emoji_id,
  num? profile_accent_color_id,
  num? profile_background_custom_emoji_id,
  ChatPermissions? permissions,
  Message? last_message,
  List<ChatPosition>? positions,
  List<ChatList>? chat_lists,
  MessageSender? message_sender_id,
  BlockList? block_list,
  bool? has_protected_content,
  bool? is_translatable,
  bool? is_marked_as_unread,
  bool? view_as_topics,
  bool? has_scheduled_messages,
  bool? can_be_deleted_only_for_self,
  bool? can_be_deleted_for_all_users,
  bool? can_be_reported,
  bool? default_disable_notification,
  num? unread_count,
  num? last_read_inbox_message_id,
  num? last_read_outbox_message_id,
  num? unread_mention_count,
  num? unread_reaction_count,
  ChatNotificationSettings? notification_settings,
  ChatAvailableReactions? available_reactions,
  num? message_auto_delete_time,
  EmojiStatus? emoji_status,
  ChatBackground? background,
  String? theme_name,
  ChatActionBar? action_bar,
  BusinessBotManageBar? business_bot_manage_bar,
  VideoChat? video_chat,
  ChatJoinRequestsInfo? pending_join_requests,
  num? reply_markup_message_id,
  DraftMessage? draft_message,
  String? client_data,
}) {
  // Chat chat = Chat({
  final Map chat_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "type": (type != null) ? type.toJson() : null,
    "title": title,
    "photo": (photo != null) ? photo.toJson() : null,
    "accent_color_id": accent_color_id,
    "background_custom_emoji_id": background_custom_emoji_id,
    "profile_accent_color_id": profile_accent_color_id,
    "profile_background_custom_emoji_id": profile_background_custom_emoji_id,
    "permissions": (permissions != null) ? permissions.toJson() : null,
    "last_message": (last_message != null) ? last_message.toJson() : null,
    "positions": (positions != null) ? positions.toJson() : null,
    "chat_lists": (chat_lists != null) ? chat_lists.toJson() : null,
    "message_sender_id": (message_sender_id != null) ? message_sender_id.toJson() : null,
    "block_list": (block_list != null) ? block_list.toJson() : null,
    "has_protected_content": has_protected_content,
    "is_translatable": is_translatable,
    "is_marked_as_unread": is_marked_as_unread,
    "view_as_topics": view_as_topics,
    "has_scheduled_messages": has_scheduled_messages,
    "can_be_deleted_only_for_self": can_be_deleted_only_for_self,
    "can_be_deleted_for_all_users": can_be_deleted_for_all_users,
    "can_be_reported": can_be_reported,
    "default_disable_notification": default_disable_notification,
    "unread_count": unread_count,
    "last_read_inbox_message_id": last_read_inbox_message_id,
    "last_read_outbox_message_id": last_read_outbox_message_id,
    "unread_mention_count": unread_mention_count,
    "unread_reaction_count": unread_reaction_count,
    "notification_settings": (notification_settings != null) ? notification_settings.toJson() : null,
    "available_reactions": (available_reactions != null) ? available_reactions.toJson() : null,
    "message_auto_delete_time": message_auto_delete_time,
    "emoji_status": (emoji_status != null) ? emoji_status.toJson() : null,
    "background": (background != null) ? background.toJson() : null,
    "theme_name": theme_name,
    "action_bar": (action_bar != null) ? action_bar.toJson() : null,
    "business_bot_manage_bar": (business_bot_manage_bar != null) ? business_bot_manage_bar.toJson() : null,
    "video_chat": (video_chat != null) ? video_chat.toJson() : null,
    "pending_join_requests": (pending_join_requests != null) ? pending_join_requests.toJson() : null,
    "reply_markup_message_id": reply_markup_message_id,
    "draft_message": (draft_message != null) ? draft_message.toJson() : null,
    "client_data": client_data,
  };

  chat_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (chat_data_create_json.containsKey(key) == false) {
        chat_data_create_json[key] = value;
      }
    });
  }
  return Chat(chat_data_create_json);
}