toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['_id'] = this.sId;
  data['code'] = this.code;
  data['productName'] = this.productName;
  data['productId'] = this.productId;
  data['imageId'] = this.imageId;
  data['skuId'] = this.skuId;
  data['productDescription'] = this.productDescription;
  data['type'] = this.type;
  data['isMultiple'] = this.isMultiple;
  if (this.category != null) {
    data['category'] = this.category!.map((v) => v.toJson()).toList();
  }
  if (this.brand != null) {
    data['brand'] = this.brand!.map((v) => v.toJson()).toList();
  }
  if (this.attribute != null) {
    data['attribute'] = this.attribute!.map((v) => v.toJson()).toList();
  }
  if (this.price != null) {
    data['price'] = this.price!.toJson();
  }
  data['totalPieces'] = this.totalPieces;
  data['qty'] = this.qty;
  data['imageUrl'] = this.imageUrl;
  if (this.skuIds != null) {
    data['skuIds'] = this.skuIds!.map((v) => v.toJson()).toList();
  }
  if (this.children != null) {
    data['children'] = this.children!.map((v) => v.toJson()).toList();
  }
  data['__typename'] = this.sTypename;
  return data;
}