///
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
///
class ListCartData {
/*
{
  "id": 1,
  "avatar": "",
  "title": "Car",
  "nameUser": "Cong Ngoc",
  "image": "",
  "likes": 102,
  "follows": 500,
  "shares": 200
}
*/

  int? id;
  String? avatar;
  String? title;
  String? nameUser;
  String? image;
  int? likes;
  int? follows;
  int? shares;

  ListCartData({
    this.id,
    this.avatar,
    this.title,
    this.nameUser,
    this.image,
    this.likes,
    this.follows,
    this.shares,
  });

  ListCartData.fromJson(Map<String, dynamic> json) {
    id = json["id"]?.toInt();
    avatar = json["avatar"]?.toString();
    title = json["title"]?.toString();
    nameUser = json["nameUser"]?.toString();
    image = json["image"]?.toString();
    likes = json["likes"]?.toInt();
    follows = json["follows"]?.toInt();
    shares = json["shares"]?.toInt();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data["id"] = id;
    data["avatar"] = avatar;
    data["title"] = title;
    data["nameUser"] = nameUser;
    data["image"] = image;
    data["likes"] = likes;
    data["follows"] = follows;
    data["shares"] = shares;
    return data;
  }
}

class ListCartResponse {
/*
{
  "totalRecord": 9,
  "isSuccess": true,
  "errorMesssage": null,
  "Data": [
    {
      "id": 1,
      "avatar": "",
      "title": "Car",
      "nameUser": "Cong Ngoc",
      "image": "",
      "likes": 102,
      "follows": 500,
      "shares": 200
    }
  ],
  "message": null
}
*/

  int? totalRecord;
  bool? isSuccess;
  String? errorMesssage;
  List<ListCartData>? Data;
  String? message;

  ListCartResponse({
    this.totalRecord,
    this.isSuccess,
    this.errorMesssage,
    this.Data,
    this.message,
  });

  ListCartResponse.fromJson(Map<String, dynamic> json) {
    totalRecord = json["totalRecord"]?.toInt();
    isSuccess = json["isSuccess"];
    errorMesssage = json["errorMesssage"]?.toString();
    if (json["Data"] != null) {
      final v = json["Data"];
      final arr0 = <ListCartData>[];
      v.forEach((v) {
        arr0.add(ListCartData.fromJson(v));
      });
      Data = arr0;
    }
    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 (Data != null) {
      final v = Data;
      final arr0 = [];
      v!.forEach((v) {
        arr0.add(v.toJson());
      });
      data["Data"] = arr0;
    }
    data["message"] = message;
    return data;
  }
}
