import 'package:job_app/models/Country/country.dart'; class CountryPaginatorModel { List countries; int currentPage; int totalItems; int totalPages; CountryPaginatorModel( {this.countries, this.currentPage, this.totalItems, this.totalPages}); factory CountryPaginatorModel.fromJson(Map json) => CountryPaginatorModel( countries: List.from(json["countries"].map((e) => CountryModel.fromJson(e))), currentPage: json["currentPage"], totalItems: json["totalItems"], totalPages: json["totalPages"], ); Map toJson() => { "countries": List.from(countries.map((x) => x)), "currentPage": currentPage, "totalItems": totalItems, "totalPages": totalPages, }; }