initial commit: push everything

This commit is contained in:
2026-07-06 20:27:53 +05:30
commit df4e044d74
329 changed files with 36620 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
class Sms {
int? code;
SmsDetails? details;
String? message;
bool? status;
Sms({this.code, this.details, this.message, this.status});
factory Sms.fromJson(Map<String, dynamic> json) {
return Sms(
code: json['code'] as int?,
details: json['details'] != null
? SmsDetails.fromJson(json['details'] as Map<String, dynamic>)
: null,
message: json['message'] as String?,
status: json['status'] as bool?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['code'] = code;
if (details != null) {
data['details'] = details!.toJson();
}
data['message'] = message;
data['status'] = status;
return data;
}
}
class SmsDetails {
int? providerId;
int? templateTypeId;
String? templateName;
int? templateId;
String? providerApi;
String? content;
int? defaultProvider;
int? passkey;
SmsDetails({
this.providerId,
this.templateTypeId,
this.templateName,
this.templateId,
this.providerApi,
this.content,
this.defaultProvider,
this.passkey,
});
factory SmsDetails.fromJson(Map<String, dynamic> json) {
return SmsDetails(
providerId: json['providerid'] as int?,
templateTypeId: json['templatetypeid'] as int?,
templateName: json['templatename'] as String?,
templateId: json['templateid'] as int?,
providerApi: json['providerapi'] as String?,
content: json['content'] as String?,
defaultProvider: json['defaultprovider'] as int?,
passkey: json['passkey'] as int?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['providerid'] = providerId;
data['templatetypeid'] = templateTypeId;
data['templatename'] = templateName;
data['templateid'] = templateId;
data['providerapi'] = providerApi;
data['content'] = content;
data['defaultprovider'] = defaultProvider;
data['passkey'] = passkey;
return data;
}
}

View File

@@ -0,0 +1,175 @@
class offline {
int? userid;
String? authname;
int? configid;
int? authmode;
int? roleid;
String? firstname;
String? lastname;
String? fullname;
String? password;
String? email;
String? contactno;
String? address;
String? suburb;
String? city;
String? state;
String? postcode;
String? userfcmtoken;
int? pin;
int? partnerid;
String? identificationno;
String? vehiclename;
String? vehicleno;
String? licenseno;
String? insoranceno;
String? insurancedate;
int? shiftid;
String? starttime;
String? endtime;
int? shifthours;
double? basefare;
double? additionalcharges;
int? orders;
double? fuelcharge;
String? logdate;
int? applocationid;
String? applocation;
int? logseconds;
int? riderid;
String? status;
int? tenantid;
offline({
this.userid,
this.authname,
this.configid,
this.authmode,
this.roleid,
this.firstname,
this.lastname,
this.fullname,
this.password,
this.email,
this.contactno,
this.address,
this.suburb,
this.city,
this.state,
this.postcode,
this.userfcmtoken,
this.pin,
this.partnerid,
this.identificationno,
this.vehiclename,
this.vehicleno,
this.licenseno,
this.insoranceno,
this.insurancedate,
this.shiftid,
this.starttime,
this.endtime,
this.shifthours,
this.basefare,
this.additionalcharges,
this.orders,
this.fuelcharge,
this.logdate,
this.applocationid,
this.applocation,
this.logseconds,
this.riderid,
this.status,
this.tenantid,
});
factory offline.fromJson(Map<String, dynamic> json) {
return offline(
userid: json['userid'] as int?,
authname: json['authname'] as String?,
configid: json['configid'] as int?,
authmode: json['authmode'] as int?,
roleid: json['roleid'] as int?,
firstname: json['firstname'] as String?,
lastname: json['lastname'] as String?,
fullname: json['fullname'] as String?,
password: json['password'] as String?,
email: json['email'] as String?,
contactno: json['contactno'] as String?,
address: json['address'] as String?,
suburb: json['suburb'] as String?,
city: json['city'] as String?,
state: json['state'] as String?,
postcode: json['postcode'] as String?,
userfcmtoken: json['userfcmtoken'] as String?,
pin: json['pin'] as int?,
partnerid: json['partnerid'] as int?,
identificationno: json['identificationno'] as String?,
vehiclename: json['vehiclename'] as String?,
vehicleno: json['vehicleno'] as String?,
licenseno: json['licenseno'] as String?,
insoranceno: json['insoranceno'] as String?,
insurancedate: json['insurancedate'] as String?,
shiftid: json['shiftid'] as int?,
starttime: json['starttime'] as String?,
endtime: json['endtime'] as String?,
shifthours: json['shifthours'] as int?,
basefare: (json['basefare'] as num?)?.toDouble(),
additionalcharges: (json['additionalcharges'] as num?)?.toDouble(),
orders: json['orders'] as int?,
fuelcharge: (json['fuelcharge'] as num?)?.toDouble(),
logdate: json['logdate'] as String?,
applocationid: json['applocationid'] as int?,
applocation: json['applocation'] as String?,
logseconds: json['logseconds'] as int?,
riderid: json['riderid'] as int?,
status: json['status'] as String?,
tenantid: json['tenantid'] as int?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['userid'] = userid;
data['authname'] = authname;
data['configid'] = configid;
data['authmode'] = authmode;
data['roleid'] = roleid;
data['firstname'] = firstname;
data['lastname'] = lastname;
data['fullname'] = fullname;
data['password'] = password;
data['email'] = email;
data['contactno'] = contactno;
data['address'] = address;
data['suburb'] = suburb;
data['city'] = city;
data['state'] = state;
data['postcode'] = postcode;
data['userfcmtoken'] = userfcmtoken;
data['pin'] = pin;
data['partnerid'] = partnerid;
data['identificationno'] = identificationno;
data['vehiclename'] = vehiclename;
data['vehicleno'] = vehicleno;
data['licenseno'] = licenseno;
data['insoranceno'] = insoranceno;
data['insurancedate'] = insurancedate;
data['shiftid'] = shiftid;
data['starttime'] = starttime;
data['endtime'] = endtime;
data['shifthours'] = shifthours;
data['basefare'] = basefare;
data['additionalcharges'] = additionalcharges;
data['orders'] = orders;
data['fuelcharge'] = fuelcharge;
data['logdate'] = logdate;
data['applocationid'] = applocationid;
data['applocation'] = applocation;
data['logseconds'] = logseconds;
data['riderid'] = riderid;
data['status'] = status;
data['tenantid'] = tenantid;
return data;
}
}

View File

@@ -0,0 +1,285 @@
class Orders {
int? deliveryid;
int? orderheaderid;
int? applocationid;
int? configid;
int? partnerid;
int? tenantid;
int? moduleid;
int? locationid;
int? categoryid;
int? userid;
int? subcategoryid;
String? orderid;
String? deliverydate;
String? orderstatus;
String? assigntime;
String? starttime;
String? arrivaltime;
String? pickuptime;
String? deliverytime;
String? canceltime;
int? itemcount;
double? orderamount;
int? customerid;
String? pickupcustomer;
String? pickupcontactno;
String? pickupaddress;
String? pickuplocation;
int? pickuplocationid;
String? pickuplat;
String? pickuplon;
int? deliverycustomerid;
int? deliverylocationid;
String? deliverycustomer;
String? deliverycontactno;
String? deliveryaddress;
String? deliverylocation;
String? droplat;
String? droplon;
String? deliverylat;
String? deliverylong;
double? deliverycharges;
double? deliveryamt;
String? deliverytype;
String? notes;
String? ordernotes;
String? riderslat;
String? riderslon;
int? firstmilekm;
double? firstmilecharges;
double? lastmilecharges;
double? ridercharges;
String? kms;
String? actualkms;
int? paymenttype;
String? tenantname;
String? tenantcontactno;
String? tenanttoken;
String? tenantsuburb;
String? tenantcity;
String? locationname;
String? locationcontactno;
String? locationsuburb;
String? ridername;
String? userfcmtoken;
int? queueid;
int? smsdelivery;
bool startStatus;
Orders({
this.deliveryid,
this.orderheaderid,
this.applocationid,
this.configid,
this.partnerid,
this.tenantid,
this.moduleid,
this.locationid,
this.categoryid,
this.userid,
this.subcategoryid,
this.orderid,
this.deliverydate,
this.orderstatus,
this.assigntime,
this.starttime,
this.arrivaltime,
this.pickuptime,
this.deliverytime,
this.canceltime,
this.itemcount,
this.orderamount,
this.customerid,
this.pickupcustomer,
this.pickupcontactno,
this.pickupaddress,
this.pickuplocation,
this.pickuplocationid,
this.pickuplat,
this.pickuplon,
this.deliverycustomerid,
this.deliverylocationid,
this.deliverycustomer,
this.deliverycontactno,
this.deliveryaddress,
this.deliverylocation,
this.droplat,
this.droplon,
this.deliverylat,
this.deliverylong,
this.deliverycharges,
this.deliveryamt,
this.deliverytype,
this.notes,
this.ordernotes,
this.riderslat,
this.riderslon,
this.firstmilekm,
this.firstmilecharges,
this.lastmilecharges,
this.ridercharges,
this.kms,
this.actualkms,
this.paymenttype,
this.tenantname,
this.tenantcontactno,
this.tenanttoken,
this.tenantsuburb,
this.tenantcity,
this.locationname,
this.locationcontactno,
this.locationsuburb,
this.ridername,
this.userfcmtoken,
this.queueid,
this.smsdelivery,
this.startStatus = false,
});
factory Orders.fromJson(Map<String, dynamic> json) {
return Orders(
deliveryid: json['deliveryid'] as int?,
orderheaderid: json['orderheaderid'] as int?,
applocationid: json['applocationid'] as int?,
configid: json['configid'] as int?,
partnerid: json['partnerid'] as int?,
tenantid: json['tenantid'] as int?,
moduleid: json['moduleid'] as int?,
locationid: json['locationid'] as int?,
categoryid: json['categoryid'] as int?,
userid: json['userid'] as int?,
subcategoryid: json['subcategoryid'] as int?,
orderid: json['orderid'] as String?,
deliverydate: json['deliverydate'] as String?,
orderstatus: json['orderstatus'] as String?,
assigntime: json['assigntime'] as String?,
starttime: json['starttime'] as String?,
arrivaltime: json['arrivaltime'] as String?,
pickuptime: json['pickuptime'] as String?,
deliverytime: json['deliverytime'] as String?,
canceltime: json['canceltime'] as String?,
itemcount: json['itemcount'] as int?,
orderamount: (json['orderamount'] as num?)?.toDouble(),
customerid: json['customerid'] as int?,
pickupcustomer: json['pickupcustomer'] as String?,
pickupcontactno: json['pickupcontactno'] as String?,
pickupaddress: json['Pickupaddress'] as String?,
pickuplocation: json['pickuplocation'] as String?,
pickuplocationid: json['pickuplocationid'] as int?,
pickuplat: json['pickuplat'] as String?,
pickuplon: json['pickuplon'] as String?,
deliverycustomerid: json['deliverycustomerid'] as int?,
deliverylocationid: json['deliverylocationid'] as int?,
deliverycustomer: json['deliverycustomer'] as String?,
deliverycontactno: json['deliverycontactno'] as String?,
deliveryaddress: json['deliveryaddress'] as String?,
deliverylocation: json['deliverylocation'] as String?,
droplat: json['droplat'] as String?,
droplon: json['droplon'] as String?,
deliverylat: json['deliverylat'] as String?,
deliverylong: json['deliverylong'] as String?,
deliverycharges: (json['deliverycharges'] as num?)?.toDouble(),
deliveryamt: (json['deliveryamt'] as num?)?.toDouble(),
deliverytype: json['deliverytype'] as String?,
notes: json['notes'] as String?,
ordernotes: json['ordernotes'] as String?,
riderslat: json['riderslat'] as String?,
riderslon: json['riderslon'] as String?,
firstmilekm: json['firstmilekm'] as int?,
firstmilecharges: (json['firstmilecharges'] as num?)?.toDouble(),
lastmilecharges: (json['lastmilecharges'] as num?)?.toDouble(),
ridercharges: (json['ridercharges'] as num?)?.toDouble(),
kms: json['kms'] as String?,
actualkms: json['actualkms'] as String?,
paymenttype: json['paymenttype'] as int?,
tenantname: json['tenantname'] as String?,
tenantcontactno: json['tenantcontactno'] as String?,
tenanttoken: json['tenanttoken'] as String?,
tenantsuburb: json['tenantsuburb'] as String?,
tenantcity: json['tenantcity'] as String?,
locationname: json['locationname'] as String?,
locationcontactno: json['locationcontactno'] as String?,
locationsuburb: json['locationsuburb'] as String?,
ridername: json['ridername'] as String?,
userfcmtoken: json['userfcmtoken'] as String?,
queueid: json['queueid'] as int?,
smsdelivery: json['smsdelivery'] as int?,
startStatus: json['startStatus'] as bool? ?? false,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['deliveryid'] = deliveryid;
data['orderheaderid'] = orderheaderid;
data['applocationid'] = applocationid;
data['configid'] = configid;
data['partnerid'] = partnerid;
data['tenantid'] = tenantid;
data['moduleid'] = moduleid;
data['locationid'] = locationid;
data['categoryid'] = categoryid;
data['userid'] = userid;
data['subcategoryid'] = subcategoryid;
data['orderid'] = orderid;
data['deliverydate'] = deliverydate;
data['orderstatus'] = orderstatus;
data['assigntime'] = assigntime;
data['starttime'] = starttime;
data['arrivaltime'] = arrivaltime;
data['pickuptime'] = pickuptime;
data['deliverytime'] = deliverytime;
data['canceltime'] = canceltime;
data['itemcount'] = itemcount;
data['orderamount'] = orderamount;
data['customerid'] = customerid;
data['pickupcustomer'] = pickupcustomer;
data['pickupcontactno'] = pickupcontactno;
data['Pickupaddress'] = pickupaddress;
data['pickuplocation'] = pickuplocation;
data['pickuplocationid'] = pickuplocationid;
data['pickuplat'] = pickuplat;
data['pickuplon'] = pickuplon;
data['deliverycustomerid'] = deliverycustomerid;
data['deliverylocationid'] = deliverylocationid;
data['deliverycustomer'] = deliverycustomer;
data['deliverycontactno'] = deliverycontactno;
data['deliveryaddress'] = deliveryaddress;
data['deliverylocation'] = deliverylocation;
data['droplat'] = droplat;
data['droplon'] = droplon;
data['deliverylat'] = deliverylat;
data['deliverylong'] = deliverylong;
data['deliverycharges'] = deliverycharges;
data['deliveryamt'] = deliveryamt;
data['deliverytype'] = deliverytype;
data['notes'] = notes;
data['ordernotes'] = ordernotes;
data['riderslat'] = riderslat;
data['riderslon'] = riderslon;
data['firstmilekm'] = firstmilekm;
data['firstmilecharges'] = firstmilecharges;
data['lastmilecharges'] = lastmilecharges;
data['ridercharges'] = ridercharges;
data['kms'] = kms;
data['actualkms'] = actualkms;
data['paymenttype'] = paymenttype;
data['tenantname'] = tenantname;
data['tenantcontactno'] = tenantcontactno;
data['tenanttoken'] = tenanttoken;
data['tenantsuburb'] = tenantsuburb;
data['tenantcity'] = tenantcity;
data['locationname'] = locationname;
data['locationcontactno'] = locationcontactno;
data['locationsuburb'] = locationsuburb;
data['ridername'] = ridername;
data['userfcmtoken'] = userfcmtoken;
data['queueid'] = queueid;
data['smsdelivery'] = smsdelivery;
data['startStatus'] = startStatus;
return data;
}
}

View File

@@ -0,0 +1,207 @@
class ProductDetails {
int? code;
List<Product>? products;
String? message;
Pricedetails? pricedetails;
bool? status;
ProductDetails({
this.code,
this.products,
this.message,
this.pricedetails,
this.status,
});
factory ProductDetails.fromJson(Map<String, dynamic> json) {
return ProductDetails(
code: json['code'] as int?,
products: json['details'] != null
? (json['details'] as List<dynamic>)
.map((v) => Product.fromJson(v as Map<String, dynamic>))
.toList()
: null,
message: json['message'] as String?,
pricedetails: json['pricedetails'] != null
? Pricedetails.fromJson(json['pricedetails'] as Map<String, dynamic>)
: null,
status: json['status'] as bool?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['code'] = code;
if (products != null) {
data['details'] = products!.map((v) => v.toJson()).toList();
}
data['message'] = message;
if (pricedetails != null) {
data['pricedetails'] = pricedetails!.toJson();
}
data['status'] = status;
return data;
}
}
class Product {
int? orderDetailId;
int? orderHeaderId;
int? tenantId;
int? locationId;
int? productId;
String? productName;
String? productDescription;
int? supplyQty;
int? balanceQty;
int? orderQty;
int? price;
int? unitId;
String? unitName;
int? productAddonId;
int? addonTypeId;
int? productMapId;
int? productVariantId;
String? productAddonDescription;
int? discountId;
String? discountName;
String? discountCode;
String? discountTerms;
int? discountPercentage;
int? discountAmount;
int? landingAmount;
int? taxPercentage;
int? taxAmount;
int? productSumPrice;
String? itemStatus;
String? delivered;
int? orderAmount;
String? productImage;
Product({
this.orderDetailId,
this.orderHeaderId,
this.tenantId,
this.locationId,
this.productId,
this.productName,
this.productDescription,
this.supplyQty,
this.balanceQty,
this.orderQty,
this.price,
this.unitId,
this.unitName,
this.productAddonId,
this.addonTypeId,
this.productMapId,
this.productVariantId,
this.productAddonDescription,
this.discountId,
this.discountName,
this.discountCode,
this.discountTerms,
this.discountPercentage,
this.discountAmount,
this.landingAmount,
this.taxPercentage,
this.taxAmount,
this.productSumPrice,
this.itemStatus,
this.delivered,
this.orderAmount,
this.productImage,
});
factory Product.fromJson(Map<String, dynamic> json) {
return Product(
orderDetailId: json['orderdetailid'] as int?,
orderHeaderId: json['orderheaderid'] as int?,
tenantId: json['tenantid'] as int?,
locationId: json['locationid'] as int?,
productId: json['productid'] as int?,
productName: json['productname'] as String?,
productDescription: json['productdescription'] as String?,
supplyQty: json['supplyqty'] as int?,
balanceQty: json['balanceqty'] as int?,
orderQty: json['orderqty'] as int?,
price: json['price'] as int?,
unitId: json['unitid'] as int?,
unitName: json['unitname'] as String?,
productAddonId: json['productaddonid'] as int?,
addonTypeId: json['addontypeid'] as int?,
productMapId: json['productmapid'] as int?,
productVariantId: json['productvariantid'] as int?,
productAddonDescription: json['productaddondescription'] as String?,
discountId: json['discountid'] as int?,
discountName: json['discountname'] as String?,
discountCode: json['discountcode'] as String?,
discountTerms: json['discountterms'] as String?,
discountPercentage: json['discountpercentage'] as int?,
discountAmount: json['discountamount'] as int?,
landingAmount: json['landingamount'] as int?,
taxPercentage: json['taxpercentage'] as int?,
taxAmount: json['taxamount'] as int?,
productSumPrice: json['productsumprice'] as int?,
itemStatus: json['itemstatus'] as String?,
delivered: json['delivered'] as String?,
orderAmount: json['orderamount'] as int?,
productImage: json['productimage'] as String?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['orderdetailid'] = orderDetailId;
data['orderheaderid'] = orderHeaderId;
data['tenantid'] = tenantId;
data['locationid'] = locationId;
data['productid'] = productId;
data['productname'] = productName;
data['productdescription'] = productDescription;
data['supplyqty'] = supplyQty;
data['balanceqty'] = balanceQty;
data['orderqty'] = orderQty;
data['price'] = price;
data['unitid'] = unitId;
data['unitname'] = unitName;
data['productaddonid'] = productAddonId;
data['addontypeid'] = addonTypeId;
data['productmapid'] = productMapId;
data['productvariantid'] = productVariantId;
data['productaddondescription'] = productAddonDescription;
data['discountid'] = discountId;
data['discountname'] = discountName;
data['discountcode'] = discountCode;
data['discountterms'] = discountTerms;
data['discountpercentage'] = discountPercentage;
data['discountamount'] = discountAmount;
data['landingamount'] = landingAmount;
data['taxpercentage'] = taxPercentage;
data['taxamount'] = taxAmount;
data['productsumprice'] = productSumPrice;
data['itemstatus'] = itemStatus;
data['delivered'] = delivered;
data['orderamount'] = orderAmount;
data['productimage'] = productImage;
return data;
}
}
class Pricedetails {
int? orderAmount;
Pricedetails({this.orderAmount});
factory Pricedetails.fromJson(Map<String, dynamic> json) {
return Pricedetails(
orderAmount: json['orderamount'] as int?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['orderamount'] = orderAmount;
return data;
}
}

View File

@@ -0,0 +1,78 @@
class Tenant {
int? code;
TenantDetails? details;
String? message;
bool? status;
Tenant({this.code, this.details, this.message, this.status});
factory Tenant.fromJson(Map<String, dynamic> json) {
return Tenant(
code: json['code'] as int?,
details: json['details'] != null
? TenantDetails.fromJson(json['details'] as Map<String, dynamic>)
: null,
message: json['message'] as String?,
status: json['status'] as bool?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['code'] = code;
if (details != null) {
data['details'] = details!.toJson();
}
data['message'] = message;
data['status'] = status;
return data;
}
}
class TenantDetails {
int? pricingId;
int? tenantId;
int? locationId;
String? pricingDate;
int? basePrice;
int? pricePerKm;
int? minKm;
int? otherCharges;
TenantDetails({
this.pricingId,
this.tenantId,
this.locationId,
this.pricingDate,
this.basePrice,
this.pricePerKm,
this.minKm,
this.otherCharges,
});
factory TenantDetails.fromJson(Map<String, dynamic> json) {
return TenantDetails(
pricingId: json['pricingid'] as int?,
tenantId: json['tenantid'] as int?,
locationId: json['locationid'] as int?,
pricingDate: json['pricingdate'] as String?,
basePrice: json['baseprice'] as int?,
pricePerKm: json['priceperkm'] as int?,
minKm: json['minkm'] as int?,
otherCharges: json['othercharges'] as int?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['pricingid'] = pricingId;
data['tenantid'] = tenantId;
data['locationid'] = locationId;
data['pricingdate'] = pricingDate;
data['baseprice'] = basePrice;
data['priceperkm'] = pricePerKm;
data['minkm'] = minKm;
data['othercharges'] = otherCharges;
return data;
}
}

131
lib/Models/User/User.dart Normal file
View File

@@ -0,0 +1,131 @@
class User {
int? userid;
String? authname;
int? configid;
int? authmode;
int? roleid;
String? firstname;
String? lastname;
String? password;
String? email;
String? contactno;
String? address;
String? suburb;
String? city;
String? state;
String? postcode;
String? userfcmtoken;
int? pin;
int? partnerid;
int? tenantid;
String? fullname;
String? tenantname;
String? tenantaddress;
String? tenantcity;
String? tenantpostcode;
String? tenantlat;
String? tenantlong;
int? locationid;
String? locationname;
int? applocationid;
User({
this.userid,
this.authname,
this.configid,
this.authmode,
this.roleid,
this.firstname,
this.lastname,
this.password,
this.email,
this.contactno,
this.address,
this.suburb,
this.city,
this.state,
this.postcode,
this.userfcmtoken,
this.pin,
this.partnerid,
this.tenantid,
this.fullname,
this.tenantname,
this.tenantaddress,
this.tenantcity,
this.tenantpostcode,
this.tenantlat,
this.tenantlong,
this.locationid,
this.locationname,
this.applocationid,
});
factory User.fromJson(Map<String, dynamic> json) {
return User(
userid: json['userid'] as int?,
authname: json['authname'] as String?,
configid: json['configid'] as int?,
authmode: json['authmode'] as int?,
roleid: json['roleid'] as int?,
firstname: json['firstname'] as String?,
lastname: json['lastname'] as String?,
password: json['password'] as String?,
email: json['email'] as String?,
contactno: json['contactno'] as String?,
address: json['address'] as String?,
suburb: json['suburb'] as String?,
city: json['city'] as String?,
state: json['state'] as String?,
postcode: json['postcode'] as String?,
userfcmtoken: json['userfcmtoken'] as String?,
pin: json['pin'] as int?,
partnerid: json['partnerid'] as int?,
tenantid: json['tenantid'] as int?,
fullname: json['fullname'] as String?,
tenantname: json['tenantname'] as String?,
tenantaddress: json['tenantaddress'] as String?,
tenantcity: json['tenantcity'] as String?,
tenantpostcode: json['tenantpostcode'] as String?,
tenantlat: json['tenantlat'] as String?,
tenantlong: json['tenantlong'] as String?,
locationid: json['locationid'] as int?,
locationname: json['locationname'] as String?,
applocationid: json['applocationid'] as int?,
);
}
Map<String, dynamic> toJson() => {
'userid': userid,
'authname': authname,
'configid': configid,
'authmode': authmode,
'roleid': roleid,
'firstname': firstname,
'lastname': lastname,
'password': password,
'email': email,
'contactno': contactno,
'address': address,
'suburb': suburb,
'city': city,
'state': state,
'postcode': postcode,
'userfcmtoken': userfcmtoken,
'pin': pin,
'partnerid': partnerid,
'tenantid': tenantid,
'fullname': fullname,
'tenantname': tenantname,
'tenantaddress': tenantaddress,
'tenantcity': tenantcity,
'tenantpostcode': tenantpostcode,
'tenantlat': tenantlat,
'tenantlong': tenantlong,
'locationid': locationid,
'locationname': locationname,
'applocationid': applocationid,
};
}

View File

@@ -0,0 +1,315 @@
// Consolidated deliveries models
class DeliveryUpdate {
int? deliveryid;
int? orderheaderid;
int? deliverylocationid;
int? pickuplocationid;
int? smsdelivery;
String? orderstatus;
String? starttime;
String? arrivaltime;
String? pickuptime;
String? deliverytime;
String? canceltime;
String? riderslat;
String? riderslon;
String? pickuplat;
String? pickuplong;
String? deliverylat;
String? deliverylong;
String? address;
String? city;
String? state;
String? suburb;
String? postcode;
String? kms;
String? riderkms;
String? actualkms;
double? deliveryamt;
String? notes;
String? deliverytype;
String? kmcal;
String? feedback;
DeliveryUpdate({
this.deliveryid,
this.orderheaderid,
this.deliverylocationid,
this.pickuplocationid,
this.smsdelivery,
this.orderstatus,
this.starttime,
this.arrivaltime,
this.pickuptime,
this.deliverytime,
this.canceltime,
this.riderslat,
this.riderslon,
this.pickuplat,
this.pickuplong,
this.deliverylat,
this.deliverylong,
this.address,
this.city,
this.state,
this.suburb,
this.postcode,
this.kms,
this.riderkms,
this.actualkms,
this.deliveryamt,
this.notes,
this.deliverytype,
this.kmcal,
this.feedback,
});
factory DeliveryUpdate.fromJson(Map<String, dynamic> json) {
return DeliveryUpdate(
deliveryid: json['deliveryid'],
orderheaderid: json['orderheaderid'],
deliverylocationid: json['deliverylocationid'],
pickuplocationid: json['pickuplocationid'],
smsdelivery: json['smsdelivery'],
orderstatus: json['orderstatus'],
starttime: json['starttime'],
arrivaltime: json['arrivaltime'],
pickuptime: json['pickuptime'],
deliverytime: json['deliverytime'],
canceltime: json['canceltime'],
riderslat: json['riderslat'],
riderslon: json['riderslon'],
pickuplat: json['pickuplat'],
pickuplong: json['pickuplong'],
deliverylat: json['deliverylat'],
deliverylong: json['deliverylong'],
address: json['address'],
city: json['city'],
state: json['state'],
suburb: json['suburb'],
postcode: json['postcode'],
kms: json['kms'],
riderkms: json['riderkms'],
actualkms: json['actualkms'],
deliveryamt: (json['deliveryamt'] as num?)?.toDouble(),
notes: json['notes'],
deliverytype: json['deliverytype'],
kmcal: json['kmcal'],
feedback: json['feedback'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['deliveryid'] = deliveryid;
data['orderheaderid'] = orderheaderid;
data['deliverylocationid'] = deliverylocationid;
data['pickuplocationid'] = pickuplocationid;
data['smsdelivery'] = smsdelivery;
data['orderstatus'] = orderstatus;
data['starttime'] = starttime;
data['arrivaltime'] = arrivaltime;
data['pickuptime'] = pickuptime;
data['deliverytime'] = deliverytime;
data['canceltime'] = canceltime;
data['riderslat'] = riderslat;
data['riderslon'] = riderslon;
data['pickuplat'] = pickuplat;
data['pickuplong'] = pickuplong;
data['deliverylat'] = deliverylat;
data['deliverylong'] = deliverylong;
data['address'] = address;
data['city'] = city;
data['state'] = state;
data['suburb'] = suburb;
data['postcode'] = postcode;
data['kms'] = kms;
data['riderkms'] = riderkms;
data['actualkms'] = actualkms;
data['deliveryamt'] = deliveryamt;
data['notes'] = notes;
data['deliverytype'] = deliverytype;
data['kmcal'] = kmcal;
data['feedback'] = feedback;
return data;
}
}
class DeliveryLogModel {
int? logid;
int? tenantid;
int? partnerid;
int? locationid;
int? orderheaderid;
int? deliveryid;
int? userid;
String? orderid;
String? logdate;
String? orderstatus;
String? latitude;
String? longitude;
DeliveryLogModel({
this.logid,
this.tenantid,
this.partnerid,
this.locationid,
this.orderheaderid,
this.deliveryid,
this.userid,
this.orderid,
this.logdate,
this.orderstatus,
this.latitude,
this.longitude,
});
factory DeliveryLogModel.fromJson(Map<String, dynamic> json) {
return DeliveryLogModel(
logid: json['logid'],
tenantid: json['tenantid'],
partnerid: json['Partnerid'] ?? json['partnerid'],
locationid: json['Locationid'] ?? json['locationid'],
orderheaderid: json['orderheaderid'],
deliveryid: json['deliveryid'],
userid: json['userid'],
orderid: json['orderid'],
logdate: json['logdate'],
orderstatus: json['orderstatus'],
latitude: json['latitude'],
longitude: json['longitude'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['logid'] = logid;
data['tenantid'] = tenantid;
data['Partnerid'] = partnerid;
data['Locationid'] = locationid;
data['orderheaderid'] = orderheaderid;
data['deliveryid'] = deliveryid;
data['userid'] = userid;
data['orderid'] = orderid;
data['logdate'] = logdate;
data['orderstatus'] = orderstatus;
data['latitude'] = latitude;
data['longitude'] = longitude;
return data;
}
}
class DeliverySummaryModel {
int? total;
int? created;
int? pending;
int? accepted;
int? picked;
int? delivered;
int? cancelled;
DeliverySummaryModel({
this.total,
this.created,
this.pending,
this.accepted,
this.picked,
this.delivered,
this.cancelled,
});
factory DeliverySummaryModel.fromJson(Map<String, dynamic> json) {
return DeliverySummaryModel(
total: json['total'],
created: json['created'],
pending: json['pending'],
accepted: json['accepted'],
picked: json['picked'],
delivered: json['delivered'],
cancelled: json['cancelled'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['total'] = total;
data['created'] = created;
data['pending'] = pending;
data['accepted'] = accepted;
data['picked'] = picked;
data['delivered'] = delivered;
data['cancelled'] = cancelled;
return data;
}
}
class DeliveryItem {
int? logid;
String? logdate;
int? tenantid;
int? locationid;
int? orderheaderid;
int? deliveryid;
int? userid;
int? partnerid;
String? orderid;
String? orderstatus;
String? latitude;
String? longitude;
int? logstatus;
DeliveryItem({
this.logid,
this.logdate,
this.tenantid,
this.locationid,
this.orderheaderid,
this.deliveryid,
this.userid,
this.partnerid,
this.orderid,
this.orderstatus,
this.latitude,
this.longitude,
this.logstatus,
});
factory DeliveryItem.fromJson(Map<String, dynamic> json) {
return DeliveryItem(
logid: json['logid'],
logdate: json['logdate'],
tenantid: json['tenantid'],
locationid: json['locationid'],
orderheaderid: json['orderheaderid'],
deliveryid: json['deliveryid'],
userid: json['userid'],
partnerid: json['partnerid'],
orderid: json['orderid'],
orderstatus: json['orderstatus'],
latitude: json['latitude'],
longitude: json['longitude'],
logstatus: json['logstatus'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['logid'] = logid;
data['logdate'] = logdate;
data['tenantid'] = tenantid;
data['locationid'] = locationid;
data['orderheaderid'] = orderheaderid;
data['deliveryid'] = deliveryid;
data['userid'] = userid;
data['partnerid'] = partnerid;
data['orderid'] = orderid;
data['orderstatus'] = orderstatus;
data['latitude'] = latitude;
data['longitude'] = longitude;
data['logstatus'] = logstatus;
return data;
}
}

136
lib/Models/login/login.dart Normal file
View File

@@ -0,0 +1,136 @@
class Login {
int? code;
String? message;
bool? status;
int? userid;
String? contactno;
String? devicetype;
int? configid;
String? deviceid;
String? userfcmtoken;
String? authname;
int? authmode;
int? roleid;
String? firstname;
String? lastname;
String? fullname;
String? password;
String? email;
String? address;
String? suburb;
String? city;
String? state;
String? postcode;
int? pin;
int? shiftid;
int? logid;
int? partnerid;
int? tenantid;
int? riderid;
int? deliveryradius;
int? locationid;
int? applocationid;
Login({
this.code,
this.message,
this.status,
this.userid,
this.contactno,
this.devicetype,
this.configid,
this.deviceid,
this.userfcmtoken,
this.authname,
this.authmode,
this.roleid,
this.firstname,
this.lastname,
this.fullname,
this.password,
this.email,
this.address,
this.suburb,
this.city,
this.state,
this.postcode,
this.pin,
this.shiftid,
this.logid,
this.partnerid,
this.tenantid,
this.riderid,
this.deliveryradius,
this.locationid,
this.applocationid,
});
/// Factory: builds a Login model from JSON (supports both "data" and "details")
factory Login.fromJson(Map<String, dynamic> json) {
// Safely extract nested data from either "data" or "details"
final Map<String, dynamic> nested =
(json['details'] ?? json['data'] ?? <String, dynamic>{});
final dynamic topAuthMode = json['authmode'];
final dynamic nestedAuthMode = nested['authmode'];
return Login(
code: json['code'] is int
? json['code']
: int.tryParse('${json['code']}'),
message: json['message']?.toString(),
status: json['status'] is bool ? json['status'] : json['status'] == 1,
userid: json['userid'] ?? nested['userid'],
contactno:
json['contactno']?.toString() ?? nested['contactno']?.toString(),
devicetype: json['devicetype']?.toString(),
configid: json['configid'] ?? nested['configid'],
deviceid: json['deviceid']?.toString(),
userfcmtoken:
json['userfcmtoken']?.toString() ?? nested['userfcmtoken']?.toString(),
authname: (json['authname'] ?? nested['authname'])?.toString(),
authmode: topAuthMode is int
? topAuthMode
: (nestedAuthMode is int
? nestedAuthMode
: int.tryParse('$topAuthMode')),
roleid: nested['roleid'],
firstname: nested['firstname']?.toString(),
lastname: nested['lastname']?.toString(),
fullname: nested['fullname']?.toString(),
password: nested['password']?.toString(),
email: nested['email']?.toString(),
address: nested['address']?.toString(),
suburb: nested['suburb']?.toString(),
city: nested['city']?.toString(),
state: nested['state']?.toString(),
postcode: nested['postcode']?.toString(),
pin: nested['pin'],
shiftid: nested['shiftid'],
logid: nested['logid'],
partnerid: nested['partnerid'],
tenantid: nested['tenantid'],
riderid: nested['riderid'],
deliveryradius: nested['deliveryradius'],
locationid: nested['locationid'] is int
? nested['locationid']
: int.tryParse('${nested['locationid'] ?? 0}'),
applocationid: nested['applocationid'] is int
? nested['applocationid']
: int.tryParse('${nested['applocationid'] ?? 0}'),
);
}
/// Convert this model to JSON for sending to the backend
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (contactno != null) data['contactno'] = contactno;
if (devicetype != null) data['devicetype'] = devicetype;
if (configid != null) data['configid'] = configid;
if (deviceid != null) data['deviceid'] = deviceid;
if (userfcmtoken != null) data['userfcmtoken'] = userfcmtoken;
if (pin != null) data['pin'] = pin;
return data;
}
}

View File

@@ -0,0 +1,139 @@
// Consolidated notification models
class AdminNotification {
String? priority;
List<String>? registrationIds;
String? accessid;
String? title;
String? body;
String? sound;
AdminNotification({
this.priority,
this.registrationIds,
this.accessid,
this.title,
this.body,
this.sound,
});
factory AdminNotification.fromJson(Map<String, dynamic> json) {
return AdminNotification(
priority: json['priority'] as String?,
registrationIds: json['registration_ids']?.cast<String>(),
accessid: json['data']?['accessid'] as String?,
title: json['notification']?['title'] as String?,
body: json['notification']?['body'] as String?,
sound: json['notification']?['sound'] as String?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['priority'] = priority;
data['registration_ids'] = registrationIds;
if (accessid != null) {
data['data'] = <String, dynamic>{'accessid': accessid};
}
if (title != null || body != null || sound != null) {
data['notification'] = <String, dynamic>{
if (title != null) 'title': title,
if (body != null) 'body': body,
if (sound != null) 'sound': sound,
};
}
return data;
}
}
class NotificationMessage {
String? sender;
String? accessid;
String? priority;
String? to;
String? title;
String? body;
String? sound;
NotificationMessage({
this.sender,
this.accessid,
this.priority,
this.to,
this.title,
this.body,
this.sound,
});
factory NotificationMessage.fromJson(Map<String, dynamic> json) {
return NotificationMessage(
sender: json['sender'] as String?,
accessid: json['accessid'] as String?,
priority: json['notification']?['priority'] as String?,
to: json['notification']?['to'] as String?,
title: json['notification']?['notification']?['title'] as String?,
body: json['notification']?['notification']?['body'] as String?,
sound: json['notification']?['notification']?['sound'] as String?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['sender'] = sender;
data['accessid'] = accessid;
if (priority != null || to != null || title != null || body != null || sound != null) {
data['notification'] = <String, dynamic>{
if (priority != null) 'priority': priority,
if (to != null) 'to': to,
if (title != null || body != null || sound != null) 'notification': <String, dynamic>{
if (title != null) 'title': title,
if (body != null) 'body': body,
if (sound != null) 'sound': sound,
},
};
}
return data;
}
}
class RiderNotification {
String? token;
String? title;
String? body;
String? sound;
String? image;
RiderNotification({
this.token,
this.title,
this.body,
this.sound,
this.image,
});
factory RiderNotification.fromJson(Map<String, dynamic> json) {
return RiderNotification(
token: json['token'] as String?,
title: json['notification']?['title'] as String?,
body: json['notification']?['body'] as String?,
sound: json['notification']?['sound'] as String?,
image: json['notification']?['image'] as String?,
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['token'] = token;
if (title != null || body != null || sound != null || image != null) {
data['notification'] = <String, dynamic>{
if (title != null) 'title': title,
if (body != null) 'body': body,
if (sound != null) 'sound': sound,
if (image != null) 'image': image,
};
}
return data;
}
}

View File

@@ -0,0 +1,289 @@
// Consolidated riders models
class RiderLog {
int? logid;
String? logdate;
int? userid;
int? partnerid;
int? shiftid;
double? shifthours;
String? login;
String? latitude;
double? workhours;
double? shorthours;
int? logstatus;
String? longitude;
double? breakhours;
int? onduty;
int? tenantid;
int? locationid;
int? applocationid;
String? userfcmtoken;
RiderLog({
this.logid,
this.logdate,
this.userid,
this.partnerid,
this.shiftid,
this.shifthours,
this.login,
this.latitude,
this.workhours,
this.shorthours,
this.logstatus,
this.longitude,
this.breakhours,
this.onduty,
this.tenantid,
this.locationid,
this.applocationid,
this.userfcmtoken,
});
factory RiderLog.fromJson(Map<String, dynamic> json) {
return RiderLog(
logid: json['logid'],
logdate: json['logdate'],
userid: json['userid'],
partnerid: json['partnerid'],
shiftid: json['shiftid'],
shifthours: (json['shifthours'] as num?)?.toDouble(),
login: json['login'],
latitude: json['latitude'],
workhours: (json['workhours'] as num?)?.toDouble(),
shorthours: (json['shorthours'] as num?)?.toDouble(),
logstatus: json['logstatus'],
longitude: json['longitude'],
breakhours: (json['breakhours'] as num?)?.toDouble(),
onduty: json['onduty'],
tenantid: json['tenantid'],
locationid: json['locationid'],
applocationid: json['applocationid'],
userfcmtoken: json['userfcmtoken'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['logid'] = logid;
data['logdate'] = logdate;
data['userid'] = userid;
data['partnerid'] = partnerid;
data['shiftid'] = shiftid;
data['shifthours'] = shifthours;
data['login'] = login;
data['latitude'] = latitude;
data['workhours'] = workhours;
data['shorthours'] = shorthours;
data['logstatus'] = logstatus;
data['longitude'] = longitude;
data['breakhours'] = breakhours;
data['onduty'] = onduty;
data['tenantid'] = tenantid;
data['locationid'] = locationid;
data['applocationid'] = applocationid;
data['userfcmtoken'] = userfcmtoken;
return data;
}
}
class RiderBreak {
int? breakid;
int? logid;
String? breakdate;
int? userid;
int? partnerid;
int? shiftid;
String? breakstart;
String? breakend;
double? breakhours;
String? latitude;
String? longitude;
RiderBreak({
this.breakid,
this.logid,
this.breakdate,
this.userid,
this.partnerid,
this.shiftid,
this.breakstart,
this.breakend,
this.breakhours,
this.latitude,
this.longitude,
});
factory RiderBreak.fromJson(Map<String, dynamic> json) {
return RiderBreak(
breakid: json['breakid'],
logid: json['logid'],
breakdate: json['breakdate'],
userid: json['userid'],
partnerid: json['partnerid'],
shiftid: json['shiftid'],
breakstart: json['breakstart'],
breakend: json['breakend'],
breakhours: (json['breakhours'] as num?)?.toDouble(),
latitude: json['latitude'],
longitude: json['longitude'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['breakid'] = breakid;
data['logid'] = logid;
data['breakdate'] = breakdate;
data['userid'] = userid;
data['partnerid'] = partnerid;
data['shiftid'] = shiftid;
data['breakstart'] = breakstart;
data['breakend'] = breakend;
data['breakhours'] = breakhours;
data['latitude'] = latitude;
data['longitude'] = longitude;
return data;
}
}
class RiderLogin {
int? logid;
int? userid;
int? partnerid;
int? shiftid;
String? logdate;
String? login;
double? shifthours;
String? latitude;
String? longitude;
int? onduty;
String? status; // "active" when there are active deliveries, "idle" otherwise
String? username; // Rider display name for rider logs
String? contactno;
int? tenantid;
int? locationid;
int? applocationid;
String? userfcmtoken;
RiderLogin({
this.logid,
this.userid,
this.partnerid,
this.shiftid,
this.logdate,
this.login,
this.shifthours,
this.latitude,
this.longitude,
this.onduty,
this.status,
this.username,
this.contactno,
this.tenantid,
this.locationid,
this.applocationid,
this.userfcmtoken,
});
factory RiderLogin.fromJson(Map<String, dynamic> json) {
return RiderLogin(
logid: json['logid'],
userid: json['userid'],
partnerid: json['partnerid'],
shiftid: json['shiftid'],
logdate: json['logdate'],
login: json['Login'] ?? json['login'],
shifthours: (json['shifthours'] as num?)?.toDouble(),
latitude: json['latitude'],
longitude: json['longitude'],
onduty: json['onduty'],
status: json['status'],
username: json['username'],
contactno: json['contactno'],
tenantid: json['tenantid'],
locationid: json['locationid'],
applocationid: json['applocationid'],
userfcmtoken: json['userfcmtoken'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['logid'] = logid;
data['userid'] = userid;
data['partnerid'] = partnerid;
data['shiftid'] = shiftid;
data['logdate'] = logdate;
data['Login'] = login;
data['shifthours'] = shifthours;
data['latitude'] = latitude;
data['longitude'] = longitude;
if (onduty != null) data['onduty'] = onduty;
if (status != null) data['status'] = status;
if (username != null && username!.trim().isNotEmpty) {
data['username'] = username;
}
if (contactno != null) {
data['contactno'] = contactno;
}
data['tenantid'] = tenantid;
data['locationid'] = locationid;
data['applocationid'] = applocationid;
data['userfcmtoken'] = userfcmtoken;
return data;
}
}
class RiderUpdate {
int? userid;
int? logstatus;
String? logout;
double? workhours;
double? shorthours;
String? latitude;
String? longitude;
int? onduty;
RiderUpdate({
this.userid,
this.logstatus,
this.logout,
this.workhours,
this.shorthours,
this.latitude,
this.longitude,
this.onduty,
});
factory RiderUpdate.fromJson(Map<String, dynamic> json) {
return RiderUpdate(
userid: json['userid'],
logstatus: json['logstatus'],
logout: json['Logout'] ?? json['logout'],
workhours: (json['workhours'] as num?)?.toDouble(),
shorthours: (json['shorthours'] as num?)?.toDouble(),
latitude: json['latitude'],
longitude: json['longitude'],
onduty: json['onduty'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['userid'] = userid;
data['logstatus'] = logstatus;
data['Logout'] = logout;
data['workhours'] = workhours;
data['shorthours'] = shorthours;
data['latitude'] = latitude;
data['longitude'] = longitude;
if (onduty != null) data['onduty'] = onduty;
return data;
}
}

View File

@@ -0,0 +1,27 @@
class DeliveryStats {
final int today;
final int week;
final int month;
final int total;
final int cancelled;
DeliveryStats({
required this.today,
required this.week,
required this.month,
required this.total,
required this.cancelled,
});
factory DeliveryStats.fromJson(Map<String, dynamic> json) {
return DeliveryStats(
today: json['today'] ?? 0,
week: json['week'] ?? 0,
month: json['month'] ?? 0,
total: json['total'] ?? 0,
cancelled: json['cancelled'] ?? 0,
);
}
}

View File

@@ -0,0 +1,49 @@
class RiderWeeklyKms {
final String day;
final double kms;
RiderWeeklyKms({
required this.day,
required this.kms,
});
factory RiderWeeklyKms.fromJson(Map<String, dynamic> json) {
return RiderWeeklyKms(
day: json['day'] ?? '',
kms: double.tryParse('${json['kms'] ?? 0}') ?? 0.0,
);
}
}
class RiderWeeklyKmsResponse {
final bool status;
final int code;
final String message;
final double totalKms;
final double overallKms;
final List<RiderWeeklyKms> details;
RiderWeeklyKmsResponse({
required this.status,
required this.code,
required this.message,
required this.totalKms,
required this.overallKms,
required this.details,
});
factory RiderWeeklyKmsResponse.fromJson(Map<String, dynamic> json) {
return RiderWeeklyKmsResponse(
status: json['status'] ?? false,
code: json['code'] ?? 0,
message: json['message'] ?? '',
totalKms: double.tryParse('${json['total_kms'] ?? 0}') ?? 0.0,
overallKms: double.tryParse('${json['overall_kms'] ?? 0}') ?? 0.0,
details: (json['details'] as List<dynamic>? ?? [])
.map((e) => RiderWeeklyKms.fromJson(e))
.toList(),
);
}
}

View File

@@ -0,0 +1,37 @@
class SupportTicketModel {
final int ridersupportid;
final int userid;
final String category;
final String priority;
final String subject;
final String issue;
final String? image;
final DateTime created;
final DateTime updated;
SupportTicketModel({
required this.ridersupportid,
required this.userid,
required this.category,
required this.priority,
required this.subject,
required this.issue,
this.image,
required this.created,
required this.updated,
});
factory SupportTicketModel.fromJson(Map<String, dynamic> json) {
return SupportTicketModel(
ridersupportid: json['ridersupportid'] as int,
userid: json['userid'] as int,
category: json['category'] as String,
priority: json['priority'] as String,
subject: json['subject'] as String,
issue: json['issue'] as String,
image: json['image'] as String?,
created: DateTime.parse(json['created'] as String),
updated: DateTime.parse(json['updated'] as String),
);
}
}