import 'assigned_area.dart'; import 'module.dart'; class Role { Role({ this.id, this.name, this.modules, this.assignedArea, }); int? id; String? name; List? modules; List? assignedArea; factory Role.fromJson(Map json) => Role( id: json["id"], name: json["name"], modules: json["modules"] == null ? [] : List.from( json["modules"]!.map((x) => Module.fromJson(x))), assignedArea: json["assigned_area"] == null ? [] : json["assigned_area"] == null ? [] : List.from(json["assigned_area"]! .map((x) => AssignedArea.fromJson(x))), ); Map toJson() => { "id": id, "name": name, "modules": modules == null ? [] : List.from(modules!.map((x) => x!.toJson())), "assigned_area": assignedArea == null ? [] : assignedArea == null ? [] : List.from(assignedArea!.map((x) => x!.toJson())), }; }class Object { Object({ this.id, this.name, this.slug, this.operations, }); int? id; String? name; String? slug; List? operations; factory Object.fromJson(Map json) => Object( id: json["id"], name: json["name"], slug: json["slug"], operations: json["operations"] == null ? [] : List.from(json["operations"]!.map((x) => x)), ); Map toJson() => { "id": id, "name": name, "slug": slug, "operations": operations == null ? [] : List.from(operations!.map((x) => x)), }; }