create static method

Invoice create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "invoice",
  3. String special_return_type = "invoice",
  4. String? currency,
  5. List<LabeledPricePart>? price_parts,
  6. num? subscription_period,
  7. num? max_tip_amount,
  8. List<num>? suggested_tip_amounts,
  9. String? recurring_payment_terms_of_service_url,
  10. String? terms_of_service_url,
  11. bool? is_test,
  12. bool? need_name,
  13. bool? need_phone_number,
  14. bool? need_email_address,
  15. bool? need_shipping_address,
  16. bool? send_phone_number_to_provider,
  17. bool? send_email_address_to_provider,
  18. bool? is_flexible,
})
override

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

Implementation

static Invoice create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "invoice",
  String special_return_type = "invoice",
  String? currency,
  List<LabeledPricePart>? price_parts,
  num? subscription_period,
  num? max_tip_amount,
  List<num>? suggested_tip_amounts,
  String? recurring_payment_terms_of_service_url,
  String? terms_of_service_url,
  bool? is_test,
  bool? need_name,
  bool? need_phone_number,
  bool? need_email_address,
  bool? need_shipping_address,
  bool? send_phone_number_to_provider,
  bool? send_email_address_to_provider,
  bool? is_flexible,
}) {
  // Invoice invoice = Invoice({
  final Map invoice_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "currency": currency,
    "price_parts": (price_parts != null) ? price_parts.toJson() : null,
    "subscription_period": subscription_period,
    "max_tip_amount": max_tip_amount,
    "suggested_tip_amounts": suggested_tip_amounts,
    "recurring_payment_terms_of_service_url": recurring_payment_terms_of_service_url,
    "terms_of_service_url": terms_of_service_url,
    "is_test": is_test,
    "need_name": need_name,
    "need_phone_number": need_phone_number,
    "need_email_address": need_email_address,
    "need_shipping_address": need_shipping_address,
    "send_phone_number_to_provider": send_phone_number_to_provider,
    "send_email_address_to_provider": send_email_address_to_provider,
    "is_flexible": is_flexible,
  };

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

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