class Module { Module({ this.id, this.icon, this.name, this.slug, this.objects, }); int? id; String? icon; String? name; String? slug; List? objects; factory Module.fromJson(Map json) => Module( id: json["id"], icon: json["icon"], name: json["name"], slug: json["slug"], objects: json["objects"] == null ? [] : List.from( json["objects"]!.map((x) => Object.fromJson(x))), ); Map toJson() => { "id": id, "icon": icon, "name": name, "slug": slug, "objects": objects == null ? [] : List.from(objects!.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)), }; }