import 'package:job_app/models/employmentoffer.dart'; class EmploymentOffersPaginatorModel{ List offers; int currentPage; int totalItems; int totalPages; EmploymentOffersPaginatorModel({ this.offers, this.currentPage, this.totalItems, this.totalPages, }); factory EmploymentOffersPaginatorModel.fromJson(Map json) => EmploymentOffersPaginatorModel( offers: List.from(json["offers"].map((x) => EmploymentofferModel.fromJson(x))), currentPage: json["currentPage"], totalItems: json["totalItems"], totalPages: json["totalPages"], ); Map toJson() => { "offers": List.from(offers.map((x) => x)), "currentPage": currentPage, "totalItems": totalItems, "totalPages": totalPages, }; }