toJson method

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

Implementation

@override
Map<String, Object?> toJson() => {
      "id": encodeValue(id),
      "type": encodeValue(type),
      if (reference != null) "reference": encodeValue(reference),
      "name": encodeValue(name),
      if (description != null) "description": encodeValue(description),
      if (about != null) "about": encodeValue(about),
      if (taxCode != null) "tax_code": encodeValue(taxCode),
      if (category != null) "category": encodeValue(category),
      if (prices != null) "prices": encodeValue(prices),
      if (shipment != null) "shipment": encodeValue(shipment),
      if (media != null) "media": encodeValue(media),
      if (attributes != null) "attributes": encodeValue(attributes),
      if (dimensions != null) "dimensions": encodeValue(dimensions),
      if (customData != null) "custom_data": encodeValue(customData),
      "active": encodeValue(active),
      "created_at": encodeValue(createdAt),
      if (updatedAt != null) "updated_at": encodeValue(updatedAt),
      if (archivedAt != null) "archived_at": encodeValue(archivedAt),
      if (publishedAt != null) "published_at": encodeValue(publishedAt),
      if (unitDim != null) "unit_dim": encodeValue(unitDim),
    };