When I paste the code to Android (Android Studio , Visual code ) it throws the following error:
Missing Parameter type for ('v')
The problem is here : json['data'].forEach((v)
and also here data['data'] = this.data.map((v) => v.toJson()).toList();
class Autogenerated {
NewOffer newOffer;
SoldOffer soldOffer;
HotOffer hotOffer;
UsedOffer usedOffer;
List<Countries> countries;
List<TypeCompany> typeCompany;
List<TopSearch> topSearch;
List<Banner> banner;
Config config;
List<CompaniesName> companiesName;
Diff diff;
Autogenerated(
{this.newOffer,
this.soldOffer,
this.hotOffer,
this.usedOffer,
this.countries,
this.typeCompany,
this.topSearch,
this.banner,
this.config,
this.companiesName,
this.diff});
Autogenerated.fromJson(Map<String, dynamic> json) {
newOffer = json['newOffer'] != null
? new NewOffer.fromJson(json['newOffer'])
: null;
soldOffer = json['soldOffer'] != null
? new SoldOffer.fromJson(json['soldOffer'])
: null;
hotOffer = json['hotOffer'] != null
? new HotOffer.fromJson(json['hotOffer'])
: null;
usedOffer = json['usedOffer'] != null
? new UsedOffer.fromJson(json['usedOffer'])
: null;
if (json['countries'] != null) {
countries = new List<Countries>();
json['countries'].forEach((v) {
countries.add(new Countries.fromJson(v));
});
}
if (json['typeCompany'] != null) {
typeCompany = new List<TypeCompany>();
json['typeCompany'].forEach((v) {
typeCompany.add(new TypeCompany.fromJson(v));
});
}
if (json['topSearch'] != null) {
topSearch = new List<TopSearch>();
json['topSearch'].forEach((v) {
topSearch.add(new TopSearch.fromJson(v));
});
}
if (json['banner'] != null) {
banner = new List<Banner>();
json['banner'].forEach((v) {
banner.add(new Banner.fromJson(v));
});
}
config =
json['config'] != null ? new Config.fromJson(json['config']) : null;
if (json['companiesName'] != null) {
companiesName = new List<CompaniesName>();
json['companiesName'].forEach((v) {
companiesName.add(new CompaniesName.fromJson(v));
});
}
diff = json['diff'] != null ? new Diff.fromJson(json['diff']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.newOffer != null) {
data['newOffer'] = this.newOffer.toJson();
}
if (this.soldOffer != null) {
data['soldOffer'] = this.soldOffer.toJson();
}
if (this.hotOffer != null) {
data['hotOffer'] = this.hotOffer.toJson();
}
if (this.usedOffer != null) {
data['usedOffer'] = this.usedOffer.toJson();
}
if (this.countries != null) {
data['countries'] = this.countries.map((v) => v.toJson()).toList();
}
if (this.typeCompany != null) {
data['typeCompany'] = this.typeCompany.map((v) => v.toJson()).toList();
}
if (this.topSearch != null) {
data['topSearch'] = this.topSearch.map((v) => v.toJson()).toList();
}
if (this.banner != null) {
data['banner'] = this.banner.map((v) => v.toJson()).toList();
}
if (this.config != null) {
data['config'] = this.config.toJson();
}
if (this.companiesName != null) {
data['companiesName'] =
this.companiesName.map((v) => v.toJson()).toList();
}
if (this.diff != null) {
data['diff'] = this.diff.toJson();
}
return data;
}
}
class NewOffer {
int currentPage;
List<Data> data;
String firstPageUrl;
int from;
int lastPage;
String lastPageUrl;
Null nextPageUrl;
String path;
int perPage;
Null prevPageUrl;
int to;
int total;
NewOffer(
{this.currentPage,
this.data,
this.firstPageUrl,
this.from,
this.lastPage,
this.lastPageUrl,
this.nextPageUrl,
this.path,
this.perPage,
this.prevPageUrl,
this.to,
this.total});
NewOffer.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
firstPageUrl = json['first_page_url'];
from = json['from'];
lastPage = json['last_page'];
lastPageUrl = json['last_page_url'];
nextPageUrl = json['next_page_url'];
path = json['path'];
perPage = json['per_page'];
prevPageUrl = json['prev_page_url'];
to = json['to'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['first_page_url'] = this.firstPageUrl;
data['from'] = this.from;
data['last_page'] = this.lastPage;
data['last_page_url'] = this.lastPageUrl;
data['next_page_url'] = this.nextPageUrl;
data['path'] = this.path;
data['per_page'] = this.perPage;
data['prev_page_url'] = this.prevPageUrl;
data['to'] = this.to;
data['total'] = this.total;
return data;
}
}
class Data {
int id;
int companyId;
int userId;
String offerType;
int isSold;
int isAuction;
int priceBefore;
int priceAfter;
String text;
String endDate;
int active;
String updatedAt;
String createdAt;
String city;
int sort;
int state;
int view;
List<Images> images;
List<SimilarOffer> similarOffer;
Company company;
List<OfferFeedBack> offerFeedBack;
Rating rating;
List<Specifications> specifications;
Data(
{this.id,
this.companyId,
this.userId,
this.offerType,
this.isSold,
this.isAuction,
this.priceBefore,
this.priceAfter,
this.text,
this.endDate,
this.active,
this.updatedAt,
this.createdAt,
this.city,
this.sort,
this.state,
this.view,
this.images,
this.similarOffer,
this.company,
this.offerFeedBack,
this.rating,
this.specifications});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyId = json['company_id'];
userId = json['user_id'];
offerType = json['offer_type'];
isSold = json['is_sold'];
isAuction = json['is_auction'];
priceBefore = json['price_before'];
priceAfter = json['price_after'];
text = json['text'];
endDate = json['end_date'];
active = json['active'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
city = json['city'];
sort = json['sort'];
state = json['state'];
view = json['view'];
if (json['images'] != null) {
images = new List<Images>();
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
}
if (json['similar_offer'] != null) {
similarOffer = new List<SimilarOffer>();
json['similar_offer'].forEach((v) {
similarOffer.add(new SimilarOffer.fromJson(v));
});
}
company =
json['company'] != null ? new Company.fromJson(json['company']) : null;
if (json['offer_feed_back'] != null) {
offerFeedBack = new List<OfferFeedBack>();
json['offer_feed_back'].forEach((v) {
offerFeedBack.add(new OfferFeedBack.fromJson(v));
});
}
rating =
json['rating'] != null ? new Rating.fromJson(json['rating']) : null;
if (json['specifications'] != null) {
specifications = new List<Specifications>();
json['specifications'].forEach((v) {
specifications.add(new Specifications.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_id'] = this.companyId;
data['user_id'] = this.userId;
data['offer_type'] = this.offerType;
data['is_sold'] = this.isSold;
data['is_auction'] = this.isAuction;
data['price_before'] = this.priceBefore;
data['price_after'] = this.priceAfter;
data['text'] = this.text;
data['end_date'] = this.endDate;
data['active'] = this.active;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
data['city'] = this.city;
data['sort'] = this.sort;
data['state'] = this.state;
data['view'] = this.view;
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
if (this.similarOffer != null) {
data['similar_offer'] = this.similarOffer.map((v) => v.toJson()).toList();
}
if (this.company != null) {
data['company'] = this.company.toJson();
}
if (this.offerFeedBack != null) {
data['offer_feed_back'] =
this.offerFeedBack.map((v) => v.toJson()).toList();
}
if (this.rating != null) {
data['rating'] = this.rating.toJson();
}
if (this.specifications != null) {
data['specifications'] =
this.specifications.map((v) => v.toJson()).toList();
}
return data;
}
}
class Images {
int id;
int offerId;
String path;
String createdAt;
Null updatedAt;
Images({this.id, this.offerId, this.path, this.createdAt, this.updatedAt});
Images.fromJson(Map<String, dynamic> json) {
id = json['id'];
offerId = json['offer_id'];
path = json['path'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['offer_id'] = this.offerId;
data['path'] = this.path;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
return data;
}
}
class SimilarOffer {
int id;
int companyId;
int userId;
String offerType;
int isSold;
int isAuction;
int priceBefore;
int priceAfter;
String text;
String endDate;
int active;
String updatedAt;
String createdAt;
String city;
int sort;
int state;
int view;
List<Images> images;
Company company;
List<OfferFeedBack> offerFeedBack;
List<Specifications> specifications;
Rating rating;
SimilarOffer(
{this.id,
this.companyId,
this.userId,
this.offerType,
this.isSold,
this.isAuction,
this.priceBefore,
this.priceAfter,
this.text,
this.endDate,
this.active,
this.updatedAt,
this.createdAt,
this.city,
this.sort,
this.state,
this.view,
this.images,
this.company,
this.offerFeedBack,
this.specifications,
this.rating});
SimilarOffer.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyId = json['company_id'];
userId = json['user_id'];
offerType = json['offer_type'];
isSold = json['is_sold'];
isAuction = json['is_auction'];
priceBefore = json['price_before'];
priceAfter = json['price_after'];
text = json['text'];
endDate = json['end_date'];
active = json['active'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
city = json['city'];
sort = json['sort'];
state = json['state'];
view = json['view'];
if (json['images'] != null) {
images = new List<Images>();
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
}
company =
json['company'] != null ? new Company.fromJson(json['company']) : null;
if (json['offer_feed_back'] != null) {
offerFeedBack = new List<OfferFeedBack>();
json['offer_feed_back'].forEach((v) {
offerFeedBack.add(new OfferFeedBack.fromJson(v));
});
}
if (json['specifications'] != null) {
specifications = new List<Specifications>();
json['specifications'].forEach((v) {
specifications.add(new Specifications.fromJson(v));
});
}
rating =
json['rating'] != null ? new Rating.fromJson(json['rating']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_id'] = this.companyId;
data['user_id'] = this.userId;
data['offer_type'] = this.offerType;
data['is_sold'] = this.isSold;
data['is_auction'] = this.isAuction;
data['price_before'] = this.priceBefore;
data['price_after'] = this.priceAfter;
data['text'] = this.text;
data['end_date'] = this.endDate;
data['active'] = this.active;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
data['city'] = this.city;
data['sort'] = this.sort;
data['state'] = this.state;
data['view'] = this.view;
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
if (this.company != null) {
data['company'] = this.company.toJson();
}
if (this.offerFeedBack != null) {
data['offer_feed_back'] =
this.offerFeedBack.map((v) => v.toJson()).toList();
}
if (this.specifications != null) {
data['specifications'] =
this.specifications.map((v) => v.toJson()).toList();
}
if (this.rating != null) {
data['rating'] = this.rating.toJson();
}
return data;
}
}
class Company {
int id;
String name;
String logo;
String mobile;
int userId;
int companyTypeId;
Null createdAt;
Null updatedAt;
String facadeUrl;
List<CompanyBranches> companyBranches;
Company(
{this.id,
this.name,
this.logo,
this.mobile,
this.userId,
this.companyTypeId,
this.createdAt,
this.updatedAt,
this.facadeUrl,
this.companyBranches});
Company.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
logo = json['logo'];
mobile = json['mobile'];
userId = json['user_id'];
companyTypeId = json['company_type_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
facadeUrl = json['facade_url'];
if (json['company_branches'] != null) {
companyBranches = new List<CompanyBranches>();
json['company_branches'].forEach((v) {
companyBranches.add(new CompanyBranches.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['logo'] = this.logo;
data['mobile'] = this.mobile;
data['user_id'] = this.userId;
data['company_type_id'] = this.companyTypeId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['facade_url'] = this.facadeUrl;
if (this.companyBranches != null) {
data['company_branches'] =
this.companyBranches.map((v) => v.toJson()).toList();
}
return data;
}
}
class CompanyBranches {
int id;
int companyId;
String address;
String phone;
String city;
String area;
Null updatedAt;
Null createdAt;
CompanyBranches(
{this.id,
this.companyId,
this.address,
this.phone,
this.city,
this.area,
this.updatedAt,
this.createdAt});
CompanyBranches.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyId = json['company_id'];
address = json['address'];
phone = json['phone'];
city = json['city'];
area = json['area'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_id'] = this.companyId;
data['address'] = this.address;
data['phone'] = this.phone;
data['city'] = this.city;
data['area'] = this.area;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
return data;
}
}
class OfferFeedBack {
int id;
int offerId;
int userId;
String feedback;
String createdAt;
Null updatedAt;
User user;
OfferFeedBack(
{this.id,
this.offerId,
this.userId,
this.feedback,
this.createdAt,
this.updatedAt,
this.user});
OfferFeedBack.fromJson(Map<String, dynamic> json) {
id = json['id'];
offerId = json['offer_id'];
userId = json['user_id'];
feedback = json['feedback'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
user = json['user'] != null ? new User.fromJson(json['user']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['offer_id'] = this.offerId;
data['user_id'] = this.userId;
data['feedback'] = this.feedback;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
if (this.user != null) {
data['user'] = this.user.toJson();
}
return data;
}
}
class User {
int id;
String username;
String imageUrl;
User({this.id, this.username, this.imageUrl});
User.fromJson(Map<String, dynamic> json) {
id = json['id'];
username = json['username'];
imageUrl = json['image_url'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['username'] = this.username;
data['image_url'] = this.imageUrl;
return data;
}
}
class Specifications {
int id;
int specificationsId;
String val;
int offerId;
Null updatedAt;
Null createdAt;
SpecificationsType specificationsType;
Specifications(
{this.id,
this.specificationsId,
this.val,
this.offerId,
this.updatedAt,
this.createdAt,
this.specificationsType});
Specifications.fromJson(Map<String, dynamic> json) {
id = json['id'];
specificationsId = json['specifications_id'];
val = json['val'];
offerId = json['offer_id'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
specificationsType = json['specifications_type'] != null
? new SpecificationsType.fromJson(json['specifications_type'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['specifications_id'] = this.specificationsId;
data['val'] = this.val;
data['offer_id'] = this.offerId;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
if (this.specificationsType != null) {
data['specifications_type'] = this.specificationsType.toJson();
}
return data;
}
}
class SpecificationsType {
int id;
String specificationsType;
String specificationsIcon;
int companyTypeId;
Null updatedAt;
String createdAt;
SpecificationsType(
{this.id,
this.specificationsType,
this.specificationsIcon,
this.companyTypeId,
this.updatedAt,
this.createdAt});
SpecificationsType.fromJson(Map<String, dynamic> json) {
id = json['id'];
specificationsType = json['specifications_type'];
specificationsIcon = json['specifications_icon'];
companyTypeId = json['company_type_id'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['specifications_type'] = this.specificationsType;
data['specifications_icon'] = this.specificationsIcon;
data['company_type_id'] = this.companyTypeId;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
return data;
}
}
class Rating {
int offerId;
double raiting;
Rating({this.offerId, this.raiting});
Rating.fromJson(Map<String, dynamic> json) {
offerId = json['offer_id'];
raiting = json['raiting'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['offer_id'] = this.offerId;
data['raiting'] = this.raiting;
return data;
}
}
class SoldOffer {
int currentPage;
List<Data> data;
String firstPageUrl;
int from;
int lastPage;
String lastPageUrl;
Null nextPageUrl;
String path;
int perPage;
Null prevPageUrl;
int to;
int total;
SoldOffer(
{this.currentPage,
this.data,
this.firstPageUrl,
this.from,
this.lastPage,
this.lastPageUrl,
this.nextPageUrl,
this.path,
this.perPage,
this.prevPageUrl,
this.to,
this.total});
SoldOffer.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
firstPageUrl = json['first_page_url'];
from = json['from'];
lastPage = json['last_page'];
lastPageUrl = json['last_page_url'];
nextPageUrl = json['next_page_url'];
path = json['path'];
perPage = json['per_page'];
prevPageUrl = json['prev_page_url'];
to = json['to'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['first_page_url'] = this.firstPageUrl;
data['from'] = this.from;
data['last_page'] = this.lastPage;
data['last_page_url'] = this.lastPageUrl;
data['next_page_url'] = this.nextPageUrl;
data['path'] = this.path;
data['per_page'] = this.perPage;
data['prev_page_url'] = this.prevPageUrl;
data['to'] = this.to;
data['total'] = this.total;
return data;
}
}
class Data {
int id;
int companyId;
int userId;
String offerType;
int isSold;
int isAuction;
int priceBefore;
int priceAfter;
String text;
String endDate;
int active;
String updatedAt;
String createdAt;
String city;
int sort;
int state;
int view;
List<Images> images;
List<SimilarOffer> similarOffer;
Company company;
List<Null> offerFeedBack;
Null rating;
List<Null> specifications;
Data(
{this.id,
this.companyId,
this.userId,
this.offerType,
this.isSold,
this.isAuction,
this.priceBefore,
this.priceAfter,
this.text,
this.endDate,
this.active,
this.updatedAt,
this.createdAt,
this.city,
this.sort,
this.state,
this.view,
this.images,
this.similarOffer,
this.company,
this.offerFeedBack,
this.rating,
this.specifications});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyId = json['company_id'];
userId = json['user_id'];
offerType = json['offer_type'];
isSold = json['is_sold'];
isAuction = json['is_auction'];
priceBefore = json['price_before'];
priceAfter = json['price_after'];
text = json['text'];
endDate = json['end_date'];
active = json['active'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
city = json['city'];
sort = json['sort'];
state = json['state'];
view = json['view'];
if (json['images'] != null) {
images = new List<Images>();
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
}
if (json['similar_offer'] != null) {
similarOffer = new List<SimilarOffer>();
json['similar_offer'].forEach((v) {
similarOffer.add(new SimilarOffer.fromJson(v));
});
}
company =
json['company'] != null ? new Company.fromJson(json['company']) : null;
if (json['offer_feed_back'] != null) {
offerFeedBack = new List<Null>();
json['offer_feed_back'].forEach((v) {
offerFeedBack.add(new Null.fromJson(v));
});
}
rating = json['rating'];
if (json['specifications'] != null) {
specifications = new List<Null>();
json['specifications'].forEach((v) {
specifications.add(new Null.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_id'] = this.companyId;
data['user_id'] = this.userId;
data['offer_type'] = this.offerType;
data['is_sold'] = this.isSold;
data['is_auction'] = this.isAuction;
data['price_before'] = this.priceBefore;
data['price_after'] = this.priceAfter;
data['text'] = this.text;
data['end_date'] = this.endDate;
data['active'] = this.active;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
data['city'] = this.city;
data['sort'] = this.sort;
data['state'] = this.state;
data['view'] = this.view;
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
if (this.similarOffer != null) {
data['similar_offer'] = this.similarOffer.map((v) => v.toJson()).toList();
}
if (this.company != null) {
data['company'] = this.company.toJson();
}
if (this.offerFeedBack != null) {
data['offer_feed_back'] =
this.offerFeedBack.map((v) => v.toJson()).toList();
}
data['rating'] = this.rating;
if (this.specifications != null) {
data['specifications'] =
this.specifications.map((v) => v.toJson()).toList();
}
return data;
}
}
class SimilarOffer {
int id;
int companyId;
int userId;
String offerType;
int isSold;
int isAuction;
int priceBefore;
int priceAfter;
String text;
String endDate;
int active;
String updatedAt;
String createdAt;
String city;
int sort;
int state;
int view;
List<Images> images;
Company company;
List<Null> offerFeedBack;
List<Null> specifications;
Null rating;
SimilarOffer(
{this.id,
this.companyId,
this.userId,
this.offerType,
this.isSold,
this.isAuction,
this.priceBefore,
this.priceAfter,
this.text,
this.endDate,
this.active,
this.updatedAt,
this.createdAt,
this.city,
this.sort,
this.state,
this.view,
this.images,
this.company,
this.offerFeedBack,
this.specifications,
this.rating});
SimilarOffer.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyId = json['company_id'];
userId = json['user_id'];
offerType = json['offer_type'];
isSold = json['is_sold'];
isAuction = json['is_auction'];
priceBefore = json['price_before'];
priceAfter = json['price_after'];
text = json['text'];
endDate = json['end_date'];
active = json['active'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
city = json['city'];
sort = json['sort'];
state = json['state'];
view = json['view'];
if (json['images'] != null) {
images = new List<Images>();
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
});
}
company =
json['company'] != null ? new Company.fromJson(json['company']) : null;
if (json['offer_feed_back'] != null) {
offerFeedBack = new List<Null>();
json['offer_feed_back'].forEach((v) {
offerFeedBack.add(new Null.fromJson(v));
});
}
if (json['specifications'] != null) {
specifications = new List<Null>();
json['specifications'].forEach((v) {
specifications.add(new Null.fromJson(v));
});
}
rating = json['rating'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_id'] = this.companyId;
data['user_id'] = this.userId;
data['offer_type'] = this.offerType;
data['is_sold'] = this.isSold;
data['is_auction'] = this.isAuction;
data['price_before'] = this.priceBefore;
data['price_after'] = this.priceAfter;
data['text'] = this.text;
data['end_date'] = this.endDate;
data['active'] = this.active;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
data['city'] = this.city;
data['sort'] = this.sort;
data['state'] = this.state;
data['view'] = this.view;
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
if (this.company != null) {
data['company'] = this.company.toJson();
}
if (this.offerFeedBack != null) {
data['offer_feed_back'] =
this.offerFeedBack.map((v) => v.toJson()).toList();
}
if (this.specifications != null) {
data['specifications'] =
this.specifications.map((v) => v.toJson()).toList();
}
data['rating'] = this.rating;
return data;
}
}
class HotOffer {
int currentPage;
List<Data> data;
String firstPageUrl;
int from;
int lastPage;
String lastPageUrl;
Null nextPageUrl;
String path;
int perPage;
Null prevPageUrl;
int to;
int total;
HotOffer(
{this.currentPage,
this.data,
this.firstPageUrl,
this.from,
this.lastPage,
this.lastPageUrl,
this.nextPageUrl,
this.path,
this.perPage,
this.prevPageUrl,
this.to,
this.total});
HotOffer.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
firstPageUrl = json['first_page_url'];
from = json['from'];
lastPage = json['last_page'];
lastPageUrl = json['last_page_url'];
nextPageUrl = json['next_page_url'];
path = json['path'];
perPage = json['per_page'];
prevPageUrl = json['prev_page_url'];
to = json['to'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['first_page_url'] = this.firstPageUrl;
data['from'] = this.from;
data['last_page'] = this.lastPage;
data['last_page_url'] = this.lastPageUrl;
data['next_page_url'] = this.nextPageUrl;
data['path'] = this.path;
data['per_page'] = this.perPage;
data['prev_page_url'] = this.prevPageUrl;
data['to'] = this.to;
data['total'] = this.total;
return data;
}
}
class UsedOffer {
int currentPage;
List<Data> data;
String firstPageUrl;
int from;
int lastPage;
String lastPageUrl;
Null nextPageUrl;
String path;
int perPage;
Null prevPageUrl;
int to;
int total;
UsedOffer(
{this.currentPage,
this.data,
this.firstPageUrl,
this.from,
this.lastPage,
this.lastPageUrl,
this.nextPageUrl,
this.path,
this.perPage,
this.prevPageUrl,
this.to,
this.total});
UsedOffer.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
firstPageUrl = json['first_page_url'];
from = json['from'];
lastPage = json['last_page'];
lastPageUrl = json['last_page_url'];
nextPageUrl = json['next_page_url'];
path = json['path'];
perPage = json['per_page'];
prevPageUrl = json['prev_page_url'];
to = json['to'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['first_page_url'] = this.firstPageUrl;
data['from'] = this.from;
data['last_page'] = this.lastPage;
data['last_page_url'] = this.lastPageUrl;
data['next_page_url'] = this.nextPageUrl;
data['path'] = this.path;
data['per_page'] = this.perPage;
data['prev_page_url'] = this.prevPageUrl;
data['to'] = this.to;
data['total'] = this.total;
return data;
}
}
class Countries {
int id;
String country;
Null updatedAt;
String createdAt;
List<Cities> cities;
Countries(
{this.id, this.country, this.updatedAt, this.createdAt, this.cities});
Countries.fromJson(Map<String, dynamic> json) {
id = json['id'];
country = json['country'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
if (json['cities'] != null) {
cities = new List<Cities>();
json['cities'].forEach((v) {
cities.add(new Cities.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['country'] = this.country;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
if (this.cities != null) {
data['cities'] = this.cities.map((v) => v.toJson()).toList();
}
return data;
}
}
class Cities {
int id;
String city;
String country;
String updatedAt;
Null createdAt;
List<Areas> areas;
Cities(
{this.id,
this.city,
this.country,
this.updatedAt,
this.createdAt,
this.areas});
Cities.fromJson(Map<String, dynamic> json) {
id = json['id'];
city = json['city'];
country = json['country'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
if (json['areas'] != null) {
areas = new List<Areas>();
json['areas'].forEach((v) {
areas.add(new Areas.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['city'] = this.city;
data['country'] = this.country;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
if (this.areas != null) {
data['areas'] = this.areas.map((v) => v.toJson()).toList();
}
return data;
}
}
class Areas {
int id;
String area;
String city;
Null updatedAt;
Null createdAt;
Areas({this.id, this.area, this.city, this.updatedAt, this.createdAt});
Areas.fromJson(Map<String, dynamic> json) {
id = json['id'];
area = json['area'];
city = json['city'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['area'] = this.area;
data['city'] = this.city;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
return data;
}
}
class TypeCompany {
int id;
String companyType;
String companyTypeIcon;
Null updatedAt;
Null createdAt;
List<TypeOffers> typeOffers;
List<SpecificationsType> specificationsType;
TypeCompany(
{this.id,
this.companyType,
this.companyTypeIcon,
this.updatedAt,
this.createdAt,
this.typeOffers,
this.specificationsType});
TypeCompany.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyType = json['company_type'];
companyTypeIcon = json['company_type_icon'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
if (json['type_offers'] != null) {
typeOffers = new List<TypeOffers>();
json['type_offers'].forEach((v) {
typeOffers.add(new TypeOffers.fromJson(v));
});
}
if (json['specifications_type'] != null) {
specificationsType = new List<SpecificationsType>();
json['specifications_type'].forEach((v) {
specificationsType.add(new SpecificationsType.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_type'] = this.companyType;
data['company_type_icon'] = this.companyTypeIcon;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
if (this.typeOffers != null) {
data['type_offers'] = this.typeOffers.map((v) => v.toJson()).toList();
}
if (this.specificationsType != null) {
data['specifications_type'] =
this.specificationsType.map((v) => v.toJson()).toList();
}
return data;
}
}
class TypeOffers {
int id;
String offerType;
int companyTypeId;
Null updatedAt;
Null createdAt;
TypeOffers(
{this.id,
this.offerType,
this.companyTypeId,
this.updatedAt,
this.createdAt});
TypeOffers.fromJson(Map<String, dynamic> json) {
id = json['id'];
offerType = json['offer_type'];
companyTypeId = json['company_type_id'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['offer_type'] = this.offerType;
data['company_type_id'] = this.companyTypeId;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
return data;
}
}
class TopSearch {
String searchText;
int count;
TopSearch({this.searchText, this.count});
TopSearch.fromJson(Map<String, dynamic> json) {
searchText = json['search_text'];
count = json['count'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['search_text'] = this.searchText;
data['count'] = this.count;
return data;
}
}
class Banner {
int id;
int companyId;
Null updatedAt;
Null createdAt;
String name;
String logo;
String mobile;
int userId;
int companyTypeId;
String facadeUrl;
Banner(
{this.id,
this.companyId,
this.updatedAt,
this.createdAt,
this.name,
this.logo,
this.mobile,
this.userId,
this.companyTypeId,
this.facadeUrl});
Banner.fromJson(Map<String, dynamic> json) {
id = json['id'];
companyId = json['company_id'];
updatedAt = json['updated_at'];
createdAt = json['created_at'];
name = json['name'];
logo = json['logo'];
mobile = json['mobile'];
userId = json['user_id'];
companyTypeId = json['company_type_id'];
facadeUrl = json['facade_url'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['company_id'] = this.companyId;
data['updated_at'] = this.updatedAt;
data['created_at'] = this.createdAt;
data['name'] = this.name;
data['logo'] = this.logo;
data['mobile'] = this.mobile;
data['user_id'] = this.userId;
data['company_type_id'] = this.companyTypeId;
data['facade_url'] = this.facadeUrl;
return data;
}
}
class Config {
int isViews;
int isMotionEffect;
String color;
int vestionCode;
String motionUrl;
int isShouldUpdate;
Config(
{this.isViews,
this.isMotionEffect,
this.color,
this.vestionCode,
this.motionUrl,
this.isShouldUpdate});
Config.fromJson(Map<String, dynamic> json) {
isViews = json['is_views'];
isMotionEffect = json['is_motion_effect'];
color = json['color'];
vestionCode = json['vestion_code'];
motionUrl = json['motion_url'];
isShouldUpdate = json['is_should_update'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['is_views'] = this.isViews;
data['is_motion_effect'] = this.isMotionEffect;
data['color'] = this.color;
data['vestion_code'] = this.vestionCode;
data['motion_url'] = this.motionUrl;
data['is_should_update'] = this.isShouldUpdate;
return data;
}
}
class CompaniesName {
String name;
CompaniesName({this.name});
CompaniesName.fromJson(Map<String, dynamic> json) {
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
return data;
}
}
class Diff {
String endDate;
int diff;
Diff({this.endDate, this.diff});
Diff.fromJson(Map<String, dynamic> json) {
endDate = json['end_date'];
diff = json['diff'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['end_date'] = this.endDate;
data['diff'] = this.diff;
return data;
}
}