create static method

CustomerNotificationPreference create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "customer_notification_preference",
  3. List<Object>? invoice_created,
  4. List<Object>? invoice_reminder,
  5. List<Object>? invoice_expired,
  6. List<Object>? invoice_paid,
})
override

return original data json

Implementation

static CustomerNotificationPreference create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "customer_notification_preference",
  List<Object>? invoice_created,
  List<Object>? invoice_reminder,
  List<Object>? invoice_expired,
  List<Object>? invoice_paid,
}) {
  // CustomerNotificationPreference customerNotificationPreference = CustomerNotificationPreference({
  final Map customerNotificationPreference_data_create_json = {
    "@type": special_type,
    "invoice_created": invoice_created,
    "invoice_reminder": invoice_reminder,
    "invoice_expired": invoice_expired,
    "invoice_paid": invoice_paid,
  };

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

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