toJson method

  1. @override
Map<String, Object?> toJson()

Implementation

@override
Map<String, Object?> toJson() => {
      "id": encodeValue(id),
      if (productId != null) "product_id": encodeValue(productId),
      if (priceId != null) "price_id": encodeValue(priceId),
      if (reference != null) "reference": encodeValue(reference),
      if (about != null) "about": encodeValue(about),
      if (customData != null) "custom_data": encodeValue(customData),
      if (taxCode != null) "tax_code": encodeValue(taxCode),
      "name": encodeValue(name),
      if (category != null) "category": encodeValue(category),
      if (type != null) "type": encodeValue(type),
      "price": encodeValue(price),
      "quantity": encodeValue(quantity),
    };