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['isMultiple'] = this.isMultiple;
  if (this.categoryIds != null) {
    data['categoryIds'] = this.categoryIds!.map((v) => v.toJson()).toList();
  }
  data['imageId'] = this.imageId;
  data['productId'] = this.productId;
  data['name'] = this.name;
  data['description'] = this.description;
  data['skuId'] = this.skuId;
  data['details'] = this.details;
  data['packVariant'] = this.packVariant;
  data['moq'] = this.moq;
  data['isOutofstock'] = this.isOutofstock;
  data['type'] = this.type;
  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();
  }
  if (this.price != null) {
    data['price'] = this.price!.toJson();
  }
  if (this.variantTypes != null) {
    data['variantTypes'] = this.variantTypes!.map((v) => v.toJson()).toList();
  }
  if (this.images != null) {
    data['images'] = this.images!.map((v) => v.toJson()).toList();
  }
  if (this.mergeAttribute != null) {
    data['mergeAttribute'] =
        this.mergeAttribute!.map((v) => v.toJson()).toList();
  }
  data['filterAttribute'] = this.filterAttribute;
  data['__typename'] = this.sTypename;
  return data;
}