class CategoryModel {
  List<Result> result;

  CategoryModel({this.result});


  CategoryModel.fromJson(Map<String, dynamic> json) {
    if (json['result'] != null) {
      result = new List<Result>();
      json['result'].forEach((v) {
        result.add(new Result.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();

    if (this.result != null) {
      data['result'] = this.result.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Result {
  int id;
  int parentId;
  String name;
  String code;
  String displayName;
  String cover;
  String detail;
  Null type;
  String status;
  int sortOrder;
  Null storeId;
  Null vendorId;
  Null createdAt;
  String updatedAt;
  String visibility;

  Result(
      {this.id,
      this.parentId,
      this.name,
      this.code,
      this.displayName,
      this.cover,
      this.detail,
      this.type,
      this.status,
      this.sortOrder,
      this.storeId,
      this.vendorId,
      this.createdAt,
      this.updatedAt,
      this.visibility});


  Result.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    parentId = json['parent_id'];
    name = json['name'];
    code = json['code'];
    displayName = json['display_name'];
    cover = json['cover'];
    detail = json['detail'];
    type = json['type'];
    status = json['status'];
    sortOrder = json['sort_order'];
    storeId = json['store_id'];
    vendorId = json['vendor_id'];
    createdAt = json['created_at'];
    updatedAt = json['updated_at'];
    visibility = json['visibility'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['parent_id'] = this.parentId;
    data['name'] = this.name;
    data['code'] = this.code;
    data['display_name'] = this.displayName;
    data['cover'] = this.cover;
    data['detail'] = this.detail;
    data['type'] = this.type;
    data['status'] = this.status;
    data['sort_order'] = this.sortOrder;
    data['store_id'] = this.storeId;
    data['vendor_id'] = this.vendorId;
    data['created_at'] = this.createdAt;
    data['updated_at'] = this.updatedAt;
    data['visibility'] = this.visibility;
    return data;
  }
}
