create static method

ChatEventBackgroundChanged create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "chatEventBackgroundChanged",
  3. String special_return_type = "chatEventAction",
  4. ChatBackground? old_background,
  5. ChatBackground? new_background,
})
override

Generate By General Universe Script Dont edit by hand or anything manual

Implementation

static ChatEventBackgroundChanged create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "chatEventBackgroundChanged",
  String special_return_type = "chatEventAction",
  ChatBackground? old_background,
  ChatBackground? new_background,
}) {
  // ChatEventBackgroundChanged chatEventBackgroundChanged = ChatEventBackgroundChanged({
  final Map chatEventBackgroundChanged_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "old_background": (old_background != null) ? old_background.toJson() : null,
    "new_background": (new_background != null) ? new_background.toJson() : null,
  };

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

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