import 'package:job_app/models/Cvsubmitedmodel.dart'; import 'package:job_app/models/categories.dart'; import 'package:job_app/models/company.dart'; class EmploymentofferModel { String accolades; String benefits; bool boosted; CompanyModel company; List listcvsubmited; CategoriesModel categories; String educationlevel; int id; String location; String overview; String salary; String schedule; String skills; String summary; int timestmp; String type; EmploymentofferModel({ this.accolades, this.benefits, this.boosted, this.company, this.categories, this.listcvsubmited, this.educationlevel, this.id, this.location, this.overview, this.salary, this.schedule, this.skills, this.summary, this.timestmp, this.type, }); factory EmploymentofferModel.fromJson(Map json) => EmploymentofferModel( accolades: json["accolades"], benefits: json["benefits"], boosted: json["boosted"], company: json["company"]!=null?CompanyModel.fromJson(json["company"]):null, listcvsubmited: List.from(json["listcvsubmited"] .map((x) => CvSubmitedModelModel.fromJson(x))), educationlevel: json["educationlevel"], categories:CategoriesModel.fromJson(json["categories"]), id: json["id"], location: json["location"], overview: json["overview"], salary: json["salary"], schedule: json["schedule"], skills: json["skills"], summary: json["summary"], timestmp: json["timestmp"], type: json["type"], ); Map toJson() => { "accolades": accolades, "benefits": benefits, "boosted": boosted, "company": company.toJson(), "listcvsubmited": List.from(listcvsubmited.map((x) => x.toJson())), "educationlevel": educationlevel, "id": id, "location": location, "overview": overview, "salary": salary, "schedule": schedule, "skills": skills, "summary": summary, "timestmp": timestmp, "type": type, }; }