class ResourceModel { ResourceModel({ required this.id, required this.path, required this.component, required this.name, required this.meta, required this.redirect, required this.children, }); final int? id; final String? path; final String? component; final String? name; final Meta? meta; final String? redirect; final List children; factory ResourceModel.fromJson(Map json) { return ResourceModel( id: json["id"], path: json["path"], component: json["component"], name: json["name"], meta: json["meta"] == null ? null : Meta.fromJson(json["meta"]), redirect: json["redirect"], children: json["children"] == null ? [] : List.from( json["children"]!.map((x) => ResourceModel.fromJson(x))), ); } Map toJson() => { "id": id, "path": path, "component": component, "name": name, "meta": meta?.toJson(), "redirect": redirect, "children": children.map((x) => x?.toJson()).toList(), }; } class Meta { Meta({ required this.title, required this.icon, required this.isExt, required this.extOpenMode, required this.type, required this.orderNo, required this.show, required this.activeMenu, required this.status, required this.keepAlive, }); final String? title; final String? icon; final bool? isExt; final int? extOpenMode; final int? type; final int? orderNo; final int? show; final String? activeMenu; final int? status; final int? keepAlive; factory Meta.fromJson(Map json) { return Meta( title: json["title"], icon: json["icon"], isExt: json["isExt"], extOpenMode: json["extOpenMode"], type: json["type"], orderNo: json["orderNo"], show: json["show"], activeMenu: json["activeMenu"], status: json["status"], keepAlive: json["keepAlive"], ); } Map toJson() => { "title": title, "icon": icon, "isExt": isExt, "extOpenMode": extOpenMode, "type": type, "orderNo": orderNo, "show": show, "activeMenu": activeMenu, "status": status, "keepAlive": keepAlive, }; }