///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class ListProduct {
/*
{
  "id": 1,
  "name": "Ginkgo Biloba 120mg Trunature Của Mỹ, 340 viên ",
  "imageUrl": "unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2021/05/ginkgo-biloba-120mg-trunature-cua-my-60b4a7ba25854-31052021160914.jpg",
  "cost": 100000,
  "discount": "60%",
  "price": 40000,
  "evaluate": "(30)"
}
*/

  int? id;
  String? name;
  String? imageUrl;
  int? cost;
  String? discount;
  int? price;
  String? evaluate;

  ListProduct({
    this.id,
    this.name,
    this.imageUrl,
    this.cost,
    this.discount,
    this.price,
    this.evaluate,
  });

  ListProduct.fromJson(Map<String, dynamic> json) {
    id = json["id"]?.toInt();
    name = json["name"]?.toString();
    imageUrl = json["imageUrl"]?.toString();
    cost = json["cost"]?.toInt();
    discount = json["discount"]?.toString();
    price = json["price"]?.toInt();
    evaluate = json["evaluate"]?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["id"] = id;
    data["name"] = name;
    data["imageUrl"] = imageUrl;
    data["cost"] = cost;
    data["discount"] = discount;
    data["price"] = price;
    data["evaluate"] = evaluate;
    return data;
  }
}

class ListNew {
/*
{
  "id": 1,
  "imageUrl": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2019/08/vien-uong-tri-nam-tan-nhang-31082019124338.jpg",
  "name": "Viên uống trị nám"
}
*/

  int? id;
  String? imageUrl;
  String? name;

  ListNew({
    this.id,
    this.imageUrl,
    this.name,
  });

  ListNew.fromJson(Map<String, dynamic> json) {
    id = json["id"]?.toInt();
    imageUrl = json["imageUrl"]?.toString();
    name = json["name"]?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["id"] = id;
    data["imageUrl"] = imageUrl;
    data["name"] = name;
    return data;
  }
}

class DetailCategoryData {
/*
{
  "id": 1,
  "categoryName": "Thực phẩm chức năng",
  "imageUrl": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2021/05/vitamin-va-khoang-chat-19052021164321.png",
  "listNew": [
    {
      "id": 1,
      "imageUrl": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2019/08/vien-uong-tri-nam-tan-nhang-31082019124338.jpg",
      "name": "Viên uống trị nám"
    }
  ],
  "listProduct": [
    {
      "id": 1,
      "name": "Ginkgo Biloba 120mg Trunature Của Mỹ, 340 viên ",
      "imageUrl": "unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2021/05/ginkgo-biloba-120mg-trunature-cua-my-60b4a7ba25854-31052021160914.jpg",
      "cost": 100000,
      "discount": "60%",
      "price": 40000,
      "evaluate": "(30)"
    }
  ]
}
*/

  int? id;
  String? categoryName;
  String? imageUrl;
  List<ListNew>? listNew;
  List<ListProduct>? listProduct;

  DetailCategoryData({
    this.id,
    this.categoryName,
    this.imageUrl,
    this.listNew,
    this.listProduct,
  });

  DetailCategoryData.fromJson(Map<String, dynamic> json) {
    id = json["id"]?.toInt();
    categoryName = json["categoryName"]?.toString();
    imageUrl = json["imageUrl"]?.toString();
    if (json["listNew"] != null) {
      final v = json["listNew"];
      final arr0 = <ListNew>[];
      v.forEach((v) {
        arr0.add(ListNew.fromJson(v));
      });
      listNew = arr0;
    }
    if (json["listProduct"] != null) {
      final v = json["listProduct"];
      final arr0 = <ListProduct>[];
      v.forEach((v) {
        arr0.add(ListProduct.fromJson(v));
      });
      listProduct = arr0;
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["id"] = id;
    data["categoryName"] = categoryName;
    data["imageUrl"] = imageUrl;
    if (listNew != null) {
      final v = listNew;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["listNew"] = arr0;
    }
    if (listProduct != null) {
      final v = listProduct;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["listProduct"] = arr0;
    }
    return data;
  }
}

class DetailCategoryResponse {
/*
{
  "totalRecord": 0,
  "isSuccess": true,
  "errorMesssage": null,
  "DeatailCategoryData": {
    "id": 1,
    "categoryName": "Thực phẩm chức năng",
    "imageUrl": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2021/05/vitamin-va-khoang-chat-19052021164321.png",
    "listNew": [
      {
        "id": 1,
        "imageUrl": "unsafe/308x200/left/top/smart/filters:quality(75)/https://chiaki.vn/upload/category/2019/08/vien-uong-tri-nam-tan-nhang-31082019124338.jpg",
        "name": "Viên uống trị nám"
      }
    ],
    "listProduct": [
      {
        "id": 1,
        "name": "Ginkgo Biloba 120mg Trunature Của Mỹ, 340 viên ",
        "imageUrl": "unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2021/05/ginkgo-biloba-120mg-trunature-cua-my-60b4a7ba25854-31052021160914.jpg",
        "cost": 100000,
        "discount": "60%",
        "price": 40000,
        "evaluate": "(30)"
      }
    ]
  },
  "message": null
}
*/

  int? totalRecord;
  bool? isSuccess;
  String? errorMesssage;
  DetailCategoryData? detailCategoryData;
  String? message;

  DetailCategoryResponse({
    this.totalRecord,
    this.isSuccess,
    this.errorMesssage,
    this.detailCategoryData,
    this.message,
  });

  DetailCategoryResponse.fromJson(Map<String, dynamic> json) {
    totalRecord = json["totalRecord"]?.toInt();
    isSuccess = json["isSuccess"];
    errorMesssage = json["errorMesssage"]?.toString();
    detailCategoryData = (json["DetailCategoryData"] != null) ? DetailCategoryData.fromJson(json["DetailCategoryData"]) : null;
    message = json["message"]?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["totalRecord"] = totalRecord;
    data["isSuccess"] = isSuccess;
    data["errorMesssage"] = errorMesssage;
    if (detailCategoryData != null) {
      data["DetailCategoryData"] = detailCategoryData!.toJson();
    }
    data["message"] = message;
    return data;
  }
}
