toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['_id'] = this.sId;
data['productName'] = this.productName;
data['imageId'] = this.imageId;
data['productId'] = this.productId;
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).toList();
}
data['__typename'] = this.sTypename;
return data;
}