
class categoryModel {
  List<DATA> dATA;

  categoryModel({this.dATA});

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

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.dATA != null) {
      data['DATA'] = this.dATA.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

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

  DATA(
      {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});

  DATA.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;
  }
}
