create static method

ChatEvent create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "chatEvent",
  3. String special_return_type = "chatEvent",
  4. num? id,
  5. num? date,
  6. MessageSender? member_id,
  7. ChatEventAction? action,
})
override

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

Implementation

static ChatEvent create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "chatEvent",
  String special_return_type = "chatEvent",
  num? id,
  num? date,
  MessageSender? member_id,
  ChatEventAction? action,
}) {
  // ChatEvent chatEvent = ChatEvent({
  final Map chatEvent_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "date": date,
    "member_id": (member_id != null) ? member_id.toJson() : null,
    "action": (action != null) ? action.toJson() : null,
  };

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

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