Merged Ads Module
parent
79a8671e77
commit
9bf716eb39
@ -0,0 +1,500 @@
|
||||
import 'package:mc_common_app/models/advertisment_models/special_service_model.dart';
|
||||
|
||||
class AdDetailsModel {
|
||||
int? id;
|
||||
String? startdate;
|
||||
String? enddate;
|
||||
Vehicle? vehicle;
|
||||
List<SpecialServiceModel>? specialservice;
|
||||
// List<Null>? reserved;
|
||||
int? statusID;
|
||||
String? statuslabel;
|
||||
double? adsDurationPrice;
|
||||
double? adsDurationDiscount;
|
||||
double? adsDurationDiscountPrice;
|
||||
String? comment;
|
||||
bool? active;
|
||||
bool? isPaid;
|
||||
bool? isSubscription;
|
||||
bool? isVerified;
|
||||
double? netPrice;
|
||||
double? specialServiceTotalPrice;
|
||||
double? taxPrice;
|
||||
double? totalPrice;
|
||||
String? userID;
|
||||
int? vehiclePostingID;
|
||||
String? qrCodePath;
|
||||
bool? isCustomerAcknowledged;
|
||||
int? createdByRole;
|
||||
int? totalViews;
|
||||
String? createdOn;
|
||||
double? priceExcludingDiscount;
|
||||
double? reservePrice;
|
||||
bool? isMCHandled;
|
||||
String? modifiedOn;
|
||||
|
||||
AdDetailsModel(
|
||||
{this.id,
|
||||
this.startdate,
|
||||
this.enddate,
|
||||
this.vehicle,
|
||||
this.specialservice,
|
||||
// this.reserved,
|
||||
this.statusID,
|
||||
this.statuslabel,
|
||||
this.adsDurationPrice,
|
||||
this.adsDurationDiscount,
|
||||
this.adsDurationDiscountPrice,
|
||||
this.comment,
|
||||
this.active,
|
||||
this.isPaid,
|
||||
this.isSubscription,
|
||||
this.isVerified,
|
||||
this.netPrice,
|
||||
this.specialServiceTotalPrice,
|
||||
this.taxPrice,
|
||||
this.totalPrice,
|
||||
this.userID,
|
||||
this.vehiclePostingID,
|
||||
this.qrCodePath,
|
||||
this.isCustomerAcknowledged,
|
||||
this.createdByRole,
|
||||
this.totalViews,
|
||||
this.createdOn,
|
||||
this.priceExcludingDiscount,
|
||||
this.reservePrice,
|
||||
this.isMCHandled,
|
||||
this.modifiedOn});
|
||||
|
||||
AdDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
startdate = json['startdate'];
|
||||
enddate = json['enddate'];
|
||||
vehicle =
|
||||
json['vehicle'] != null ? Vehicle.fromJson(json['vehicle']) : null;
|
||||
if (json['specialservice'] != null) {
|
||||
specialservice = <SpecialServiceModel>[];
|
||||
json['specialservice'].forEach((v) {
|
||||
specialservice!.add(SpecialServiceModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
// if (json['reserved'] != null) {
|
||||
// reserved = <Null>[];
|
||||
// json['reserved'].forEach((v) {
|
||||
// reserved!.add(Null.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
statusID = json['statusID'];
|
||||
statuslabel = json['statuslabel'];
|
||||
adsDurationPrice = json['adsDurationPrice'];
|
||||
adsDurationDiscount = json['adsDurationDiscount'];
|
||||
adsDurationDiscountPrice = json['adsDurationDiscountPrice'];
|
||||
comment = json['comment'];
|
||||
active = json['active'];
|
||||
isPaid = json['isPaid'];
|
||||
isSubscription = json['isSubscription'];
|
||||
isVerified = json['isVerified'];
|
||||
netPrice = json['netPrice'];
|
||||
specialServiceTotalPrice = json['specialServiceTotalPrice'];
|
||||
taxPrice = json['taxPrice'];
|
||||
totalPrice = json['totalPrice'];
|
||||
userID = json['userID'];
|
||||
vehiclePostingID = json['vehiclePostingID'];
|
||||
qrCodePath = json['qrCodePath'];
|
||||
isCustomerAcknowledged = json['isCustomerAcknowledged'];
|
||||
createdByRole = json['createdByRole'];
|
||||
totalViews = json['totalViews'];
|
||||
createdOn = json['createdOn'];
|
||||
priceExcludingDiscount = json['priceExcludingDiscount'];
|
||||
reservePrice = json['reservePrice'];
|
||||
isMCHandled = json['isMCHandled'];
|
||||
modifiedOn = json['modifiedOn'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['startdate'] = startdate;
|
||||
data['enddate'] = enddate;
|
||||
if (vehicle != null) {
|
||||
data['vehicle'] = vehicle!.toJson();
|
||||
}
|
||||
if (specialservice != null) {
|
||||
data['specialservice'] =
|
||||
specialservice!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
// if (reserved != null) {
|
||||
// data['reserved'] = reserved!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
data['statusID'] = statusID;
|
||||
data['statuslabel'] = statuslabel;
|
||||
data['adsDurationPrice'] = adsDurationPrice;
|
||||
data['adsDurationDiscount'] = adsDurationDiscount;
|
||||
data['adsDurationDiscountPrice'] = adsDurationDiscountPrice;
|
||||
data['comment'] = comment;
|
||||
data['active'] = active;
|
||||
data['isPaid'] = isPaid;
|
||||
data['isSubscription'] = isSubscription;
|
||||
data['isVerified'] = isVerified;
|
||||
data['netPrice'] = netPrice;
|
||||
data['specialServiceTotalPrice'] = specialServiceTotalPrice;
|
||||
data['taxPrice'] = taxPrice;
|
||||
data['totalPrice'] = totalPrice;
|
||||
data['userID'] = userID;
|
||||
data['vehiclePostingID'] = vehiclePostingID;
|
||||
data['qrCodePath'] = qrCodePath;
|
||||
data['isCustomerAcknowledged'] = isCustomerAcknowledged;
|
||||
data['createdByRole'] = createdByRole;
|
||||
data['totalViews'] = totalViews;
|
||||
data['createdOn'] = createdOn;
|
||||
data['priceExcludingDiscount'] = priceExcludingDiscount;
|
||||
data['reservePrice'] = reservePrice;
|
||||
data['isMCHandled'] = isMCHandled;
|
||||
data['modifiedOn'] = modifiedOn;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Vehicle {
|
||||
int? id;
|
||||
int? cityID;
|
||||
String? cityName;
|
||||
double? demandAmount;
|
||||
bool? isActive;
|
||||
bool? isFinanceAvailable;
|
||||
int? status;
|
||||
String? statustext;
|
||||
Category? category;
|
||||
Category? color;
|
||||
Condition? condition;
|
||||
Mileage? mileage;
|
||||
Condition? model;
|
||||
ModelYear? modelyear;
|
||||
Condition? sellertype;
|
||||
Condition? transmission;
|
||||
Duration? duration;
|
||||
List<AdImage>? image;
|
||||
List<DamageReport>? damagereport;
|
||||
String? vehicleDescription;
|
||||
String? vehicleTitle;
|
||||
int? vehicleType;
|
||||
String? vehicleVIN;
|
||||
int? countryID;
|
||||
String? currency;
|
||||
|
||||
Vehicle(
|
||||
{this.id,
|
||||
this.cityID,
|
||||
this.cityName,
|
||||
this.demandAmount,
|
||||
this.isActive,
|
||||
this.isFinanceAvailable,
|
||||
this.status,
|
||||
this.statustext,
|
||||
this.category,
|
||||
this.color,
|
||||
this.condition,
|
||||
this.mileage,
|
||||
this.model,
|
||||
this.modelyear,
|
||||
this.sellertype,
|
||||
this.transmission,
|
||||
this.duration,
|
||||
this.image,
|
||||
this.damagereport,
|
||||
this.vehicleDescription,
|
||||
this.vehicleTitle,
|
||||
this.vehicleType,
|
||||
this.vehicleVIN,
|
||||
this.countryID,
|
||||
this.currency});
|
||||
|
||||
Vehicle.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
cityID = json['cityID'];
|
||||
cityName = json['cityName'];
|
||||
demandAmount = json['demandAmount'];
|
||||
isActive = json['isActive'];
|
||||
isFinanceAvailable = json['isFinanceAvailable'];
|
||||
status = json['status'];
|
||||
statustext = json['statustext'];
|
||||
category = json['category'] != null
|
||||
? Category.fromJson(json['category'])
|
||||
: null;
|
||||
color = json['color'] != null ? Category.fromJson(json['color']) : null;
|
||||
condition = json['condition'] != null
|
||||
? Condition.fromJson(json['condition'])
|
||||
: null;
|
||||
mileage =
|
||||
json['mileage'] != null ? Mileage.fromJson(json['mileage']) : null;
|
||||
model =
|
||||
json['model'] != null ? Condition.fromJson(json['model']) : null;
|
||||
modelyear = json['modelyear'] != null
|
||||
? ModelYear.fromJson(json['modelyear'])
|
||||
: null;
|
||||
sellertype = json['sellertype'] != null
|
||||
? Condition.fromJson(json['sellertype'])
|
||||
: null;
|
||||
transmission = json['transmission'] != null
|
||||
? Condition.fromJson(json['transmission'])
|
||||
: null;
|
||||
duration = json['duration'] != null
|
||||
? Duration.fromJson(json['duration'])
|
||||
: null;
|
||||
if (json['image'] != null) {
|
||||
image = <AdImage>[];
|
||||
json['image'].forEach((v) {
|
||||
image!.add(AdImage.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['damagereport'] != null) {
|
||||
damagereport = <DamageReport>[];
|
||||
json['damagereport'].forEach((v) {
|
||||
damagereport!.add(DamageReport.fromJson(v));
|
||||
});
|
||||
}
|
||||
vehicleDescription = json['vehicleDescription'];
|
||||
vehicleTitle = json['vehicleTitle'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleVIN = json['vehicleVIN'];
|
||||
countryID = json['countryID'];
|
||||
currency = json['currency'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['cityID'] = cityID;
|
||||
data['cityName'] = cityName;
|
||||
data['demandAmount'] = demandAmount;
|
||||
data['isActive'] = isActive;
|
||||
data['isFinanceAvailable'] = isFinanceAvailable;
|
||||
data['status'] = status;
|
||||
data['statustext'] = statustext;
|
||||
if (category != null) {
|
||||
data['category'] = category!.toJson();
|
||||
}
|
||||
if (color != null) {
|
||||
data['color'] = color!.toJson();
|
||||
}
|
||||
if (condition != null) {
|
||||
data['condition'] = condition!.toJson();
|
||||
}
|
||||
if (mileage != null) {
|
||||
data['mileage'] = mileage!.toJson();
|
||||
}
|
||||
if (model != null) {
|
||||
data['model'] = model!.toJson();
|
||||
}
|
||||
if (modelyear != null) {
|
||||
data['modelyear'] = modelyear!.toJson();
|
||||
}
|
||||
if (sellertype != null) {
|
||||
data['sellertype'] = sellertype!.toJson();
|
||||
}
|
||||
if (transmission != null) {
|
||||
data['transmission'] = transmission!.toJson();
|
||||
}
|
||||
if (duration != null) {
|
||||
data['duration'] = duration!.toJson();
|
||||
}
|
||||
if (image != null) {
|
||||
data['image'] = image!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (damagereport != null) {
|
||||
data['damagereport'] = damagereport!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['vehicleDescription'] = vehicleDescription;
|
||||
data['vehicleTitle'] = vehicleTitle;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleVIN'] = vehicleVIN;
|
||||
data['countryID'] = countryID;
|
||||
data['currency'] = currency;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Category {
|
||||
int? id;
|
||||
String? label;
|
||||
String? labelN;
|
||||
bool? isActive;
|
||||
|
||||
Category({this.id, this.label, this.labelN, this.isActive});
|
||||
|
||||
Category.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
label = json['label'];
|
||||
labelN = json['labelN'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['label'] = label;
|
||||
data['labelN'] = labelN;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Condition {
|
||||
int? id;
|
||||
String? label;
|
||||
String? labelN;
|
||||
|
||||
Condition({this.id, this.label, this.labelN});
|
||||
|
||||
Condition.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
label = json['label'];
|
||||
labelN = json['labelN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['label'] = label;
|
||||
data['labelN'] = labelN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Mileage {
|
||||
int? id;
|
||||
String? mileageStart;
|
||||
String? mileageEnd;
|
||||
String? label;
|
||||
|
||||
Mileage({this.id, this.mileageStart, this.mileageEnd, this.label});
|
||||
|
||||
Mileage.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
mileageStart = json['mileageStart'];
|
||||
mileageEnd = json['mileageEnd'];
|
||||
label = json['label'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['mileageStart'] = mileageStart;
|
||||
data['mileageEnd'] = mileageEnd;
|
||||
data['label'] = label;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ModelYear {
|
||||
int? id;
|
||||
String? label;
|
||||
|
||||
ModelYear({this.id, this.label});
|
||||
|
||||
ModelYear.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
label = json['label'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['label'] = label;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Duration {
|
||||
int? id;
|
||||
String? label;
|
||||
int? days;
|
||||
double? price;
|
||||
ModelYear? country;
|
||||
|
||||
Duration({this.id, this.label, this.days, this.price, this.country});
|
||||
|
||||
Duration.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
label = json['label'];
|
||||
days = json['days'];
|
||||
price = json['price'];
|
||||
country = json['country'] != null
|
||||
? ModelYear.fromJson(json['country'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['label'] = label;
|
||||
data['days'] = days;
|
||||
data['price'] = price;
|
||||
if (country != null) {
|
||||
data['country'] = country!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class AdImage {
|
||||
int? id;
|
||||
String? imageName;
|
||||
String? imageUrl;
|
||||
bool? isActive;
|
||||
|
||||
AdImage({this.id, this.imageName, this.imageUrl, this.isActive});
|
||||
|
||||
AdImage.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
imageName = json['imageName'];
|
||||
imageUrl = json['imageUrl'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['imageName'] = imageName;
|
||||
data['imageUrl'] = imageUrl;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DamageReport {
|
||||
int? id;
|
||||
String? comment;
|
||||
String? imageUrl;
|
||||
bool? isActive;
|
||||
int? vehicleDamagePartID;
|
||||
String? partName;
|
||||
|
||||
DamageReport(
|
||||
{this.id,
|
||||
this.comment,
|
||||
this.imageUrl,
|
||||
this.isActive,
|
||||
this.vehicleDamagePartID,
|
||||
this.partName});
|
||||
|
||||
DamageReport.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
comment = json['comment'];
|
||||
imageUrl = json['imageUrl'];
|
||||
isActive = json['isActive'];
|
||||
vehicleDamagePartID = json['vehicleDamagePartID'];
|
||||
partName = json['partName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['comment'] = comment;
|
||||
data['imageUrl'] = imageUrl;
|
||||
data['isActive'] = isActive;
|
||||
data['vehicleDamagePartID'] = vehicleDamagePartID;
|
||||
data['partName'] = partName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,159 @@
|
||||
// class AdCreationRespModel {
|
||||
// int? id;
|
||||
// int? vehiclePostingID;
|
||||
// Null? vehiclePosting;
|
||||
// int? adsDurationID;
|
||||
// Null? adsDuration;
|
||||
// int? adsStatus;
|
||||
// int? specialServiceTotalPrice;
|
||||
// int? adsDurationPrice;
|
||||
// int? adsDurationDiscount;
|
||||
// int? adsDurationDiscountPrice;
|
||||
// int? totalPrice;
|
||||
// int? taxPrice;
|
||||
// int? netPrice;
|
||||
// bool? isPaid;
|
||||
// bool? isSubscription;
|
||||
// bool? isVerified;
|
||||
// String? userID;
|
||||
// Null? user;
|
||||
// String? comment;
|
||||
// String? startDate;
|
||||
// String? endDate;
|
||||
// Null? adsJson;
|
||||
// String? qrCodePath;
|
||||
// List<Null>? adsViews;
|
||||
// double? adsPricing;
|
||||
// bool? isCustomerAcknowledged;
|
||||
// int? createdByRole;
|
||||
// bool? isReservable;
|
||||
// int? reservePrice;
|
||||
// bool? isMCHandled;
|
||||
// bool? isActive;
|
||||
// int? createdBy;
|
||||
// String? createdOn;
|
||||
// String? modifiedBy;
|
||||
// String? modifiedOn;
|
||||
//
|
||||
// AdCreationResepModel(
|
||||
// {this.id,
|
||||
// this.vehiclePostingID,
|
||||
// this.vehiclePosting,
|
||||
// this.adsDurationID,
|
||||
// this.adsDuration,
|
||||
// this.adsStatus,
|
||||
// this.specialServiceTotalPrice,
|
||||
// this.adsDurationPrice,
|
||||
// this.adsDurationDiscount,
|
||||
// this.adsDurationDiscountPrice,
|
||||
// this.totalPrice,
|
||||
// this.taxPrice,
|
||||
// this.netPrice,
|
||||
// this.isPaid,
|
||||
// this.isSubscription,
|
||||
// this.isVerified,
|
||||
// this.userID,
|
||||
// this.user,
|
||||
// this.comment,
|
||||
// this.startDate,
|
||||
// this.endDate,
|
||||
// this.adsJson,
|
||||
// this.qrCodePath,
|
||||
// this.adsViews,
|
||||
// this.adsPricing,
|
||||
// this.isCustomerAcknowledged,
|
||||
// this.createdByRole,
|
||||
// this.isReservable,
|
||||
// this.reservePrice,
|
||||
// this.isMCHandled,
|
||||
// this.isActive,
|
||||
// this.createdBy,
|
||||
// this.createdOn,
|
||||
// this.modifiedBy,
|
||||
// this.modifiedOn});
|
||||
//
|
||||
// AdCreationResepModel.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// vehiclePostingID = json['vehiclePostingID'];
|
||||
// vehiclePosting = json['vehiclePosting'];
|
||||
// adsDurationID = json['adsDurationID'];
|
||||
// adsDuration = json['adsDuration'];
|
||||
// adsStatus = json['adsStatus'];
|
||||
// specialServiceTotalPrice = json['specialServiceTotalPrice'];
|
||||
// adsDurationPrice = json['adsDurationPrice'];
|
||||
// adsDurationDiscount = json['adsDurationDiscount'];
|
||||
// adsDurationDiscountPrice = json['adsDurationDiscountPrice'];
|
||||
// totalPrice = json['totalPrice'];
|
||||
// taxPrice = json['taxPrice'];
|
||||
// netPrice = json['netPrice'];
|
||||
// isPaid = json['isPaid'];
|
||||
// isSubscription = json['isSubscription'];
|
||||
// isVerified = json['isVerified'];
|
||||
// userID = json['userID'];
|
||||
// user = json['user'];
|
||||
// comment = json['comment'];
|
||||
// startDate = json['startDate'];
|
||||
// endDate = json['endDate'];
|
||||
// adsJson = json['adsJson'];
|
||||
// qrCodePath = json['qrCodePath'];
|
||||
// if (json['adsViews'] != null) {
|
||||
// adsViews = <Null>[];
|
||||
// json['adsViews'].forEach((v) {
|
||||
// adsViews!.add(new Null.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
// adsPricing = json['adsPricing'];
|
||||
// isCustomerAcknowledged = json['isCustomerAcknowledged'];
|
||||
// createdByRole = json['createdByRole'];
|
||||
// isReservable = json['isReservable'];
|
||||
// reservePrice = json['reservePrice'];
|
||||
// isMCHandled = json['isMCHandled'];
|
||||
// isActive = json['isActive'];
|
||||
// createdBy = json['createdBy'];
|
||||
// createdOn = json['createdOn'];
|
||||
// modifiedBy = json['modifiedBy'];
|
||||
// modifiedOn = json['modifiedOn'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = <String, dynamic>{};
|
||||
// data['id'] = id;
|
||||
// data['vehiclePostingID'] = vehiclePostingID;
|
||||
// data['vehiclePosting'] = vehiclePosting;
|
||||
// data['adsDurationID'] = adsDurationID;
|
||||
// data['adsDuration'] = adsDuration;
|
||||
// data['adsStatus'] = adsStatus;
|
||||
// data['specialServiceTotalPrice'] = specialServiceTotalPrice;
|
||||
// data['adsDurationPrice'] = adsDurationPrice;
|
||||
// data['adsDurationDiscount'] = adsDurationDiscount;
|
||||
// data['adsDurationDiscountPrice'] = adsDurationDiscountPrice;
|
||||
// data['totalPrice'] = totalPrice;
|
||||
// data['taxPrice'] = taxPrice;
|
||||
// data['netPrice'] = netPrice;
|
||||
// data['isPaid'] = isPaid;
|
||||
// data['isSubscription'] = isSubscription;
|
||||
// data['isVerified'] = isVerified;
|
||||
// data['userID'] = userID;
|
||||
// data['user'] = user;
|
||||
// data['comment'] = comment;
|
||||
// data['startDate'] = startDate;
|
||||
// data['endDate'] = endDate;
|
||||
// data['adsJson'] = adsJson;
|
||||
// data['qrCodePath'] = qrCodePath;
|
||||
// if (adsViews != null) {
|
||||
// data['adsViews'] = adsViews!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
// data['adsPricing'] = adsPricing;
|
||||
// data['isCustomerAcknowledged'] = isCustomerAcknowledged;
|
||||
// data['createdByRole'] = createdByRole;
|
||||
// data['isReservable'] = isReservable;
|
||||
// data['reservePrice'] = reservePrice;
|
||||
// data['isMCHandled'] = isMCHandled;
|
||||
// data['isActive'] = isActive;
|
||||
// data['createdBy'] = createdBy;
|
||||
// data['createdOn'] = createdOn;
|
||||
// data['modifiedBy'] = modifiedBy;
|
||||
// data['modifiedOn'] = modifiedOn;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
@ -0,0 +1,40 @@
|
||||
class AdsDurationModel {
|
||||
int? id;
|
||||
String? name;
|
||||
int? days;
|
||||
double? price;
|
||||
int? countryID;
|
||||
bool? isActive;
|
||||
String? countryName;
|
||||
|
||||
AdsDurationModel(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.days,
|
||||
this.price,
|
||||
this.countryID,
|
||||
this.isActive,
|
||||
this.countryName});
|
||||
|
||||
AdsDurationModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
days = json['days'];
|
||||
price = json['price'];
|
||||
countryID = json['countryID'];
|
||||
isActive = json['isActive'];
|
||||
countryName = json['countryName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['days'] = days;
|
||||
data['price'] = price;
|
||||
data['countryID'] = countryID;
|
||||
data['isActive'] = isActive;
|
||||
data['countryName'] = countryName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,337 @@
|
||||
class AdsGenericModel {
|
||||
AdsGenericModel({
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.totalItemsCount,
|
||||
});
|
||||
|
||||
dynamic data;
|
||||
int? messageStatus;
|
||||
int? totalItemsCount;
|
||||
|
||||
factory AdsGenericModel.fromJson(Map<String, dynamic> json) => AdsGenericModel(
|
||||
data: json["data"],
|
||||
messageStatus: json["messageStatus"],
|
||||
totalItemsCount: json["totalItemsCount"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": data,
|
||||
"messageStatus": messageStatus,
|
||||
"totalItemsCount": totalItemsCount,
|
||||
};
|
||||
}
|
||||
|
||||
var json = {
|
||||
"ads": {
|
||||
"id": 0,
|
||||
"adsDurationID": 1,
|
||||
"startDate": "2023-04-12T10:10:20.905Z",
|
||||
"countryId": 1,
|
||||
"specialServiceIDs": [
|
||||
|
||||
],
|
||||
"isMCHandled": false
|
||||
},
|
||||
"vehiclePosting": {
|
||||
"id": 0,
|
||||
"userID": "1A1597B3-D5A0-433A-098B-08DB189E51EC",
|
||||
"vehicleType": 1,
|
||||
"vehicleModelID": 1,
|
||||
"vehicleModelYearID": 1,
|
||||
"vehicleColorID": 2,
|
||||
"vehicleCategoryID": 1,
|
||||
"vehicleConditionID": 1,
|
||||
"vehicleMileageID": 1,
|
||||
"vehicleTransmissionID": 1,
|
||||
"vehicleSellerTypeID": 1,
|
||||
"cityID": 1,
|
||||
"price": 33,
|
||||
"vehicleVIN": "fdfd",
|
||||
"vehicleDescription": "dsd",
|
||||
"vehicleTitle": "fsfs",
|
||||
"vehicleDescriptionN": "dsdds",
|
||||
"isFinanceAvailable": true,
|
||||
"warantyYears": 2,
|
||||
"demandAmount": 34,
|
||||
"adStatus": 1,
|
||||
"vehiclePostingImages": [
|
||||
{
|
||||
"id": 0,
|
||||
"imageName": "onon",
|
||||
"imageUrl": "string",
|
||||
"imageStr": null,
|
||||
"vehiclePostingID": 0,
|
||||
"vehiclePosting": null
|
||||
}
|
||||
],
|
||||
"vehiclePostingDamageParts": [
|
||||
{
|
||||
"id": 0,
|
||||
"comment": "hhsa",
|
||||
"vehicleImageBase64": null,
|
||||
"vehicleDamagePartID": 1,
|
||||
"vehiclePostingID": 0,
|
||||
"isActive": true
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
class AdsCreationPayloadModel {
|
||||
Ads? ads;
|
||||
VehiclePosting? vehiclePosting;
|
||||
|
||||
AdsCreationPayloadModel({this.ads, this.vehiclePosting});
|
||||
|
||||
AdsCreationPayloadModel.fromJson(Map<String, dynamic> json) {
|
||||
ads = json['ads'] != null ? Ads.fromJson(json['ads']) : null;
|
||||
vehiclePosting = json['vehiclePosting'] != null
|
||||
? VehiclePosting.fromJson(json['vehiclePosting'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (ads != null) {
|
||||
data['ads'] = ads!.toJson();
|
||||
}
|
||||
if (vehiclePosting != null) {
|
||||
data['vehiclePosting'] = vehiclePosting!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Ads {
|
||||
int? id;
|
||||
int? adsDurationID;
|
||||
String? startDate;
|
||||
int? countryId;
|
||||
List<int>? specialServiceIDs;
|
||||
bool? isMCHandled;
|
||||
|
||||
Ads(
|
||||
{this.id,
|
||||
this.adsDurationID,
|
||||
this.startDate,
|
||||
this.countryId,
|
||||
this.specialServiceIDs,
|
||||
this.isMCHandled});
|
||||
|
||||
Ads.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
adsDurationID = json['adsDurationID'];
|
||||
startDate = json['startDate'];
|
||||
countryId = json['countryId'];
|
||||
specialServiceIDs = json['specialServiceIDs'].cast<int>();
|
||||
isMCHandled = json['isMCHandled'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['adsDurationID'] = adsDurationID;
|
||||
data['startDate'] = startDate;
|
||||
data['countryId'] = countryId;
|
||||
data['specialServiceIDs'] = specialServiceIDs;
|
||||
data['isMCHandled'] = isMCHandled;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehiclePosting {
|
||||
int? id;
|
||||
String? userID;
|
||||
int? vehicleType;
|
||||
int? vehicleModelID;
|
||||
int? vehicleModelYearID;
|
||||
int? vehicleColorID;
|
||||
int? vehicleCategoryID;
|
||||
int? vehicleConditionID;
|
||||
int? vehicleMileageID;
|
||||
int? vehicleTransmissionID;
|
||||
int? vehicleSellerTypeID;
|
||||
int? cityID;
|
||||
int? price;
|
||||
String? vehicleVIN;
|
||||
String? vehicleDescription;
|
||||
String? vehicleTitle;
|
||||
String? vehicleDescriptionN;
|
||||
bool? isFinanceAvailable;
|
||||
int? warantyYears;
|
||||
int? demandAmount;
|
||||
int? adStatus;
|
||||
List<VehiclePostingImages>? vehiclePostingImages;
|
||||
List<VehiclePostingDamageParts>? vehiclePostingDamageParts;
|
||||
|
||||
VehiclePosting(
|
||||
{this.id,
|
||||
this.userID,
|
||||
this.vehicleType,
|
||||
this.vehicleModelID,
|
||||
this.vehicleModelYearID,
|
||||
this.vehicleColorID,
|
||||
this.vehicleCategoryID,
|
||||
this.vehicleConditionID,
|
||||
this.vehicleMileageID,
|
||||
this.vehicleTransmissionID,
|
||||
this.vehicleSellerTypeID,
|
||||
this.cityID,
|
||||
this.price,
|
||||
this.vehicleVIN,
|
||||
this.vehicleDescription,
|
||||
this.vehicleTitle,
|
||||
this.vehicleDescriptionN,
|
||||
this.isFinanceAvailable,
|
||||
this.warantyYears,
|
||||
this.demandAmount,
|
||||
this.adStatus,
|
||||
this.vehiclePostingImages,
|
||||
this.vehiclePostingDamageParts});
|
||||
|
||||
VehiclePosting.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userID = json['userID'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleModelID = json['vehicleModelID'];
|
||||
vehicleModelYearID = json['vehicleModelYearID'];
|
||||
vehicleColorID = json['vehicleColorID'];
|
||||
vehicleCategoryID = json['vehicleCategoryID'];
|
||||
vehicleConditionID = json['vehicleConditionID'];
|
||||
vehicleMileageID = json['vehicleMileageID'];
|
||||
vehicleTransmissionID = json['vehicleTransmissionID'];
|
||||
vehicleSellerTypeID = json['vehicleSellerTypeID'];
|
||||
cityID = json['cityID'];
|
||||
price = json['price'];
|
||||
vehicleVIN = json['vehicleVIN'];
|
||||
vehicleDescription = json['vehicleDescription'];
|
||||
vehicleTitle = json['vehicleTitle'];
|
||||
vehicleDescriptionN = json['vehicleDescriptionN'];
|
||||
isFinanceAvailable = json['isFinanceAvailable'];
|
||||
warantyYears = json['warantyYears'];
|
||||
demandAmount = json['demandAmount'];
|
||||
adStatus = json['adStatus'];
|
||||
if (json['vehiclePostingImages'] != null) {
|
||||
vehiclePostingImages = <VehiclePostingImages>[];
|
||||
json['vehiclePostingImages'].forEach((v) {
|
||||
vehiclePostingImages!.add(VehiclePostingImages.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['vehiclePostingDamageParts'] != null) {
|
||||
vehiclePostingDamageParts = <VehiclePostingDamageParts>[];
|
||||
json['vehiclePostingDamageParts'].forEach((v) {
|
||||
vehiclePostingDamageParts!
|
||||
.add(VehiclePostingDamageParts.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['userID'] = userID;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleModelID'] = vehicleModelID;
|
||||
data['vehicleModelYearID'] = vehicleModelYearID;
|
||||
data['vehicleColorID'] = vehicleColorID;
|
||||
data['vehicleCategoryID'] = vehicleCategoryID;
|
||||
data['vehicleConditionID'] = vehicleConditionID;
|
||||
data['vehicleMileageID'] = vehicleMileageID;
|
||||
data['vehicleTransmissionID'] = vehicleTransmissionID;
|
||||
data['vehicleSellerTypeID'] = vehicleSellerTypeID;
|
||||
data['cityID'] = cityID;
|
||||
data['price'] = price;
|
||||
data['vehicleVIN'] = vehicleVIN;
|
||||
data['vehicleDescription'] = vehicleDescription;
|
||||
data['vehicleTitle'] = vehicleTitle;
|
||||
data['vehicleDescriptionN'] = vehicleDescriptionN;
|
||||
data['isFinanceAvailable'] = isFinanceAvailable;
|
||||
data['warantyYears'] = warantyYears;
|
||||
data['demandAmount'] = demandAmount;
|
||||
data['adStatus'] = adStatus;
|
||||
if (vehiclePostingImages != null) {
|
||||
data['vehiclePostingImages'] =
|
||||
vehiclePostingImages!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (vehiclePostingDamageParts != null) {
|
||||
data['vehiclePostingDamageParts'] =
|
||||
vehiclePostingDamageParts!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehiclePostingImages {
|
||||
int? id;
|
||||
String? imageName;
|
||||
String? imageUrl;
|
||||
String? imageStr;
|
||||
int? vehiclePostingID;
|
||||
String? vehiclePosting;
|
||||
|
||||
VehiclePostingImages(
|
||||
{this.id,
|
||||
this.imageName,
|
||||
this.imageUrl,
|
||||
this.imageStr,
|
||||
this.vehiclePostingID,
|
||||
this.vehiclePosting});
|
||||
|
||||
VehiclePostingImages.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
imageName = json['imageName'];
|
||||
imageUrl = json['imageUrl'];
|
||||
imageStr = json['imageStr'];
|
||||
vehiclePostingID = json['vehiclePostingID'];
|
||||
vehiclePosting = json['vehiclePosting'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['imageName'] = imageName;
|
||||
data['imageUrl'] = imageUrl;
|
||||
data['imageStr'] = imageStr;
|
||||
data['vehiclePostingID'] = vehiclePostingID;
|
||||
data['vehiclePosting'] = vehiclePosting;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehiclePostingDamageParts {
|
||||
int? id;
|
||||
String? comment;
|
||||
String? vehicleImageBase64;
|
||||
int? vehicleDamagePartID;
|
||||
int? vehiclePostingID;
|
||||
bool? isActive;
|
||||
|
||||
VehiclePostingDamageParts(
|
||||
{this.id,
|
||||
this.comment,
|
||||
this.vehicleImageBase64,
|
||||
this.vehicleDamagePartID,
|
||||
this.vehiclePostingID,
|
||||
this.isActive});
|
||||
|
||||
VehiclePostingDamageParts.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
comment = json['comment'];
|
||||
vehicleImageBase64 = json['vehicleImageBase64'];
|
||||
vehicleDamagePartID = json['vehicleDamagePartID'];
|
||||
vehiclePostingID = json['vehiclePostingID'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['comment'] = comment;
|
||||
data['vehicleImageBase64'] = vehicleImageBase64;
|
||||
data['vehicleDamagePartID'] = vehicleDamagePartID;
|
||||
data['vehiclePostingID'] = vehiclePostingID;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
class SpecialServiceModel {
|
||||
int? id;
|
||||
String? name;
|
||||
String? description;
|
||||
double? price;
|
||||
int? specialServiceType;
|
||||
String? specialServiceTypeName;
|
||||
bool? isActive;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
List<Details>? details;
|
||||
List<Office>? office;
|
||||
bool? isDelivery;
|
||||
|
||||
SpecialServiceModel(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.description,
|
||||
this.price,
|
||||
this.specialServiceType,
|
||||
this.specialServiceTypeName,
|
||||
this.isActive,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.details,
|
||||
this.office,
|
||||
this.isDelivery});
|
||||
|
||||
SpecialServiceModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
description = json['description'];
|
||||
price = json['price'];
|
||||
specialServiceType = json['specialServiceType'];
|
||||
specialServiceTypeName = json['specialServiceTypeName'];
|
||||
isActive = json['isActive'];
|
||||
startDate = json['startDate'];
|
||||
endDate = json['endDate'];
|
||||
if (json['details'] != null) {
|
||||
details = <Details>[];
|
||||
json['details'].forEach((v) {
|
||||
details!.add(Details.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['office'] != null) {
|
||||
office = <Office>[];
|
||||
json['office'].forEach((v) {
|
||||
office!.add(Office.fromJson(v));
|
||||
});
|
||||
}
|
||||
isDelivery = json['isDelivery'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['description'] = description;
|
||||
data['price'] = price;
|
||||
data['specialServiceType'] = specialServiceType;
|
||||
data['specialServiceTypeName'] = specialServiceTypeName;
|
||||
data['isActive'] = isActive;
|
||||
data['startDate'] = startDate;
|
||||
data['endDate'] = endDate;
|
||||
if (details != null) {
|
||||
data['details'] = details!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (office != null) {
|
||||
data['office'] = office!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['isDelivery'] = isDelivery;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Details {
|
||||
int? id;
|
||||
int? specialServiceID;
|
||||
int? fromcity;
|
||||
int? tocity;
|
||||
int? price;
|
||||
|
||||
Details(
|
||||
{this.id, this.specialServiceID, this.fromcity, this.tocity, this.price});
|
||||
|
||||
Details.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
specialServiceID = json['specialServiceID'];
|
||||
fromcity = json['fromcity'];
|
||||
tocity = json['tocity'];
|
||||
price = json['price'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['specialServiceID'] = specialServiceID;
|
||||
data['fromcity'] = fromcity;
|
||||
data['tocity'] = tocity;
|
||||
data['price'] = price;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Office {
|
||||
int? id;
|
||||
String? officeAreaName;
|
||||
String? officeAreaNameN;
|
||||
int? cityID;
|
||||
String? city;
|
||||
int? specialServiceID;
|
||||
|
||||
Office(
|
||||
{this.id,
|
||||
this.officeAreaName,
|
||||
this.officeAreaNameN,
|
||||
this.cityID,
|
||||
this.city,
|
||||
this.specialServiceID});
|
||||
|
||||
Office.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
officeAreaName = json['officeAreaName'];
|
||||
officeAreaNameN = json['officeAreaNameN'];
|
||||
cityID = json['cityID'];
|
||||
city = json['city'];
|
||||
specialServiceID = json['specialServiceID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['officeAreaName'] = officeAreaName;
|
||||
data['officeAreaNameN'] = officeAreaNameN;
|
||||
data['cityID'] = cityID;
|
||||
data['city'] = city;
|
||||
data['specialServiceID'] = specialServiceID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,522 @@
|
||||
import 'dart:developer';
|
||||
|
||||
class VehicleDetailsModel {
|
||||
List<VehicleBrandsModel>? vehicleBrands;
|
||||
List<VehicleCategoryModel>? vehicleCategories;
|
||||
List<VehicleColorModel>? vehicleColors;
|
||||
List<VehicleConditionModel>? vehicleConditions;
|
||||
List<VehicleMileageModel>? vehicleMileages;
|
||||
List<VehicleModel>? vehicleModels;
|
||||
List<VehicleYearModel>? vehicleModelYears;
|
||||
List<VehiclePriceRangeModel>? vehiclePriceRanges;
|
||||
List<VehiclePricingMethodModel>? vehiclePricingMethods;
|
||||
List<VehicleSellerTypeModel>? vehicleSellerTypes;
|
||||
List<VehicleTransmissionModel>? vehicleTransmissions;
|
||||
List<VehicleCountryModel>? vehicleCountries;
|
||||
|
||||
VehicleDetailsModel({
|
||||
this.vehicleBrands,
|
||||
this.vehicleCategories,
|
||||
this.vehicleColors,
|
||||
this.vehicleConditions,
|
||||
this.vehicleMileages,
|
||||
this.vehicleModels,
|
||||
this.vehicleModelYears,
|
||||
this.vehiclePriceRanges,
|
||||
this.vehiclePricingMethods,
|
||||
this.vehicleSellerTypes,
|
||||
this.vehicleTransmissions,
|
||||
this.vehicleCountries,
|
||||
});
|
||||
|
||||
VehicleDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
log("jsonJee: $json");
|
||||
vehicleBrands = List.generate((json['vehiclebrands']['data']).length, (index) => VehicleBrandsModel.fromJson(json['vehiclebrands']['data'][index]));
|
||||
vehicleCategories = List.generate((json['vehiclecategories']['data']).length, (index) => VehicleCategoryModel.fromJson(json['vehiclecategories']['data'][index]));
|
||||
vehicleColors = List.generate((json['vehiclecolors']['data']).length, (index) => VehicleColorModel.fromJson(json['vehiclecolors']['data'][index]));
|
||||
vehicleConditions = List.generate((json['vehicleconditions']['data']).length, (index) => VehicleConditionModel.fromJson(json['vehicleconditions']['data'][index]));
|
||||
vehicleMileages = List.generate((json['vehiclemileages']['data']).length, (index) => VehicleMileageModel.fromJson(json['vehiclemileages']['data'][index]));
|
||||
vehicleModels = List.generate((json['vehiclemodels']['data']).length, (index) => VehicleModel.fromJson(json['vehiclemodels']['data'][index]));
|
||||
vehicleModelYears = List.generate((json['vehiclemodelyears']['data']).length, (index) => VehicleYearModel.fromJson(json['vehiclemodelyears']['data'][index]));
|
||||
vehiclePriceRanges = List.generate((json['vehiclepriceranges']['data']).length, (index) => VehiclePriceRangeModel.fromJson(json['vehiclepriceranges']['data'][index]));
|
||||
vehiclePricingMethods = List.generate((json['vehiclepricingmethods']['data']).length, (index) => VehiclePricingMethodModel.fromJson(json['vehiclepricingmethods']['data'][index]));
|
||||
vehicleSellerTypes = List.generate((json['vehiclesellertypes']['data']).length, (index) => VehicleSellerTypeModel.fromJson(json['vehiclesellertypes']['data'][index]));
|
||||
vehicleTransmissions = List.generate((json['vehicletransmissions']['data']).length, (index) => VehicleTransmissionModel.fromJson(json['vehicletransmissions']['data'][index]));
|
||||
vehicleCountries = List.generate((json['countries']['data']).length, (index) => VehicleCountryModel.fromJson(json['countries']['data'][index]));
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'VehicleDetailsModel{vehicleBrands: $vehicleBrands, vehicleCategories: $vehicleCategories, vehicleColors: $vehicleColors, vehicleConditions: $vehicleConditions, vehicleMileages: $vehicleMileages, vehicleModels: $vehicleModels, vehicleModelYears: $vehicleModelYears, vehiclePriceRanges: $vehiclePriceRanges, vehiclePricingMethods: $vehiclePricingMethods, vehicleSellerTypes: $vehicleSellerTypes, vehicleTransmissions: $vehicleTransmissions, vehicleCountries: $vehicleCountries,}';
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleTypeModel {
|
||||
int? id;
|
||||
String? vehicleTypeName;
|
||||
String? vehicleTypeNameN;
|
||||
bool? isActive;
|
||||
|
||||
VehicleTypeModel({this.id, this.vehicleTypeName, this.vehicleTypeNameN, this.isActive});
|
||||
|
||||
VehicleTypeModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleTypeName = json['vehicleTypeName'];
|
||||
vehicleTypeNameN = json['vehicleTypeNameN'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleTypeName'] = vehicleTypeName;
|
||||
data['vehicleTypeNameN'] = vehicleTypeNameN;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'VehicleTypeModel{id: $id, vehicleTypeName: $vehicleTypeName, vehicleTypeNameN: $vehicleTypeNameN, isActive: $isActive}';
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? model;
|
||||
String? modelN;
|
||||
int? vehicleBrandID;
|
||||
bool? isActive;
|
||||
|
||||
VehicleModel({this.id, this.vehicleType, this.vehicleTypeVal, this.model, this.modelN, this.vehicleBrandID, this.isActive});
|
||||
|
||||
VehicleModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
model = json['model'];
|
||||
modelN = json['modelN'];
|
||||
vehicleBrandID = json['vehicleBrandID'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['model'] = model;
|
||||
data['modelN'] = modelN;
|
||||
data['vehicleBrandID'] = vehicleBrandID;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleYearModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? modelYear;
|
||||
bool? isActive;
|
||||
|
||||
VehicleYearModel({this.id, this.vehicleType, this.vehicleTypeVal, this.modelYear, this.isActive});
|
||||
|
||||
VehicleYearModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
modelYear = json['modelYear'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['modelYear'] = modelYear;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleColorModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? color;
|
||||
String? colorN;
|
||||
bool? isActive;
|
||||
|
||||
VehicleColorModel({this.id, this.vehicleType, this.vehicleTypeVal, this.color, this.colorN, this.isActive});
|
||||
|
||||
VehicleColorModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
color = json['color'];
|
||||
colorN = json['colorN'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['color'] = color;
|
||||
data['colorN'] = colorN;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleConditionModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? condition;
|
||||
String? conditionN;
|
||||
bool? isActive;
|
||||
|
||||
VehicleConditionModel({this.id, this.vehicleType, this.vehicleTypeVal, this.condition, this.conditionN, this.isActive});
|
||||
|
||||
VehicleConditionModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
condition = json['condition'];
|
||||
conditionN = json['conditionN'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['condition'] = condition;
|
||||
data['conditionN'] = conditionN;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleCategoryModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? category;
|
||||
String? categoryN;
|
||||
bool? isActive;
|
||||
|
||||
VehicleCategoryModel({this.id, this.vehicleType, this.vehicleTypeVal, this.category, this.categoryN, this.isActive});
|
||||
|
||||
VehicleCategoryModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
category = json['category'];
|
||||
categoryN = json['categoryN'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['category'] = category;
|
||||
data['categoryN'] = categoryN;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleMileageModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? mileageStart;
|
||||
String? mileageEnd;
|
||||
bool? isActive;
|
||||
|
||||
VehicleMileageModel({this.id, this.vehicleType, this.vehicleTypeVal, this.mileageStart, this.mileageEnd, this.isActive});
|
||||
|
||||
VehicleMileageModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
mileageStart = json['mileageStart'];
|
||||
mileageEnd = json['mileageEnd'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['mileageStart'] = mileageStart;
|
||||
data['mileageEnd'] = mileageEnd;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleTransmissionModel {
|
||||
int? id;
|
||||
String? transmission;
|
||||
String? transmissionN;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
bool? isActive;
|
||||
|
||||
VehicleTransmissionModel({this.id, this.transmission, this.transmissionN, this.vehicleType, this.vehicleTypeVal, this.isActive});
|
||||
|
||||
VehicleTransmissionModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
transmission = json['transmission'];
|
||||
transmissionN = json['transmissionN'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['transmission'] = transmission;
|
||||
data['transmissionN'] = transmissionN;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleSellerTypeModel {
|
||||
int? id;
|
||||
String? sellerType;
|
||||
String? sellerTypeN;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
bool? isActive;
|
||||
|
||||
VehicleSellerTypeModel({this.id, this.sellerType, this.sellerTypeN, this.vehicleType, this.vehicleTypeVal, this.isActive});
|
||||
|
||||
VehicleSellerTypeModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
sellerType = json['sellerType'];
|
||||
sellerTypeN = json['sellerTypeN'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['sellerType'] = sellerType;
|
||||
data['sellerTypeN'] = sellerTypeN;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleCountryModel {
|
||||
int? id;
|
||||
String? countryName;
|
||||
String? countryNameN;
|
||||
String? nationality;
|
||||
String? nationalityN;
|
||||
String? countryCode;
|
||||
String? alpha2Code;
|
||||
String? alpha3Code;
|
||||
String? currency;
|
||||
bool? isActive;
|
||||
|
||||
VehicleCountryModel({this.id, this.countryName, this.countryNameN, this.nationality, this.nationalityN, this.countryCode, this.alpha2Code, this.alpha3Code, this.currency, this.isActive});
|
||||
|
||||
VehicleCountryModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
countryName = json['countryName'];
|
||||
countryNameN = json['countryNameN'];
|
||||
nationality = json['nationality'];
|
||||
nationalityN = json['nationalityN'];
|
||||
countryCode = json['countryCode'];
|
||||
alpha2Code = json['alpha2Code'];
|
||||
alpha3Code = json['alpha3Code'];
|
||||
currency = json['currency'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['countryName'] = countryName;
|
||||
data['countryNameN'] = countryNameN;
|
||||
data['nationality'] = nationality;
|
||||
data['nationalityN'] = nationalityN;
|
||||
data['countryCode'] = countryCode;
|
||||
data['alpha2Code'] = alpha2Code;
|
||||
data['alpha3Code'] = alpha3Code;
|
||||
data['currency'] = currency;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleCityModel {
|
||||
int? id;
|
||||
String? cityName;
|
||||
String? cityNameN;
|
||||
int? countryID;
|
||||
bool? isActive;
|
||||
|
||||
VehicleCityModel({this.id, this.cityName, this.cityNameN, this.countryID, this.isActive});
|
||||
|
||||
VehicleCityModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
cityName = json['cityName'];
|
||||
cityNameN = json['cityNameN'];
|
||||
countryID = json['countryID'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['cityName'] = cityName;
|
||||
data['cityNameN'] = cityNameN;
|
||||
data['countryID'] = countryID;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehiclePartModel {
|
||||
int? id;
|
||||
int? partNo;
|
||||
String? partName;
|
||||
String? description;
|
||||
bool? isActive;
|
||||
|
||||
VehiclePartModel({this.id, this.partNo, this.partName, this.description, this.isActive});
|
||||
|
||||
VehiclePartModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
partNo = json['partNo'];
|
||||
partName = json['partName'];
|
||||
description = json['description'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['partNo'] = partNo;
|
||||
data['partName'] = partName;
|
||||
data['description'] = description;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleBrandsModel {
|
||||
int? id;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
String? vehicleBrandDescription;
|
||||
String? vehicleBrandDescriptionN;
|
||||
bool? isActive;
|
||||
|
||||
VehicleBrandsModel({this.id, this.vehicleType, this.vehicleTypeVal, this.vehicleBrandDescription, this.vehicleBrandDescriptionN, this.isActive});
|
||||
|
||||
VehicleBrandsModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
vehicleBrandDescription = json['vehicleBrand_Description'];
|
||||
vehicleBrandDescriptionN = json['vehicleBrand_DescriptionN'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['vehicleBrand_Description'] = vehicleBrandDescription;
|
||||
data['vehicleBrand_DescriptionN'] = vehicleBrandDescriptionN;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehiclePriceRangeModel {
|
||||
int? id;
|
||||
String? priceRangeStart;
|
||||
String? priceRangeEnd;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
bool? isActive;
|
||||
|
||||
VehiclePriceRangeModel({this.id, this.priceRangeStart, this.priceRangeEnd, this.vehicleType, this.vehicleTypeVal, this.isActive});
|
||||
|
||||
VehiclePriceRangeModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
priceRangeStart = json['priceRangeStart'];
|
||||
priceRangeEnd = json['priceRangeEnd'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['priceRangeStart'] = priceRangeStart;
|
||||
data['priceRangeEnd'] = priceRangeEnd;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VehiclePricingMethodModel {
|
||||
int? id;
|
||||
String? pricingMethod;
|
||||
String? pricingMethodN;
|
||||
int? vehicleType;
|
||||
String? vehicleTypeVal;
|
||||
bool? isActive;
|
||||
|
||||
VehiclePricingMethodModel({this.id, this.pricingMethod, this.pricingMethodN, this.vehicleType, this.vehicleTypeVal, this.isActive});
|
||||
|
||||
VehiclePricingMethodModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
pricingMethod = json['pricingMethod'];
|
||||
pricingMethodN = json['pricingMethodN'];
|
||||
vehicleType = json['vehicleType'];
|
||||
vehicleTypeVal = json['vehicleTypeVal'];
|
||||
isActive = json['isActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['pricingMethod'] = pricingMethod;
|
||||
data['pricingMethodN'] = pricingMethodN;
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['vehicleTypeVal'] = vehicleTypeVal;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/classes/consts.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
|
||||
class PickedImagesContainer extends StatelessWidget {
|
||||
final List<File> pickedImages;
|
||||
final Function(String filePath) onCrossPressed;
|
||||
|
||||
const PickedImagesContainer({
|
||||
Key? key,
|
||||
required this.pickedImages,
|
||||
required this.onCrossPressed,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Wrap(
|
||||
children: pickedImages.map((file) => BuildImageContainer(file: file, onCrossPressed: onCrossPressed,)).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BuildImageContainer extends StatelessWidget {
|
||||
final File file;
|
||||
final Function(String filePath) onCrossPressed;
|
||||
|
||||
const BuildImageContainer({
|
||||
Key? key,
|
||||
required this.file,
|
||||
required this.onCrossPressed,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
height: 80,
|
||||
width: 80,
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.file(
|
||||
file,
|
||||
fit: BoxFit.fill,
|
||||
height: 72,
|
||||
width: 70,
|
||||
).paddingAll(8),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: MyAssets.closeWithOrangeBg.buildSvg(
|
||||
fit: BoxFit.fill,
|
||||
height: 25,
|
||||
width: 25,
|
||||
),
|
||||
).onPress(() {
|
||||
onCrossPressed(file.path);
|
||||
})
|
||||
],
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue