/*
 * @Author: WuXiangNan
 * @Date: 2021-06-28 08:59:40
 * @LastEditors: WuXiangNan
 * @LastEditTime: 2021-07-07 09:50:43
 * @Description: 
 */

class CabinetTree {
  String? id;
  String? label;
  String? parentId;
  String? type;
  bool? disabled;
  List<CabinetTree>? children;

  CabinetTree(
      {this.id,
      this.label,
      this.parentId,
      this.type,
      this.disabled,
      this.children});

  CabinetTree.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    id = map['id'];
    label = map['label'];
    parentId = map['parentId'];
    type = map['type'];
    disabled = map['disabled'];
    children = List<CabinetTree>.from(
        (map['children'] ?? []).map((e) => CabinetTree.fromJson(e)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['label'] = this.label;
    json['parentId'] = this.parentId;
    json['type'] = this.type;
    json['disabled'] = this.disabled;
    json['children'] =
        List<CabinetTree>.from((this.children ?? []).map((e) => e.toJson()));

    return json;
  }
}
