toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
    "id": id == null ? null : id,
    "merchant_id": merchantId == null ? null : merchantId,
    "uuid": uuid == null ? null : uuid,
    "name": name == null ? null : name,
    "sku": sku == null ? null : sku,
    "price": price == null ? null : price,
    "description": description == null ? null : description,
    "quantity": quantity == null ? null : quantity,
    "thank_you_url": thankYouUrl == null ? null : thankYouUrl,
    "category_id": categoryId,
    "sort_order": sortOrder == null ? null : sortOrder,
    "shipping_fee": shippingFee,
    "tax": tax,
    "type": type == null ? null : type,
    "meta": meta == null ? null : meta,
    "status": status == null ? null : status,
    "deleted_at": deletedAt,
    "created_at": createdAt == null ? null : createdAt!.toIso8601String(),
    "updated_at": updatedAt == null ? null : updatedAt!.toIso8601String(),
    "number_sold":numberSold == null ? null : numberSold,
    "assets": assets == null ? null : List<dynamic>.from(assets!.map((x) => x.toJson())),
    "orders": orders == null ? null : List<dynamic>.from(orders!.map((x) => x.toJson())),
};