class PrivilegeModel { int id; String name; double price; double rebate1; double rebate2; int examineFlag; String notExamineReason; String image; List menuList; PrivilegeModel( {this.id, this.name, this.price, this.rebate1, this.rebate2, this.examineFlag, this.notExamineReason, this.image, this.menuList}); PrivilegeModel.fromJson(Map json) { id = json['id']; name = json['name']; price = json['price']; rebate1 = json['rebate1']; rebate2 = json['rebate2']; examineFlag = json['examineFlag']; notExamineReason = json['notExamineReason']; image = json['image']; if (json['menuList'] != null) { menuList = new List(); json['menuList'].forEach((v) { menuList.add(new MenuList.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['name'] = this.name; data['price'] = this.price; data['rebate1'] = this.rebate1; data['rebate2'] = this.rebate2; data['examineFlag'] = this.examineFlag; data['notExamineReason'] = this.notExamineReason; data['image'] = this.image; if (this.menuList != null) { data['menuList'] = this.menuList.map((v) => v.toJson()).toList(); } return data; } } class MenuList { int id; int createTime; String createBy; int updateTime; String updateBy; int parentId; String name; String router; int status; String image; String descr; MenuList( {this.id, this.createTime, this.createBy, this.updateTime, this.updateBy, this.parentId, this.name, this.router, this.status, this.image, this.descr}); MenuList.fromJson(Map json) { id = json['id']; createTime = json['createTime']; createBy = json['createBy']; updateTime = json['updateTime']; updateBy = json['updateBy']; parentId = json['parentId']; name = json['name']; router = json['router']; status = json['status']; image = json['image']; descr = json['descr']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['createTime'] = this.createTime; data['createBy'] = this.createBy; data['updateTime'] = this.updateTime; data['updateBy'] = this.updateBy; data['parentId'] = this.parentId; data['name'] = this.name; data['router'] = this.router; data['status'] = this.status; data['image'] = this.image; data['descr'] = this.descr; return data; } }