import 'package:job_app/models/employmentoffer.dart'; class WishListModel { int id; int count; List offer; WishListModel({ this.id, this.count, this.offer, }); factory WishListModel.fromJson(Map json) => WishListModel( id: json["id"], count: json["count"], offer: List.from(json["offer"].map((x) => EmploymentofferModel.fromJson(x))), ); Map toJson() => { "id": id, "count": count, "offer": List.from(offer.map((x) => x)), }; }