Initial commit
This commit is contained in:
21
lib/models/admin_commission.dart
Normal file
21
lib/models/admin_commission.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
class AdminCommission {
|
||||
String? amount;
|
||||
bool? isEnabled;
|
||||
String? commissionType;
|
||||
|
||||
AdminCommission({this.amount, this.isEnabled, this.commissionType});
|
||||
|
||||
AdminCommission.fromJson(Map<String, dynamic> json) {
|
||||
amount = json['fix_commission'].toString();
|
||||
isEnabled = json['isEnabled'];
|
||||
commissionType = json['commissionType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['fix_commission'] = amount;
|
||||
data['isEnabled'] = isEnabled;
|
||||
data['commissionType'] = commissionType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
192
lib/models/cab_order_model.dart
Normal file
192
lib/models/cab_order_model.dart
Normal file
@@ -0,0 +1,192 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:driver/models/tax_model.dart';
|
||||
import 'package:driver/models/user_model.dart';
|
||||
import 'package:driver/models/vehicle_type.dart';
|
||||
|
||||
class CabOrderModel {
|
||||
String? status;
|
||||
List<dynamic>? rejectedByDrivers;
|
||||
String? couponId;
|
||||
Timestamp? scheduleDateTime;
|
||||
String? duration;
|
||||
bool? roundTrip;
|
||||
bool? paymentStatus;
|
||||
String? discount;
|
||||
String? destinationLocationName;
|
||||
String? authorID;
|
||||
Timestamp? createdAt;
|
||||
DestinationLocation? destinationLocation;
|
||||
String? adminCommissionType;
|
||||
String? sourceLocationName;
|
||||
String? rideType;
|
||||
List<TaxModel>? taxSetting;
|
||||
Timestamp? triggerDelevery;
|
||||
String? id;
|
||||
String? adminCommission;
|
||||
String? couponCode;
|
||||
Timestamp? scheduleReturnDateTime;
|
||||
String? sectionId;
|
||||
String? tipAmount;
|
||||
String? distance;
|
||||
String? vehicleId;
|
||||
String? paymentMethod;
|
||||
VehicleType? vehicleType;
|
||||
String? otpCode;
|
||||
DestinationLocation? sourceLocation;
|
||||
UserModel? author;
|
||||
UserModel? driver;
|
||||
String? driverId;
|
||||
String? subTotal;
|
||||
|
||||
CabOrderModel({
|
||||
this.status,
|
||||
this.rejectedByDrivers,
|
||||
this.couponId,
|
||||
this.scheduleDateTime,
|
||||
this.duration,
|
||||
this.roundTrip,
|
||||
this.paymentStatus,
|
||||
this.discount,
|
||||
this.destinationLocationName,
|
||||
this.authorID,
|
||||
this.createdAt,
|
||||
this.destinationLocation,
|
||||
this.adminCommissionType,
|
||||
this.sourceLocationName,
|
||||
this.rideType,
|
||||
this.taxSetting,
|
||||
this.triggerDelevery,
|
||||
this.id,
|
||||
this.adminCommission,
|
||||
this.couponCode,
|
||||
this.scheduleReturnDateTime,
|
||||
this.sectionId,
|
||||
this.tipAmount,
|
||||
this.distance,
|
||||
this.vehicleId,
|
||||
this.paymentMethod,
|
||||
this.vehicleType,
|
||||
this.otpCode,
|
||||
this.sourceLocation,
|
||||
this.author,
|
||||
this.subTotal,
|
||||
this.driver,
|
||||
this.driverId,
|
||||
});
|
||||
|
||||
CabOrderModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
rejectedByDrivers = json['rejectedByDrivers'] ?? [];
|
||||
couponId = json['couponId'];
|
||||
scheduleDateTime = json['scheduleDateTime'];
|
||||
duration = json['duration'];
|
||||
roundTrip = json['roundTrip'];
|
||||
paymentStatus = json['paymentStatus'];
|
||||
discount = json['discount'];
|
||||
destinationLocationName = json['destinationLocationName'];
|
||||
authorID = json['authorID'];
|
||||
createdAt = json['createdAt'];
|
||||
destinationLocation = json['destinationLocation'] != null ? DestinationLocation.fromJson(json['destinationLocation']) : null;
|
||||
adminCommissionType = json['adminCommissionType'];
|
||||
sourceLocationName = json['sourceLocationName'];
|
||||
rideType = json['rideType'];
|
||||
if (json['taxSetting'] != null) {
|
||||
taxSetting = <TaxModel>[];
|
||||
json['taxSetting'].forEach((v) {
|
||||
taxSetting!.add(TaxModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
triggerDelevery = json['trigger_delevery'];
|
||||
id = json['id'];
|
||||
adminCommission = json['adminCommission'];
|
||||
couponCode = json['couponCode'];
|
||||
scheduleReturnDateTime = json['scheduleReturnDateTime'];
|
||||
sectionId = json['sectionId'];
|
||||
tipAmount = json['tip_amount'];
|
||||
distance = json['distance'];
|
||||
vehicleId = json['vehicleId'];
|
||||
paymentMethod = json['paymentMethod'];
|
||||
vehicleType = json['vehicleType'] != null ? VehicleType.fromJson(json['vehicleType']) : null;
|
||||
otpCode = json['otpCode'];
|
||||
sourceLocation = json['sourceLocation'] != null ? DestinationLocation.fromJson(json['sourceLocation']) : null;
|
||||
author = json['author'] != null ? UserModel.fromJson(json['author']) : null;
|
||||
subTotal = json['subTotal'];
|
||||
driver = json['driver'] != null ? UserModel.fromJson(json['driver']) : null;
|
||||
driverId = json['driverId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
// if (rejectedByDrivers != null) {
|
||||
// data['rejectedByDrivers'] = rejectedByDrivers!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
if (rejectedByDrivers != null) {
|
||||
data['rejectedByDrivers'] = rejectedByDrivers!;
|
||||
}
|
||||
data['couponId'] = couponId;
|
||||
data['scheduleDateTime'] = scheduleDateTime!;
|
||||
data['duration'] = duration;
|
||||
data['roundTrip'] = roundTrip;
|
||||
data['paymentStatus'] = paymentStatus;
|
||||
data['discount'] = discount;
|
||||
data['destinationLocationName'] = destinationLocationName;
|
||||
data['authorID'] = authorID;
|
||||
data['createdAt'] = createdAt;
|
||||
if (destinationLocation != null) {
|
||||
data['destinationLocation'] = destinationLocation!.toJson();
|
||||
}
|
||||
data['adminCommissionType'] = adminCommissionType;
|
||||
data['sourceLocationName'] = sourceLocationName;
|
||||
data['rideType'] = rideType;
|
||||
if (taxSetting != null) {
|
||||
data['taxSetting'] = taxSetting!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['trigger_delevery'] = triggerDelevery!;
|
||||
data['id'] = id;
|
||||
data['adminCommission'] = adminCommission;
|
||||
data['couponCode'] = couponCode;
|
||||
data['scheduleReturnDateTime'] = scheduleReturnDateTime;
|
||||
data['sectionId'] = sectionId;
|
||||
data['tip_amount'] = tipAmount;
|
||||
data['distance'] = distance;
|
||||
data['vehicleId'] = vehicleId;
|
||||
data['paymentMethod'] = paymentMethod;
|
||||
data['driverId'] = driverId;
|
||||
if (driver != null) {
|
||||
data['driver'] = driver!.toJson();
|
||||
}
|
||||
|
||||
if (vehicleType != null) {
|
||||
data['vehicleType'] = vehicleType!.toJson();
|
||||
}
|
||||
data['otpCode'] = otpCode;
|
||||
if (sourceLocation != null) {
|
||||
data['sourceLocation'] = sourceLocation!.toJson();
|
||||
}
|
||||
if (author != null) {
|
||||
data['author'] = author!.toJson();
|
||||
}
|
||||
data['subTotal'] = subTotal;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DestinationLocation {
|
||||
double? longitude;
|
||||
double? latitude;
|
||||
|
||||
DestinationLocation({this.longitude, this.latitude});
|
||||
|
||||
DestinationLocation.fromJson(Map<String, dynamic> json) {
|
||||
longitude = json['longitude'];
|
||||
latitude = json['latitude'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['longitude'] = longitude;
|
||||
data['latitude'] = latitude;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
21
lib/models/car_makes.dart
Normal file
21
lib/models/car_makes.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
class CarMakes {
|
||||
String? name;
|
||||
String? id;
|
||||
bool? isActive;
|
||||
|
||||
CarMakes({this.name, this.id, this.isActive});
|
||||
|
||||
CarMakes.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'] ?? '';
|
||||
id = json['id'] ?? '';
|
||||
isActive = json['isActive'] ?? false;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['name'] = name;
|
||||
data['id'] = id;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
27
lib/models/car_model.dart
Normal file
27
lib/models/car_model.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class CarModel {
|
||||
String? name;
|
||||
String? carMakeName;
|
||||
String? id;
|
||||
bool? isActive;
|
||||
String? carMakeId;
|
||||
|
||||
CarModel({this.name, this.carMakeName, this.id, this.isActive, this.carMakeId});
|
||||
|
||||
CarModel.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'];
|
||||
carMakeName = json['car_make_name'];
|
||||
id = json['id'];
|
||||
isActive = json['isActive'];
|
||||
carMakeId = json['car_make_id'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['name'] = name;
|
||||
data['car_make_name'] = carMakeName;
|
||||
data['id'] = id;
|
||||
data['isActive'] = isActive;
|
||||
data['car_make_id'] = carMakeId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
99
lib/models/cart_product_model.dart
Normal file
99
lib/models/cart_product_model.dart
Normal file
@@ -0,0 +1,99 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CartProductModel {
|
||||
String? id;
|
||||
String? categoryId;
|
||||
String? name;
|
||||
String? photo;
|
||||
String? price;
|
||||
String? discountPrice;
|
||||
String? vendorID;
|
||||
int? quantity;
|
||||
String? extrasPrice;
|
||||
List<dynamic>? extras;
|
||||
VariantInfo? variantInfo;
|
||||
|
||||
CartProductModel({
|
||||
this.id,
|
||||
this.categoryId,
|
||||
this.name,
|
||||
this.photo,
|
||||
this.price,
|
||||
this.discountPrice,
|
||||
this.vendorID,
|
||||
this.quantity,
|
||||
this.extrasPrice,
|
||||
this.variantInfo,
|
||||
this.extras,
|
||||
});
|
||||
|
||||
CartProductModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
categoryId = json['category_id'];
|
||||
name = json['name'];
|
||||
photo = json['photo'];
|
||||
price = json['price'] ?? "0.0";
|
||||
discountPrice = json['discountPrice'] ?? "0.0";
|
||||
vendorID = json['vendorID'];
|
||||
quantity = json['quantity'];
|
||||
extrasPrice = json['extras_price'];
|
||||
|
||||
extras = json['extras'] != null
|
||||
? "String" == json['extras'].runtimeType.toString()
|
||||
? List<dynamic>.from(jsonDecode(json['extras']))
|
||||
: List<dynamic>.from(json['extras'])
|
||||
: null;
|
||||
|
||||
variantInfo = json['variant_info'] != null
|
||||
? "String" == json['variant_info'].runtimeType.toString()
|
||||
? VariantInfo.fromJson(jsonDecode(json['variant_info']))
|
||||
: VariantInfo.fromJson(json['variant_info'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['category_id'] = categoryId;
|
||||
data['name'] = name;
|
||||
data['photo'] = photo;
|
||||
data['price'] = price;
|
||||
data['discountPrice'] = discountPrice;
|
||||
data['vendorID'] = vendorID;
|
||||
data['quantity'] = quantity;
|
||||
data['extras_price'] = extrasPrice;
|
||||
data['extras'] = extras;
|
||||
if (variantInfo != null) {
|
||||
data['variant_info'] = variantInfo?.toJson(); // Handle null value
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class VariantInfo {
|
||||
String? variantId;
|
||||
String? variantPrice;
|
||||
String? variantSku;
|
||||
String? variantImage;
|
||||
Map<String, dynamic>? variantOptions;
|
||||
|
||||
VariantInfo({this.variantId, this.variantPrice, this.variantSku, this.variantImage, this.variantOptions});
|
||||
|
||||
VariantInfo.fromJson(Map<String, dynamic> json) {
|
||||
variantId = json['variant_id'] ?? '';
|
||||
variantPrice = json['variant_price'] ?? '';
|
||||
variantSku = json['variant_sku'] ?? '';
|
||||
variantImage = json['variant_image'] ?? '';
|
||||
variantOptions = json['variant_options'] ?? {};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['variant_id'] = variantId;
|
||||
data['variant_price'] = variantPrice;
|
||||
data['variant_sku'] = variantSku;
|
||||
data['variant_image'] = variantImage;
|
||||
data['variant_options'] = variantOptions;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
77
lib/models/cashbackModel.dart
Normal file
77
lib/models/cashbackModel.dart
Normal file
@@ -0,0 +1,77 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class CashbackModel {
|
||||
bool? allCustomer;
|
||||
bool? allPayment;
|
||||
double? cashbackAmount;
|
||||
String? cashbackType;
|
||||
List<String>? customerIds;
|
||||
Timestamp? endDate;
|
||||
String? id;
|
||||
bool? isEnabled;
|
||||
double? maximumDiscount;
|
||||
double? minimumPurchaseAmount;
|
||||
List<String>? paymentMethods;
|
||||
int? redeemLimit;
|
||||
Timestamp? startDate;
|
||||
String? title;
|
||||
double? cashbackValue;
|
||||
|
||||
CashbackModel({
|
||||
this.allCustomer,
|
||||
this.allPayment,
|
||||
this.cashbackAmount,
|
||||
this.cashbackValue,
|
||||
this.cashbackType,
|
||||
this.customerIds,
|
||||
this.endDate,
|
||||
this.id,
|
||||
this.isEnabled,
|
||||
this.maximumDiscount,
|
||||
this.minimumPurchaseAmount,
|
||||
this.paymentMethods,
|
||||
this.redeemLimit,
|
||||
this.startDate,
|
||||
this.title,
|
||||
});
|
||||
|
||||
factory CashbackModel.fromJson(Map<String, dynamic> json) {
|
||||
return CashbackModel(
|
||||
allCustomer: json['allCustomer'],
|
||||
allPayment: json['allPayment'],
|
||||
cashbackAmount: (json['cashbackAmount'] != null) ? double.tryParse(json['cashbackAmount'].toString()) : null,
|
||||
cashbackValue: (json['cashbackValue'] != null) ? double.tryParse(json['cashbackValue'].toString()) : null,
|
||||
cashbackType: json['cashbackType'] ?? '',
|
||||
customerIds: json['customerIds'] != null ? List<String>.from(json['customerIds']) : null,
|
||||
endDate: json['endDate'] is Timestamp ? json['endDate'] as Timestamp : null,
|
||||
id: json['id'],
|
||||
isEnabled: json['isEnabled'],
|
||||
maximumDiscount: (json['maximumDiscount'] != null) ? double.tryParse(json['maximumDiscount'].toString()) : null,
|
||||
minimumPurchaseAmount: (json['minumumPurchaseAmount'] != null) ? double.tryParse(json['minumumPurchaseAmount'].toString()) : null,
|
||||
paymentMethods: json['paymentMethods'] != null ? List<String>.from(json['paymentMethods']) : null,
|
||||
redeemLimit: int.parse("${json['redeemLimit'] ?? 0}"),
|
||||
startDate: json['startDate'] is Timestamp ? json['startDate'] as Timestamp : null,
|
||||
title: json['title'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'allCustomer': allCustomer,
|
||||
'allPayment': allPayment,
|
||||
'cashbackAmount': cashbackAmount,
|
||||
if (cashbackValue != null) 'cashbackValue': cashbackValue,
|
||||
'cashbackType': cashbackType,
|
||||
'customerIds': customerIds,
|
||||
'endDate': endDate,
|
||||
'id': id,
|
||||
'isEnabled': isEnabled,
|
||||
'maximumDiscount': maximumDiscount,
|
||||
'minumumPurchaseAmount': minimumPurchaseAmount,
|
||||
'paymentMethods': paymentMethods,
|
||||
'redeemLimit': redeemLimit,
|
||||
'startDate': startDate,
|
||||
'title': title,
|
||||
};
|
||||
}
|
||||
}
|
||||
75
lib/models/conversation_model.dart
Normal file
75
lib/models/conversation_model.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class ConversationModel {
|
||||
String? id;
|
||||
String? senderId;
|
||||
String? receiverId;
|
||||
String? orderId;
|
||||
String? message;
|
||||
String? messageType;
|
||||
String? videoThumbnail;
|
||||
Url? url;
|
||||
Timestamp? createdAt;
|
||||
|
||||
ConversationModel({
|
||||
this.id,
|
||||
this.senderId,
|
||||
this.receiverId,
|
||||
this.orderId,
|
||||
this.message,
|
||||
this.messageType,
|
||||
this.videoThumbnail,
|
||||
this.url,
|
||||
this.createdAt,
|
||||
});
|
||||
|
||||
factory ConversationModel.fromJson(Map<String, dynamic> parsedJson) {
|
||||
return ConversationModel(
|
||||
id: parsedJson['id'] ?? '',
|
||||
senderId: parsedJson['senderId'] ?? '',
|
||||
receiverId: parsedJson['receiverId'] ?? '',
|
||||
orderId: parsedJson['orderId'] ?? '',
|
||||
message: parsedJson['message'] ?? '',
|
||||
messageType: parsedJson['messageType'] ?? '',
|
||||
videoThumbnail: parsedJson['videoThumbnail'] ?? '',
|
||||
url: parsedJson.containsKey('url')
|
||||
? parsedJson['url'] != null
|
||||
? Url.fromJson(parsedJson['url'])
|
||||
: null
|
||||
: Url(),
|
||||
createdAt: parsedJson['createdAt'] ?? Timestamp.now(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'senderId': senderId,
|
||||
'receiverId': receiverId,
|
||||
'orderId': orderId,
|
||||
'message': message,
|
||||
'messageType': messageType,
|
||||
'videoThumbnail': videoThumbnail,
|
||||
'url': url?.toJson(),
|
||||
'createdAt': createdAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class Url {
|
||||
String mime;
|
||||
|
||||
String url;
|
||||
|
||||
String? videoThumbnail;
|
||||
|
||||
Url({this.mime = '', this.url = '', this.videoThumbnail});
|
||||
|
||||
factory Url.fromJson(Map<dynamic, dynamic> parsedJson) {
|
||||
return Url(url: parsedJson['url'] ?? '', videoThumbnail: parsedJson['videoThumbnail'] ?? '');
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {'mime': mime, 'url': url, 'videoThumbnail': videoThumbnail};
|
||||
}
|
||||
}
|
||||
41
lib/models/currency_model.dart
Normal file
41
lib/models/currency_model.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class CurrencyModel {
|
||||
Timestamp? createdAt;
|
||||
String? symbol;
|
||||
String? code;
|
||||
bool? enable;
|
||||
bool? symbolAtRight;
|
||||
String? name;
|
||||
int? decimalDigits;
|
||||
String? id;
|
||||
Timestamp? updatedAt;
|
||||
|
||||
CurrencyModel({this.createdAt, this.symbol, this.code, this.enable, this.symbolAtRight, this.name, this.decimalDigits, this.id, this.updatedAt});
|
||||
|
||||
CurrencyModel.fromJson(Map<String, dynamic> json) {
|
||||
createdAt = json['createdAt'];
|
||||
symbol = json['symbol'];
|
||||
code = json['code'];
|
||||
enable = json['enable'];
|
||||
symbolAtRight = json['symbolAtRight'];
|
||||
name = json['name'];
|
||||
decimalDigits = json['decimalDigits'] != null ? int.parse(json['decimalDigits'].toString()) : 2;
|
||||
id = json['id'];
|
||||
updatedAt = json['updatedAt'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['createdAt'] = createdAt;
|
||||
data['symbol'] = symbol;
|
||||
data['code'] = code;
|
||||
data['enable'] = enable;
|
||||
data['symbolAtRight'] = symbolAtRight;
|
||||
data['name'] = name;
|
||||
data['decimalDigits'] = decimalDigits;
|
||||
data['id'] = id;
|
||||
data['updatedAt'] = updatedAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
30
lib/models/document_model.dart
Normal file
30
lib/models/document_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class DocumentModel {
|
||||
bool? backSide;
|
||||
bool? enable;
|
||||
bool? expireAt;
|
||||
String? id;
|
||||
bool? frontSide;
|
||||
String? title;
|
||||
|
||||
DocumentModel({this.backSide, this.enable, this.id, this.frontSide, this.title, this.expireAt});
|
||||
|
||||
DocumentModel.fromJson(Map<String, dynamic> json) {
|
||||
backSide = json['backSide'];
|
||||
enable = json['enable'];
|
||||
id = json['id'];
|
||||
frontSide = json['frontSide'];
|
||||
title = json['title'];
|
||||
expireAt = json['expireAt'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['backSide'] = backSide;
|
||||
data['enable'] = enable;
|
||||
data['id'] = id;
|
||||
data['frontSide'] = frontSide;
|
||||
data['title'] = title;
|
||||
data['expireAt'] = expireAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
53
lib/models/driver_document_model.dart
Normal file
53
lib/models/driver_document_model.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
class DriverDocumentModel {
|
||||
List<Documents>? documents;
|
||||
String? id;
|
||||
String? type;
|
||||
|
||||
DriverDocumentModel({this.documents, this.id});
|
||||
|
||||
DriverDocumentModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['documents'] != null) {
|
||||
documents = <Documents>[];
|
||||
json['documents'].forEach((v) {
|
||||
documents!.add(Documents.fromJson(v));
|
||||
});
|
||||
}
|
||||
id = json['id'];
|
||||
type = json['type'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (documents != null) {
|
||||
data['documents'] = documents!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['id'] = id;
|
||||
data['type'] = type;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Documents {
|
||||
String? frontImage;
|
||||
String? status;
|
||||
String? documentId;
|
||||
String? backImage;
|
||||
|
||||
Documents({this.frontImage, this.status, this.documentId, this.backImage});
|
||||
|
||||
Documents.fromJson(Map<String, dynamic> json) {
|
||||
frontImage = json['frontImage'];
|
||||
status = json['status'];
|
||||
documentId = json['documentId'];
|
||||
backImage = json['backImage'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['frontImage'] = frontImage;
|
||||
data['status'] = status;
|
||||
data['documentId'] = documentId;
|
||||
data['backImage'] = backImage;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
27
lib/models/email_template_model.dart
Normal file
27
lib/models/email_template_model.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class EmailTemplateModel {
|
||||
String? id;
|
||||
String? type;
|
||||
String? message;
|
||||
String? subject;
|
||||
bool? isSendToAdmin;
|
||||
|
||||
EmailTemplateModel({this.subject, this.id, this.type, this.message, this.isSendToAdmin});
|
||||
|
||||
EmailTemplateModel.fromJson(Map<String, dynamic> json) {
|
||||
subject = json['subject'];
|
||||
id = json['id'];
|
||||
type = json['type'];
|
||||
message = json['message'];
|
||||
isSendToAdmin = json['isSendToAdmin'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['subject'] = subject;
|
||||
data['id'] = id;
|
||||
data['type'] = type;
|
||||
data['message'] = message;
|
||||
data['isSendToAdmin'] = isSendToAdmin;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
61
lib/models/inbox_model.dart
Normal file
61
lib/models/inbox_model.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class InboxModel {
|
||||
String? customerId;
|
||||
String? customerName;
|
||||
String? customerProfileImage;
|
||||
String? lastMessage;
|
||||
String? orderId;
|
||||
String? restaurantId;
|
||||
String? restaurantName;
|
||||
String? restaurantProfileImage;
|
||||
String? lastSenderId;
|
||||
String? chatType;
|
||||
Timestamp? createdAt;
|
||||
|
||||
InboxModel({
|
||||
this.customerId,
|
||||
this.customerName,
|
||||
this.customerProfileImage,
|
||||
this.lastMessage,
|
||||
this.orderId,
|
||||
this.restaurantId,
|
||||
this.restaurantName,
|
||||
this.restaurantProfileImage,
|
||||
this.lastSenderId,
|
||||
this.chatType,
|
||||
this.createdAt,
|
||||
});
|
||||
|
||||
factory InboxModel.fromJson(Map<String, dynamic> parsedJson) {
|
||||
return InboxModel(
|
||||
customerId: parsedJson['customerId'] ?? '',
|
||||
customerName: parsedJson['customerName'] ?? '',
|
||||
customerProfileImage: parsedJson['customerProfileImage'] ?? '',
|
||||
lastMessage: parsedJson['lastMessage'],
|
||||
orderId: parsedJson['orderId'],
|
||||
restaurantId: parsedJson['restaurantId'] ?? '',
|
||||
restaurantName: parsedJson['restaurantName'] ?? '',
|
||||
lastSenderId: parsedJson['lastSenderId'] ?? '',
|
||||
chatType: parsedJson['chatType'] ?? '',
|
||||
restaurantProfileImage: parsedJson['restaurantProfileImage'] ?? '',
|
||||
createdAt: parsedJson['createdAt'] ?? Timestamp.now(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'customerId': customerId,
|
||||
'customerName': customerName,
|
||||
'customerProfileImage': customerProfileImage,
|
||||
'lastMessage': lastMessage,
|
||||
'orderId': orderId,
|
||||
'restaurantId': restaurantId,
|
||||
'restaurantName': restaurantName,
|
||||
'restaurantProfileImage': restaurantProfileImage,
|
||||
'lastSenderId': lastSenderId,
|
||||
'chatType': chatType,
|
||||
'createdAt': createdAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
27
lib/models/language_model.dart
Normal file
27
lib/models/language_model.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class LanguageModel {
|
||||
bool? isActive;
|
||||
String? slug;
|
||||
String? title;
|
||||
String? image;
|
||||
bool? isRtl;
|
||||
|
||||
LanguageModel({this.isActive, this.slug, this.title, this.isRtl, this.image});
|
||||
|
||||
LanguageModel.fromJson(Map<String, dynamic> json) {
|
||||
isActive = json['isActive'];
|
||||
slug = json['slug'];
|
||||
title = json['title'];
|
||||
isRtl = json['is_rtl'];
|
||||
image = json['flag'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['isActive'] = isActive;
|
||||
data['slug'] = slug;
|
||||
data['title'] = title;
|
||||
data['is_rtl'] = isRtl;
|
||||
data['flag'] = image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
36
lib/models/mail_setting.dart
Normal file
36
lib/models/mail_setting.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
class MailSettings {
|
||||
String? emailSetting;
|
||||
String? fromName;
|
||||
String? host;
|
||||
String? mailEncryptionType;
|
||||
String? mailMethod;
|
||||
String? password;
|
||||
String? port;
|
||||
String? userName;
|
||||
|
||||
MailSettings({this.emailSetting, this.fromName, this.host, this.mailEncryptionType, this.mailMethod, this.password, this.port, this.userName});
|
||||
|
||||
MailSettings.fromJson(Map<String, dynamic> json) {
|
||||
emailSetting = json['emailSetting'];
|
||||
fromName = json['fromName'];
|
||||
host = json['host'];
|
||||
mailEncryptionType = json['mailEncryptionType'];
|
||||
mailMethod = json['mailMethod'];
|
||||
password = json['password'];
|
||||
port = json['port'];
|
||||
userName = json['userName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['emailSetting'] = emailSetting;
|
||||
data['fromName'] = fromName;
|
||||
data['host'] = host;
|
||||
data['mailEncryptionType'] = mailEncryptionType;
|
||||
data['mailMethod'] = mailMethod;
|
||||
data['password'] = password;
|
||||
data['port'] = port;
|
||||
data['userName'] = userName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
24
lib/models/notification_model.dart
Normal file
24
lib/models/notification_model.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class NotificationModel {
|
||||
String? subject;
|
||||
String? id;
|
||||
String? type;
|
||||
String? message;
|
||||
|
||||
NotificationModel({this.subject, this.id, this.type, this.message});
|
||||
|
||||
NotificationModel.fromJson(Map<String, dynamic> json) {
|
||||
subject = json['subject'];
|
||||
id = json['id'];
|
||||
type = json['type'];
|
||||
message = json['message'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['subject'] = subject;
|
||||
data['id'] = id;
|
||||
data['type'] = type;
|
||||
data['message'] = message;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
24
lib/models/on_boarding_model.dart
Normal file
24
lib/models/on_boarding_model.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class OnBoardingModel {
|
||||
String? description;
|
||||
String? id;
|
||||
String? title;
|
||||
String? image;
|
||||
|
||||
OnBoardingModel({this.description, this.id, this.title, this.image});
|
||||
|
||||
OnBoardingModel.fromJson(Map<String, dynamic> json) {
|
||||
description = json['description'];
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
image = json['image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['description'] = description;
|
||||
data['id'] = id;
|
||||
data['title'] = title;
|
||||
data['image'] = image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
157
lib/models/order_model.dart
Normal file
157
lib/models/order_model.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:driver/models/cart_product_model.dart';
|
||||
import 'package:driver/models/cashbackModel.dart';
|
||||
import 'package:driver/models/tax_model.dart';
|
||||
import 'package:driver/models/user_model.dart';
|
||||
import 'package:driver/models/vendor_model.dart';
|
||||
|
||||
class OrderModel {
|
||||
ShippingAddress? address;
|
||||
String? status;
|
||||
String? couponId;
|
||||
String? vendorID;
|
||||
String? driverID;
|
||||
num? discount;
|
||||
String? authorID;
|
||||
String? estimatedTimeToPrepare;
|
||||
Timestamp? createdAt;
|
||||
Timestamp? triggerDelivery;
|
||||
List<TaxModel>? taxSetting;
|
||||
String? paymentMethod;
|
||||
List<CartProductModel>? products;
|
||||
String? adminCommissionType;
|
||||
VendorModel? vendor;
|
||||
String? id;
|
||||
String? adminCommission;
|
||||
String? couponCode;
|
||||
Map<String, dynamic>? specialDiscount;
|
||||
String? deliveryCharge;
|
||||
Timestamp? scheduleTime;
|
||||
String? tipAmount;
|
||||
String? notes;
|
||||
UserModel? author;
|
||||
UserModel? driver;
|
||||
bool? takeAway;
|
||||
List<dynamic>? rejectedByDrivers;
|
||||
CashbackModel? cashback;
|
||||
String? sectionId;
|
||||
|
||||
OrderModel(
|
||||
{this.address,
|
||||
this.status,
|
||||
this.couponId,
|
||||
this.vendorID,
|
||||
this.driverID,
|
||||
this.discount,
|
||||
this.authorID,
|
||||
this.estimatedTimeToPrepare,
|
||||
this.createdAt,
|
||||
this.triggerDelivery,
|
||||
this.taxSetting,
|
||||
this.paymentMethod,
|
||||
this.products,
|
||||
this.adminCommissionType,
|
||||
this.vendor,
|
||||
this.id,
|
||||
this.adminCommission,
|
||||
this.couponCode,
|
||||
this.specialDiscount,
|
||||
this.deliveryCharge,
|
||||
this.scheduleTime,
|
||||
this.tipAmount,
|
||||
this.notes,
|
||||
this.author,
|
||||
this.driver,
|
||||
this.takeAway,
|
||||
this.rejectedByDrivers,
|
||||
this.cashback,
|
||||
this.sectionId});
|
||||
|
||||
OrderModel.fromJson(Map<String, dynamic> json) {
|
||||
address = json['address'] != null ? ShippingAddress.fromJson(json['address']) : null;
|
||||
status = json['status'];
|
||||
couponId = json['couponId'];
|
||||
vendorID = json['vendorID'];
|
||||
driverID = json['driverID'];
|
||||
discount = json['discount'] ?? 0.0;
|
||||
authorID = json['authorID'];
|
||||
estimatedTimeToPrepare = json['estimatedTimeToPrepare'];
|
||||
createdAt = json['createdAt'];
|
||||
triggerDelivery = json['triggerDelevery'] ?? Timestamp.now();
|
||||
if (json['taxSetting'] != null) {
|
||||
taxSetting = <TaxModel>[];
|
||||
json['taxSetting'].forEach((v) {
|
||||
taxSetting!.add(TaxModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
paymentMethod = json['payment_method'];
|
||||
if (json['products'] != null) {
|
||||
products = <CartProductModel>[];
|
||||
json['products'].forEach((v) {
|
||||
products!.add(CartProductModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
adminCommissionType = json['adminCommissionType'];
|
||||
vendor = json['vendor'] != null ? VendorModel.fromJson(json['vendor']) : null;
|
||||
id = json['id'];
|
||||
adminCommission = json['adminCommission'];
|
||||
couponCode = json['couponCode'];
|
||||
specialDiscount = json['specialDiscount'];
|
||||
deliveryCharge = json['deliveryCharge'].toString().isEmpty ? "0.0" : json['deliveryCharge'] ?? '0.0';
|
||||
scheduleTime = json['scheduleTime'];
|
||||
tipAmount = json['tip_amount'].toString().isEmpty ? "0.0" : json['tip_amount'] ?? "0.0";
|
||||
notes = json['notes'];
|
||||
author = json['author'] != null ? UserModel.fromJson(json['author']) : null;
|
||||
driver = json['driver'] != null ? UserModel.fromJson(json['driver']) : null;
|
||||
takeAway = json['takeAway'];
|
||||
rejectedByDrivers = json['rejectedByDrivers'] ?? [];
|
||||
cashback = json['cashback'] != null ? CashbackModel.fromJson(json['cashback']) : null;
|
||||
sectionId = json['section_id'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (address != null) {
|
||||
data['address'] = address!.toJson();
|
||||
}
|
||||
data['status'] = status;
|
||||
data['couponId'] = couponId;
|
||||
data['vendorID'] = vendorID;
|
||||
data['driverID'] = driverID;
|
||||
data['discount'] = discount;
|
||||
data['authorID'] = authorID;
|
||||
data['estimatedTimeToPrepare'] = estimatedTimeToPrepare;
|
||||
data['createdAt'] = createdAt;
|
||||
data['triggerDelivery'] = triggerDelivery;
|
||||
if (taxSetting != null) {
|
||||
data['taxSetting'] = taxSetting!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['payment_method'] = paymentMethod;
|
||||
if (products != null) {
|
||||
data['products'] = products!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['adminCommissionType'] = adminCommissionType;
|
||||
if (vendor != null) {
|
||||
data['vendor'] = vendor!.toJson();
|
||||
}
|
||||
data['id'] = id;
|
||||
data['adminCommission'] = adminCommission;
|
||||
data['couponCode'] = couponCode;
|
||||
data['specialDiscount'] = specialDiscount;
|
||||
data['deliveryCharge'] = deliveryCharge;
|
||||
data['scheduleTime'] = scheduleTime;
|
||||
data['tip_amount'] = tipAmount;
|
||||
data['notes'] = notes;
|
||||
if (author != null) {
|
||||
data['author'] = author!.toJson();
|
||||
}
|
||||
if (driver != null) {
|
||||
data['driver'] = driver!.toJson();
|
||||
}
|
||||
data['takeAway'] = takeAway;
|
||||
data['rejectedByDrivers'] = rejectedByDrivers;
|
||||
data['cashback'] = cashback?.toJson();
|
||||
data['section_id'] = sectionId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
27
lib/models/parcel_category.dart
Normal file
27
lib/models/parcel_category.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class ParcelCategory {
|
||||
String? image;
|
||||
int? setOrder;
|
||||
bool? publish;
|
||||
String? id;
|
||||
String? title;
|
||||
|
||||
ParcelCategory({this.image, this.setOrder, this.publish, this.id, this.title});
|
||||
|
||||
ParcelCategory.fromJson(Map<String, dynamic> json) {
|
||||
image = json['image'];
|
||||
setOrder = json['set_order'];
|
||||
publish = json['publish'];
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['image'] = image;
|
||||
data['set_order'] = setOrder;
|
||||
data['publish'] = publish;
|
||||
data['id'] = id;
|
||||
data['title'] = title;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
216
lib/models/parcel_order_model.dart
Normal file
216
lib/models/parcel_order_model.dart
Normal file
@@ -0,0 +1,216 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:driver/models/tax_model.dart';
|
||||
import 'package:driver/models/user_model.dart';
|
||||
import 'package:driver/models/vendor_model.dart';
|
||||
|
||||
class ParcelOrderModel {
|
||||
UserModel? author;
|
||||
UserModel? driver;
|
||||
|
||||
LocationInformation? sender;
|
||||
Timestamp? senderPickupDateTime;
|
||||
String? id;
|
||||
String? driverId;
|
||||
|
||||
UserLocation? receiverLatLong;
|
||||
bool? paymentCollectByReceiver;
|
||||
List<TaxModel>? taxSetting;
|
||||
String? adminCommissionType;
|
||||
List<dynamic>? rejectedByDrivers;
|
||||
String? adminCommission;
|
||||
List<dynamic>? parcelImages;
|
||||
String? parcelWeight;
|
||||
String? discountType;
|
||||
String? discountLabel;
|
||||
LocationInformation? receiver;
|
||||
String? paymentMethod;
|
||||
String? distance;
|
||||
Timestamp? createdAt;
|
||||
bool? isSchedule;
|
||||
String? subTotal;
|
||||
Timestamp? triggerDelevery;
|
||||
String? status;
|
||||
String? parcelType;
|
||||
bool? sendToDriver;
|
||||
String? sectionId;
|
||||
UserLocation? senderLatLong;
|
||||
String? authorID;
|
||||
String? parcelWeightCharge;
|
||||
String? parcelCategoryID;
|
||||
String? discount;
|
||||
Timestamp? receiverPickupDateTime;
|
||||
String? note;
|
||||
String? senderZoneId;
|
||||
String? receiverZoneId;
|
||||
G? sourcePoint;
|
||||
G? destinationPoint;
|
||||
|
||||
ParcelOrderModel({
|
||||
this.author,
|
||||
this.sender,
|
||||
this.senderPickupDateTime,
|
||||
this.id,
|
||||
this.driverId,
|
||||
this.receiverLatLong,
|
||||
this.paymentCollectByReceiver,
|
||||
this.taxSetting,
|
||||
this.adminCommissionType,
|
||||
this.rejectedByDrivers,
|
||||
this.adminCommission,
|
||||
this.parcelImages,
|
||||
this.parcelWeight,
|
||||
this.discountType,
|
||||
this.discountLabel,
|
||||
this.receiver,
|
||||
this.paymentMethod,
|
||||
this.distance,
|
||||
this.createdAt,
|
||||
this.isSchedule,
|
||||
this.subTotal,
|
||||
this.triggerDelevery,
|
||||
this.status,
|
||||
this.parcelType,
|
||||
this.sendToDriver,
|
||||
this.sectionId,
|
||||
this.senderLatLong,
|
||||
this.authorID,
|
||||
this.parcelWeightCharge,
|
||||
this.parcelCategoryID,
|
||||
this.discount,
|
||||
this.receiverPickupDateTime,
|
||||
this.note,
|
||||
this.senderZoneId,
|
||||
this.sourcePoint,
|
||||
this.destinationPoint,
|
||||
this.receiverZoneId,
|
||||
this.driver,
|
||||
});
|
||||
|
||||
ParcelOrderModel.fromJson(Map<String, dynamic> json) {
|
||||
author = json['author'] != null ? UserModel.fromJson(json['author']) : null;
|
||||
driver = json['driver'] != null ? UserModel.fromJson(json['driver']) : null;
|
||||
sender = json['sender'] != null ? LocationInformation.fromJson(json['sender']) : null;
|
||||
senderPickupDateTime = json['senderPickupDateTime'];
|
||||
id = json['id'];
|
||||
driverId = json['driverId'];
|
||||
receiverLatLong = json['receiverLatLong'] != null ? UserLocation.fromJson(json['receiverLatLong']) : null;
|
||||
paymentCollectByReceiver = json['paymentCollectByReceiver'];
|
||||
if (json['taxSetting'] != null) {
|
||||
taxSetting = <TaxModel>[];
|
||||
json['taxSetting'].forEach((v) {
|
||||
taxSetting!.add(TaxModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
adminCommissionType = json['adminCommissionType'];
|
||||
rejectedByDrivers = json['rejectedByDrivers'] ?? [];
|
||||
adminCommission = json['adminCommission'];
|
||||
parcelImages = json['parcelImages'] ?? [];
|
||||
parcelWeight = json['parcelWeight'];
|
||||
discountType = json['discountType'];
|
||||
discountLabel = json['discountLabel'];
|
||||
receiver = json['receiver'] != null ? LocationInformation.fromJson(json['receiver']) : null;
|
||||
paymentMethod = json['payment_method'];
|
||||
distance = json['distance'];
|
||||
createdAt = json['createdAt'];
|
||||
isSchedule = json['isSchedule'];
|
||||
subTotal = json['subTotal'];
|
||||
triggerDelevery = json['trigger_delevery'];
|
||||
status = json['status'];
|
||||
parcelType = json['parcelType'];
|
||||
sendToDriver = json['sendToDriver'];
|
||||
sectionId = json['sectionId'];
|
||||
senderLatLong = json['senderLatLong'] != null ? UserLocation.fromJson(json['senderLatLong']) : null;
|
||||
authorID = json['authorID'];
|
||||
parcelWeightCharge = json['parcelWeightCharge'];
|
||||
parcelCategoryID = json['parcelCategoryID'];
|
||||
discount = json['discount'];
|
||||
receiverPickupDateTime = json['receiverPickupDateTime'];
|
||||
note = json['note'];
|
||||
senderZoneId = json['senderZoneId'];
|
||||
receiverZoneId = json['receiverZoneId'];
|
||||
sourcePoint = json['sourcePoint'] != null ? G.fromJson(json['sourcePoint']) : null;
|
||||
destinationPoint = json['destinationPoint'] != null ? G.fromJson(json['destinationPoint']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (author != null) {
|
||||
data['author'] = author!.toJson();
|
||||
} if (driver != null) {
|
||||
data['driver'] = driver!.toJson();
|
||||
}
|
||||
if (sender != null) {
|
||||
data['sender'] = sender!.toJson();
|
||||
}
|
||||
data['senderPickupDateTime'] = senderPickupDateTime;
|
||||
data['id'] = id;
|
||||
if (receiverLatLong != null) {
|
||||
data['receiverLatLong'] = receiverLatLong!.toJson();
|
||||
}
|
||||
data['paymentCollectByReceiver'] = paymentCollectByReceiver;
|
||||
if (taxSetting != null) {
|
||||
data['taxSetting'] = taxSetting!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['driverId'] = driverId;
|
||||
data['adminCommissionType'] = adminCommissionType;
|
||||
data['rejectedByDrivers'] = rejectedByDrivers;
|
||||
data['adminCommission'] = adminCommission;
|
||||
data['parcelImages'] = parcelImages;
|
||||
data['parcelWeight'] = parcelWeight;
|
||||
data['discountType'] = discountType;
|
||||
data['discountLabel'] = discountLabel;
|
||||
if (receiver != null) {
|
||||
data['receiver'] = receiver!.toJson();
|
||||
}
|
||||
data['payment_method'] = paymentMethod;
|
||||
data['distance'] = distance;
|
||||
data['createdAt'] = createdAt;
|
||||
data['isSchedule'] = isSchedule;
|
||||
data['subTotal'] = subTotal;
|
||||
data['trigger_delevery'] = triggerDelevery;
|
||||
data['status'] = status;
|
||||
data['parcelType'] = parcelType;
|
||||
data['sendToDriver'] = sendToDriver;
|
||||
data['sectionId'] = sectionId;
|
||||
if (senderLatLong != null) {
|
||||
data['senderLatLong'] = senderLatLong!.toJson();
|
||||
}
|
||||
if (sourcePoint != null) {
|
||||
data['sourcePoint'] = sourcePoint!.toJson();
|
||||
}
|
||||
if (destinationPoint != null) {
|
||||
data['destinationPoint'] = destinationPoint!.toJson();
|
||||
}
|
||||
data['authorID'] = authorID;
|
||||
data['parcelWeightCharge'] = parcelWeightCharge;
|
||||
data['parcelCategoryID'] = parcelCategoryID;
|
||||
data['discount'] = discount;
|
||||
data['receiverPickupDateTime'] = receiverPickupDateTime;
|
||||
data['note'] = note;
|
||||
data['senderZoneId'] = senderZoneId;
|
||||
data['receiverZoneId'] = receiverZoneId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class LocationInformation {
|
||||
String? address;
|
||||
String? name;
|
||||
String? phone;
|
||||
|
||||
LocationInformation({this.address, this.name, this.phone});
|
||||
|
||||
LocationInformation.fromJson(Map<String, dynamic> json) {
|
||||
address = json['address'];
|
||||
name = json['name'];
|
||||
phone = json['phone'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['address'] = address;
|
||||
data['name'] = name;
|
||||
data['phone'] = phone;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
15
lib/models/payment_model/cod_setting_model.dart
Normal file
15
lib/models/payment_model/cod_setting_model.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class CodSettingModel {
|
||||
bool? isEnabled;
|
||||
|
||||
CodSettingModel({this.isEnabled});
|
||||
|
||||
CodSettingModel.fromJson(Map<String, dynamic> json) {
|
||||
isEnabled = json['isEnabled'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['isEnabled'] = isEnabled;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
30
lib/models/payment_model/flutter_wave_model.dart
Normal file
30
lib/models/payment_model/flutter_wave_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class FlutterWaveModel {
|
||||
bool? isSandbox;
|
||||
bool? isWithdrawEnabled;
|
||||
String? publicKey;
|
||||
String? encryptionKey;
|
||||
bool? isEnable;
|
||||
String? secretKey;
|
||||
|
||||
FlutterWaveModel({this.isSandbox, this.isWithdrawEnabled, this.publicKey, this.encryptionKey, this.isEnable, this.secretKey});
|
||||
|
||||
FlutterWaveModel.fromJson(Map<String, dynamic> json) {
|
||||
isSandbox = json['isSandbox'];
|
||||
isWithdrawEnabled = json['isWithdrawEnabled'];
|
||||
publicKey = json['publicKey'];
|
||||
encryptionKey = json['encryptionKey'];
|
||||
isEnable = json['isEnable'];
|
||||
secretKey = json['secretKey'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['isSandbox'] = isSandbox;
|
||||
data['isWithdrawEnabled'] = isWithdrawEnabled;
|
||||
data['publicKey'] = publicKey;
|
||||
data['encryptionKey'] = encryptionKey;
|
||||
data['isEnable'] = isEnable;
|
||||
data['secretKey'] = secretKey;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
24
lib/models/payment_model/mercado_pago_model.dart
Normal file
24
lib/models/payment_model/mercado_pago_model.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class MercadoPagoModel {
|
||||
bool? isSandboxEnabled;
|
||||
bool? isEnabled;
|
||||
String? accessToken;
|
||||
String? publicKey;
|
||||
|
||||
MercadoPagoModel({this.isSandboxEnabled, this.isEnabled, this.accessToken, this.publicKey});
|
||||
|
||||
MercadoPagoModel.fromJson(Map<String, dynamic> json) {
|
||||
isSandboxEnabled = json['isSandboxEnabled'];
|
||||
isEnabled = json['isEnabled'];
|
||||
accessToken = json['AccessToken'];
|
||||
publicKey = json['PublicKey'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['isSandboxEnabled'] = isSandboxEnabled;
|
||||
data['isEnabled'] = isEnabled;
|
||||
data['AccessToken'] = accessToken;
|
||||
data['PublicKey'] = publicKey;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
34
lib/models/payment_model/mid_trans.dart
Normal file
34
lib/models/payment_model/mid_trans.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
class MidTrans {
|
||||
bool? enable;
|
||||
String? name;
|
||||
bool? isSandbox;
|
||||
String? serverKey;
|
||||
String? image;
|
||||
|
||||
MidTrans({
|
||||
this.name,
|
||||
this.enable,
|
||||
this.serverKey,
|
||||
this.isSandbox,
|
||||
this.image,
|
||||
});
|
||||
|
||||
MidTrans.fromJson(Map<String, dynamic> json) {
|
||||
enable = json['enable'];
|
||||
name = json['name'];
|
||||
isSandbox = json['isSandbox'];
|
||||
serverKey = json['serverKey'];
|
||||
image = json['image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
|
||||
data['enable'] = enable;
|
||||
data['name'] = name;
|
||||
data['isSandbox'] = isSandbox;
|
||||
data['serverKey'] = serverKey;
|
||||
data['image'] = image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
60
lib/models/payment_model/orange_money.dart
Normal file
60
lib/models/payment_model/orange_money.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
class OrangeMoney {
|
||||
String? image;
|
||||
String? clientId;
|
||||
String? auth;
|
||||
bool? enable;
|
||||
String? name;
|
||||
String? notifyUrl;
|
||||
String? clientSecret;
|
||||
bool? isSandbox;
|
||||
String? returnUrl;
|
||||
String? merchantKey;
|
||||
String? cancelUrl;
|
||||
String? notifUrl;
|
||||
|
||||
OrangeMoney(
|
||||
{this.image,
|
||||
this.clientId,
|
||||
this.auth,
|
||||
this.enable,
|
||||
this.name,
|
||||
this.notifyUrl,
|
||||
this.clientSecret,
|
||||
this.isSandbox,
|
||||
this.returnUrl,
|
||||
this.cancelUrl,
|
||||
this.notifUrl,
|
||||
this.merchantKey});
|
||||
|
||||
OrangeMoney.fromJson(Map<String, dynamic> json) {
|
||||
image = json['image'];
|
||||
clientId = json['clientId'];
|
||||
auth = json['auth'];
|
||||
enable = json['enable'];
|
||||
name = json['name'];
|
||||
notifyUrl = json['notifyUrl'];
|
||||
clientSecret = json['clientSecret'];
|
||||
isSandbox = json['isSandbox'];
|
||||
returnUrl = json['returnUrl'];
|
||||
merchantKey = json['merchantKey'];
|
||||
cancelUrl = json['cancelUrl'];
|
||||
notifUrl = json['notifUrl'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['image'] = image;
|
||||
data['clientId'] = clientId;
|
||||
data['auth'] = auth;
|
||||
data['enable'] = enable;
|
||||
data['name'] = name;
|
||||
data['notifyUrl'] = notifyUrl;
|
||||
data['clientSecret'] = clientSecret;
|
||||
data['isSandbox'] = isSandbox;
|
||||
data['returnUrl'] = returnUrl;
|
||||
data['merchantKey'] = merchantKey;
|
||||
data['cancelUrl'] = cancelUrl;
|
||||
data['notifUrl'] = notifUrl;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
33
lib/models/payment_model/pay_fast_model.dart
Normal file
33
lib/models/payment_model/pay_fast_model.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
class PayFastModel {
|
||||
String? returnUrl;
|
||||
String? cancelUrl;
|
||||
String? notifyUrl;
|
||||
String? merchantKey;
|
||||
bool? isEnable;
|
||||
String? merchantId;
|
||||
bool? isSandbox;
|
||||
|
||||
PayFastModel({this.returnUrl, this.cancelUrl, this.notifyUrl, this.merchantKey, this.isEnable, this.merchantId, this.isSandbox});
|
||||
|
||||
PayFastModel.fromJson(Map<String, dynamic> json) {
|
||||
returnUrl = json['return_url'];
|
||||
cancelUrl = json['cancel_url'];
|
||||
notifyUrl = json['notify_url'];
|
||||
merchantKey = json['merchant_key'];
|
||||
isEnable = json['isEnable'];
|
||||
merchantId = json['merchant_id'];
|
||||
isSandbox = json['isSandbox'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['return_url'] = returnUrl;
|
||||
data['cancel_url'] = cancelUrl;
|
||||
data['notify_url'] = notifyUrl;
|
||||
data['merchant_key'] = merchantKey;
|
||||
data['isEnable'] = isEnable;
|
||||
data['merchant_id'] = merchantId;
|
||||
data['isSandbox'] = isSandbox;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
30
lib/models/payment_model/pay_stack_model.dart
Normal file
30
lib/models/payment_model/pay_stack_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class PayStackModel {
|
||||
bool? isSandbox;
|
||||
String? callbackURL;
|
||||
String? publicKey;
|
||||
String? secretKey;
|
||||
bool? isEnable;
|
||||
String? webhookURL;
|
||||
|
||||
PayStackModel({this.isSandbox, this.callbackURL, this.publicKey, this.secretKey, this.isEnable, this.webhookURL});
|
||||
|
||||
PayStackModel.fromJson(Map<String, dynamic> json) {
|
||||
isSandbox = json['isSandbox'];
|
||||
callbackURL = json['callbackURL'];
|
||||
publicKey = json['publicKey'];
|
||||
secretKey = json['secretKey'];
|
||||
isEnable = json['isEnable'];
|
||||
webhookURL = json['webhookURL'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['isSandbox'] = isSandbox;
|
||||
data['callbackURL'] = callbackURL;
|
||||
data['publicKey'] = publicKey;
|
||||
data['secretKey'] = secretKey;
|
||||
data['isEnable'] = isEnable;
|
||||
data['webhookURL'] = webhookURL;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
30
lib/models/payment_model/paypal_model.dart
Normal file
30
lib/models/payment_model/paypal_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class PayPalModel {
|
||||
String? paypalSecret;
|
||||
bool? isWithdrawEnabled;
|
||||
String? paypalAppId;
|
||||
bool? isEnabled;
|
||||
bool? isLive;
|
||||
String? paypalClient;
|
||||
|
||||
PayPalModel({this.paypalSecret, this.isWithdrawEnabled, this.paypalAppId, this.isEnabled, this.isLive, this.paypalClient});
|
||||
|
||||
PayPalModel.fromJson(Map<String, dynamic> json) {
|
||||
paypalSecret = json['paypalSecret'];
|
||||
isWithdrawEnabled = json['isWithdrawEnabled'];
|
||||
paypalAppId = json['paypalAppId'];
|
||||
isEnabled = json['isEnabled'];
|
||||
isLive = json['isLive'];
|
||||
paypalClient = json['paypalClient'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['paypalSecret'] = paypalSecret;
|
||||
data['isWithdrawEnabled'] = isWithdrawEnabled;
|
||||
data['paypalAppId'] = paypalAppId;
|
||||
data['isEnabled'] = isEnabled;
|
||||
data['isLive'] = isLive;
|
||||
data['paypalClient'] = paypalClient;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
24
lib/models/payment_model/paytm_model.dart
Normal file
24
lib/models/payment_model/paytm_model.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class PaytmModel {
|
||||
String? paytmMID;
|
||||
String? pAYTMMERCHANTKEY;
|
||||
bool? isEnabled;
|
||||
bool? isSandboxEnabled;
|
||||
|
||||
PaytmModel({this.paytmMID, this.pAYTMMERCHANTKEY, this.isEnabled, this.isSandboxEnabled});
|
||||
|
||||
PaytmModel.fromJson(Map<String, dynamic> json) {
|
||||
paytmMID = json['PaytmMID'];
|
||||
pAYTMMERCHANTKEY = json['PAYTM_MERCHANT_KEY'];
|
||||
isEnabled = json['isEnabled'];
|
||||
isSandboxEnabled = json['isSandboxEnabled'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['PaytmMID'] = paytmMID;
|
||||
data['PAYTM_MERCHANT_KEY'] = pAYTMMERCHANTKEY;
|
||||
data['isEnabled'] = isEnabled;
|
||||
data['isSandboxEnabled'] = isSandboxEnabled;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
27
lib/models/payment_model/razorpay_model.dart
Normal file
27
lib/models/payment_model/razorpay_model.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class RazorPayModel {
|
||||
String? razorpaySecret;
|
||||
bool? isWithdrawEnabled;
|
||||
bool? isSandboxEnabled;
|
||||
bool? isEnabled;
|
||||
String? razorpayKey;
|
||||
|
||||
RazorPayModel({this.razorpaySecret, this.isWithdrawEnabled, this.isSandboxEnabled, this.isEnabled, this.razorpayKey});
|
||||
|
||||
RazorPayModel.fromJson(Map<String, dynamic> json) {
|
||||
razorpaySecret = json['razorpaySecret'];
|
||||
isWithdrawEnabled = json['isWithdrawEnabled'];
|
||||
isSandboxEnabled = json['isSandboxEnabled'];
|
||||
isEnabled = json['isEnabled'];
|
||||
razorpayKey = json['razorpayKey'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['razorpaySecret'] = razorpaySecret;
|
||||
data['isWithdrawEnabled'] = isWithdrawEnabled;
|
||||
data['isSandboxEnabled'] = isSandboxEnabled;
|
||||
data['isEnabled'] = isEnabled;
|
||||
data['razorpayKey'] = razorpayKey;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
30
lib/models/payment_model/stripe_model.dart
Normal file
30
lib/models/payment_model/stripe_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class StripeModel {
|
||||
String? stripeSecret;
|
||||
String? clientpublishableKey;
|
||||
bool? isWithdrawEnabled;
|
||||
bool? isEnabled;
|
||||
bool? isSandboxEnabled;
|
||||
String? stripeKey;
|
||||
|
||||
StripeModel({this.stripeSecret, this.clientpublishableKey, this.isWithdrawEnabled, this.isEnabled, this.isSandboxEnabled, this.stripeKey});
|
||||
|
||||
StripeModel.fromJson(Map<String, dynamic> json) {
|
||||
stripeSecret = json['stripeSecret'];
|
||||
clientpublishableKey = json['clientpublishableKey'];
|
||||
isWithdrawEnabled = json['isWithdrawEnabled'];
|
||||
isEnabled = json['isEnabled'];
|
||||
isSandboxEnabled = json['isSandboxEnabled'];
|
||||
stripeKey = json['stripeKey'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['stripeSecret'] = stripeSecret;
|
||||
data['clientpublishableKey'] = clientpublishableKey;
|
||||
data['isWithdrawEnabled'] = isWithdrawEnabled;
|
||||
data['isEnabled'] = isEnabled;
|
||||
data['isSandboxEnabled'] = isSandboxEnabled;
|
||||
data['stripeKey'] = stripeKey;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
15
lib/models/payment_model/wallet_setting_model.dart
Normal file
15
lib/models/payment_model/wallet_setting_model.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class WalletSettingModel {
|
||||
bool? isEnabled;
|
||||
|
||||
WalletSettingModel({this.isEnabled});
|
||||
|
||||
WalletSettingModel.fromJson(Map<String, dynamic> json) {
|
||||
isEnabled = json['isEnabled'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['isEnabled'] = isEnabled;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
34
lib/models/payment_model/xendit.dart
Normal file
34
lib/models/payment_model/xendit.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
class Xendit {
|
||||
bool? enable;
|
||||
String? name;
|
||||
bool? isSandbox;
|
||||
String? apiKey;
|
||||
String? image;
|
||||
|
||||
Xendit({
|
||||
this.name,
|
||||
this.enable,
|
||||
this.apiKey,
|
||||
this.isSandbox,
|
||||
this.image,
|
||||
});
|
||||
|
||||
Xendit.fromJson(Map<String, dynamic> json) {
|
||||
enable = json['enable'];
|
||||
name = json['name'];
|
||||
isSandbox = json['isSandbox'];
|
||||
apiKey = json['apiKey'];
|
||||
image = json['image'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
|
||||
data['enable'] = enable;
|
||||
data['name'] = name;
|
||||
data['isSandbox'] = isSandbox;
|
||||
data['apiKey'] = apiKey;
|
||||
data['image'] = image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
75
lib/models/rating_model.dart
Normal file
75
lib/models/rating_model.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class RatingModel {
|
||||
String? id;
|
||||
|
||||
double? rating;
|
||||
|
||||
List<dynamic>? photos;
|
||||
|
||||
String? comment;
|
||||
|
||||
String? orderId;
|
||||
|
||||
String? customerId;
|
||||
|
||||
String? vendorId;
|
||||
String? productId;
|
||||
String? driverId;
|
||||
String? uname;
|
||||
String? profile;
|
||||
Map<String, dynamic>? reviewAttributes;
|
||||
Timestamp? createdAt;
|
||||
|
||||
RatingModel({
|
||||
this.id = '',
|
||||
this.comment = '',
|
||||
this.photos = const [],
|
||||
this.rating = 0.0,
|
||||
this.orderId = '',
|
||||
this.vendorId = '',
|
||||
this.productId = '',
|
||||
this.driverId = '',
|
||||
this.customerId = '',
|
||||
this.uname = '',
|
||||
this.createdAt,
|
||||
this.reviewAttributes,
|
||||
this.profile = '',
|
||||
});
|
||||
|
||||
factory RatingModel.fromJson(Map<String, dynamic> parsedJson) {
|
||||
return RatingModel(
|
||||
comment: parsedJson['comment'] ?? '',
|
||||
photos: parsedJson['photos'] ?? '',
|
||||
rating: parsedJson['rating'].toDouble() ?? 0.0,
|
||||
id: parsedJson['Id'] ?? '',
|
||||
orderId: parsedJson['orderid'] ?? '',
|
||||
vendorId: parsedJson['VendorId'] ?? '',
|
||||
productId: parsedJson['productId'] ?? '',
|
||||
driverId: parsedJson['driverId'] ?? '',
|
||||
customerId: parsedJson['CustomerId'] ?? '',
|
||||
uname: parsedJson['uname'] ?? '',
|
||||
reviewAttributes: parsedJson['reviewAttributes'] ?? {},
|
||||
createdAt: parsedJson['createdAt'] ?? Timestamp.now(),
|
||||
profile: parsedJson['profile'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'comment': comment,
|
||||
'photos': photos,
|
||||
'rating': rating,
|
||||
'Id': id,
|
||||
'orderid': orderId,
|
||||
'VendorId': vendorId,
|
||||
'productId': productId,
|
||||
'driverId': driverId,
|
||||
'CustomerId': customerId,
|
||||
'uname': uname,
|
||||
'profile': profile,
|
||||
'reviewAttributes': reviewAttributes ?? {},
|
||||
'createdAt': createdAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
21
lib/models/referral_model.dart
Normal file
21
lib/models/referral_model.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
class ReferralModel {
|
||||
String? id;
|
||||
String? referralCode;
|
||||
String? referralBy;
|
||||
|
||||
ReferralModel({this.id, this.referralCode, this.referralBy});
|
||||
|
||||
ReferralModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
referralCode = json['referralCode'];
|
||||
referralBy = json['referralBy'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['referralCode'] = referralCode;
|
||||
data['referralBy'] = referralBy;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
190
lib/models/rental_order_model.dart
Normal file
190
lib/models/rental_order_model.dart
Normal file
@@ -0,0 +1,190 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:driver/models/rental_package_model.dart';
|
||||
import 'package:driver/models/rental_vehicle_type.dart';
|
||||
import 'package:driver/models/tax_model.dart';
|
||||
import 'package:driver/models/user_model.dart';
|
||||
import 'package:driver/models/vendor_model.dart';
|
||||
|
||||
class RentalOrderModel {
|
||||
String? status;
|
||||
List<dynamic>? rejectedByDrivers;
|
||||
String? couponId;
|
||||
Timestamp? bookingDateTime;
|
||||
bool? paymentStatus;
|
||||
String? discount;
|
||||
String? authorID;
|
||||
Timestamp? createdAt;
|
||||
String? adminCommissionType;
|
||||
String? sourceLocationName;
|
||||
List<TaxModel>? taxSetting;
|
||||
String? id;
|
||||
String? adminCommission;
|
||||
String? couponCode;
|
||||
String? sectionId;
|
||||
String? tipAmount;
|
||||
String? vehicleId;
|
||||
String? paymentMethod;
|
||||
RentalVehicleType? rentalVehicleType;
|
||||
RentalPackageModel? rentalPackageModel;
|
||||
String? otpCode;
|
||||
DestinationLocation? sourceLocation;
|
||||
UserModel? author;
|
||||
UserModel? driver;
|
||||
String? driverId;
|
||||
String? subTotal;
|
||||
Timestamp? startTime;
|
||||
Timestamp? endTime;
|
||||
String? startKitoMetersReading;
|
||||
String? endKitoMetersReading;
|
||||
String? zoneId;
|
||||
G? sourcePoint;
|
||||
|
||||
RentalOrderModel({
|
||||
this.status,
|
||||
this.rejectedByDrivers,
|
||||
this.bookingDateTime,
|
||||
this.paymentStatus,
|
||||
this.discount,
|
||||
this.authorID,
|
||||
this.createdAt,
|
||||
this.adminCommissionType,
|
||||
this.sourceLocationName,
|
||||
this.taxSetting,
|
||||
this.id,
|
||||
this.adminCommission,
|
||||
this.couponCode,
|
||||
this.couponId,
|
||||
this.sectionId,
|
||||
this.tipAmount,
|
||||
this.vehicleId,
|
||||
this.paymentMethod,
|
||||
this.rentalVehicleType,
|
||||
this.rentalPackageModel,
|
||||
this.otpCode,
|
||||
this.sourceLocation,
|
||||
this.author,
|
||||
this.subTotal,
|
||||
this.driver,
|
||||
this.driverId,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.startKitoMetersReading,
|
||||
this.endKitoMetersReading,
|
||||
this.zoneId,
|
||||
this.sourcePoint,
|
||||
});
|
||||
|
||||
RentalOrderModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
rejectedByDrivers = json['rejectedByDrivers'] ?? [];
|
||||
couponId = json['couponId'];
|
||||
bookingDateTime = json['bookingDateTime'];
|
||||
paymentStatus = json['paymentStatus'];
|
||||
discount = json['discount'] == null ? "0.0" : json['discount'].toString();
|
||||
authorID = json['authorID'];
|
||||
createdAt = json['createdAt'];
|
||||
adminCommissionType = json['adminCommissionType'];
|
||||
sourceLocationName = json['sourceLocationName'];
|
||||
if (json['taxSetting'] != null) {
|
||||
taxSetting = <TaxModel>[];
|
||||
json['taxSetting'].forEach((v) {
|
||||
taxSetting!.add(TaxModel.fromJson(v));
|
||||
});
|
||||
}
|
||||
id = json['id'];
|
||||
adminCommission = json['adminCommission'];
|
||||
couponCode = json['couponCode'];
|
||||
sectionId = json['sectionId'];
|
||||
tipAmount = json['tip_amount'];
|
||||
vehicleId = json['vehicleId'];
|
||||
paymentMethod = json['paymentMethod'];
|
||||
rentalVehicleType = json['rentalVehicleType'] != null ? RentalVehicleType.fromJson(json['rentalVehicleType']) : null;
|
||||
rentalPackageModel = json['rentalPackageModel'] != null ? RentalPackageModel.fromJson(json['rentalPackageModel']) : null;
|
||||
otpCode = json['otpCode'];
|
||||
sourceLocation = json['sourceLocation'] != null ? DestinationLocation.fromJson(json['sourceLocation']) : null;
|
||||
author = json['author'] != null ? UserModel.fromJson(json['author']) : null;
|
||||
subTotal = json['subTotal'];
|
||||
driver = json['driver'] != null ? UserModel.fromJson(json['driver']) : null;
|
||||
driverId = json['driverId'];
|
||||
startTime = json['startTime'];
|
||||
endTime = json['endTime'];
|
||||
startKitoMetersReading = json['startKitoMetersReading'] ?? "0.0";
|
||||
endKitoMetersReading = json['endKitoMetersReading'] ?? "0.0";
|
||||
zoneId = json['zoneId'];
|
||||
sourcePoint = json['sourcePoint'] != null ? G.fromJson(json['sourcePoint']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
if (rejectedByDrivers != null) {
|
||||
data['rejectedByDrivers'] = rejectedByDrivers;
|
||||
}
|
||||
data['couponId'] = couponId;
|
||||
data['bookingDateTime'] = bookingDateTime;
|
||||
data['paymentStatus'] = paymentStatus;
|
||||
data['discount'] = discount;
|
||||
data['authorID'] = authorID;
|
||||
data['createdAt'] = createdAt;
|
||||
data['adminCommissionType'] = adminCommissionType;
|
||||
data['sourceLocationName'] = sourceLocationName;
|
||||
if (taxSetting != null) {
|
||||
data['taxSetting'] = taxSetting!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['id'] = id;
|
||||
data['adminCommission'] = adminCommission;
|
||||
data['couponCode'] = couponCode;
|
||||
data['sectionId'] = sectionId;
|
||||
data['tip_amount'] = tipAmount;
|
||||
data['vehicleId'] = vehicleId;
|
||||
data['paymentMethod'] = paymentMethod;
|
||||
data['driverId'] = driverId;
|
||||
if (driver != null) {
|
||||
data['driver'] = driver!.toJson();
|
||||
}
|
||||
|
||||
if (rentalVehicleType != null) {
|
||||
data['rentalVehicleType'] = rentalVehicleType!.toJson();
|
||||
}
|
||||
|
||||
if (rentalPackageModel != null) {
|
||||
data['rentalPackageModel'] = rentalPackageModel!.toJson();
|
||||
}
|
||||
data['otpCode'] = otpCode;
|
||||
if (sourceLocation != null) {
|
||||
data['sourceLocation'] = sourceLocation!.toJson();
|
||||
}
|
||||
if (author != null) {
|
||||
data['author'] = author!.toJson();
|
||||
}
|
||||
data['subTotal'] = subTotal;
|
||||
data['startTime'] = startTime;
|
||||
data['endTime'] = endTime;
|
||||
data['startKitoMetersReading'] = startKitoMetersReading;
|
||||
data['endKitoMetersReading'] = endKitoMetersReading;
|
||||
data['zoneId'] = zoneId;
|
||||
if (sourcePoint != null) {
|
||||
data['sourcePoint'] = sourcePoint!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DestinationLocation {
|
||||
double? longitude;
|
||||
double? latitude;
|
||||
|
||||
DestinationLocation({this.longitude, this.latitude});
|
||||
|
||||
DestinationLocation.fromJson(Map<String, dynamic> json) {
|
||||
longitude = json['longitude'];
|
||||
latitude = json['latitude'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['longitude'] = longitude;
|
||||
data['latitude'] = latitude;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
62
lib/models/rental_package_model.dart
Normal file
62
lib/models/rental_package_model.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class RentalPackageModel {
|
||||
String? id;
|
||||
String? vehicleTypeId;
|
||||
String? description;
|
||||
String? ordering;
|
||||
bool? published;
|
||||
String? extraKmFare;
|
||||
String? includedHours;
|
||||
String? extraMinuteFare;
|
||||
String? baseFare;
|
||||
Timestamp? createdAt;
|
||||
String? name;
|
||||
String? includedDistance;
|
||||
|
||||
RentalPackageModel(
|
||||
{this.id,
|
||||
this.vehicleTypeId,
|
||||
this.description,
|
||||
this.ordering,
|
||||
this.published,
|
||||
this.extraKmFare,
|
||||
this.includedHours,
|
||||
this.extraMinuteFare,
|
||||
this.baseFare,
|
||||
this.createdAt,
|
||||
this.name,
|
||||
this.includedDistance});
|
||||
|
||||
RentalPackageModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
vehicleTypeId = json['vehicleTypeId'];
|
||||
description = json['description'];
|
||||
ordering = json['ordering'];
|
||||
published = json['published'];
|
||||
extraKmFare = json['extraKmFare'];
|
||||
includedHours = json['includedHours'];
|
||||
extraMinuteFare = json['extraMinuteFare'];
|
||||
baseFare = json['baseFare'];
|
||||
createdAt = json['createdAt'];
|
||||
name = json['name'];
|
||||
includedDistance = json['includedDistance'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['vehicleTypeId'] = vehicleTypeId;
|
||||
data['description'] = description;
|
||||
data['ordering'] = ordering;
|
||||
data['published'] = published;
|
||||
data['extraKmFare'] = extraKmFare;
|
||||
data['includedHours'] = includedHours;
|
||||
data['extraMinuteFare'] = extraMinuteFare;
|
||||
data['baseFare'] = baseFare;
|
||||
data['createdAt'] = createdAt;
|
||||
data['name'] = name;
|
||||
data['includedDistance'] = includedDistance;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
36
lib/models/rental_vehicle_type.dart
Normal file
36
lib/models/rental_vehicle_type.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
class RentalVehicleType {
|
||||
String? rentalVehicleIcon;
|
||||
String? shortDescription;
|
||||
String? name;
|
||||
String? description;
|
||||
String? id;
|
||||
bool? isActive;
|
||||
String? supportedVehicle;
|
||||
String? capacity;
|
||||
|
||||
RentalVehicleType({this.rentalVehicleIcon, this.shortDescription, this.name, this.description, this.id, this.isActive, this.supportedVehicle, this.capacity});
|
||||
|
||||
RentalVehicleType.fromJson(Map<String, dynamic> json) {
|
||||
rentalVehicleIcon = json['rental_vehicle_icon'];
|
||||
shortDescription = json['short_description'];
|
||||
name = json['name'];
|
||||
description = json['description'];
|
||||
id = json['id'];
|
||||
isActive = json['isActive'];
|
||||
supportedVehicle = json['supported_vehicle'];
|
||||
capacity = json['capacity'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['rental_vehicle_icon'] = rentalVehicleIcon;
|
||||
data['short_description'] = shortDescription;
|
||||
data['name'] = name;
|
||||
data['description'] = description;
|
||||
data['id'] = id;
|
||||
data['isActive'] = isActive;
|
||||
data['supported_vehicle'] = supportedVehicle;
|
||||
data['capacity'] = capacity;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
91
lib/models/section_model.dart
Normal file
91
lib/models/section_model.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'package:driver/models/admin_commission.dart';
|
||||
|
||||
class SectionModel {
|
||||
String? referralAmount;
|
||||
String? serviceType;
|
||||
String? color;
|
||||
String? name;
|
||||
String? sectionImage;
|
||||
String? markerIcon;
|
||||
String? id;
|
||||
bool? isActive;
|
||||
bool? dineInActive;
|
||||
bool? isProductDetails;
|
||||
String? serviceTypeFlag;
|
||||
String? delivery_charge;
|
||||
String? rideType;
|
||||
String? theme;
|
||||
int? nearByRadius;
|
||||
AdminCommission? adminCommision;
|
||||
|
||||
SectionModel({
|
||||
this.referralAmount,
|
||||
this.serviceType,
|
||||
this.color,
|
||||
this.name,
|
||||
this.sectionImage,
|
||||
this.markerIcon,
|
||||
this.id,
|
||||
this.isActive,
|
||||
this.theme,
|
||||
this.adminCommision,
|
||||
this.dineInActive,
|
||||
this.delivery_charge,
|
||||
this.nearByRadius,
|
||||
this.isProductDetails,
|
||||
this.serviceTypeFlag,
|
||||
this.rideType,
|
||||
});
|
||||
|
||||
SectionModel.fromJson(Map<String, dynamic> json) {
|
||||
referralAmount = json['referralAmount'] ?? '';
|
||||
serviceType = json['serviceType'] ?? '';
|
||||
color = json['color'];
|
||||
name = json['name'];
|
||||
sectionImage = json['sectionImage'];
|
||||
markerIcon = json['markerIcon'];
|
||||
id = json['id'];
|
||||
adminCommision = json.containsKey('adminCommision')
|
||||
? AdminCommission.fromJson(json['adminCommision'])
|
||||
: null;
|
||||
isActive = json['isActive'];
|
||||
theme = json['theme'] ?? "theme_2";
|
||||
dineInActive = json['dine_in_active'] ?? false;
|
||||
isProductDetails = json['is_product_details'] ?? false;
|
||||
serviceTypeFlag = json['serviceTypeFlag'] ?? '';
|
||||
delivery_charge = json['delivery_charge'] ?? '';
|
||||
rideType = json['rideType'] ?? 'ride';
|
||||
|
||||
// 👇 Safe parsing for number (handles NaN, double, int)
|
||||
final rawRadius = json['nearByRadius'];
|
||||
if (rawRadius == null || rawRadius is! num || rawRadius.isNaN) {
|
||||
nearByRadius = 5000;
|
||||
} else {
|
||||
nearByRadius = rawRadius.toInt();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['referralAmount'] = referralAmount;
|
||||
data['serviceType'] = serviceType;
|
||||
data['color'] = color;
|
||||
data['name'] = name;
|
||||
data['sectionImage'] = sectionImage;
|
||||
data['markerIcon'] = markerIcon;
|
||||
data['rideType'] = rideType;
|
||||
data['theme'] = theme;
|
||||
if (adminCommision != null) {
|
||||
data['adminCommision'] = adminCommision!.toJson();
|
||||
}
|
||||
data['id'] = id;
|
||||
data['isActive'] = isActive;
|
||||
data['dine_in_active'] = dineInActive;
|
||||
data['is_product_details'] = isProductDetails;
|
||||
data['serviceTypeFlag'] = serviceTypeFlag;
|
||||
data['delivery_charge'] = delivery_charge;
|
||||
data['nearByRadius'] = nearByRadius;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
106
lib/models/subscription_plan_model.dart
Normal file
106
lib/models/subscription_plan_model.dart
Normal file
@@ -0,0 +1,106 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class SubscriptionPlanModel {
|
||||
Timestamp? createdAt;
|
||||
String? description;
|
||||
String? expiryDay;
|
||||
Features? features;
|
||||
String? id;
|
||||
bool? isEnable;
|
||||
String? itemLimit;
|
||||
String? orderLimit;
|
||||
String? name;
|
||||
String? price;
|
||||
String? place;
|
||||
String? image;
|
||||
String? type;
|
||||
List<String>? planPoints;
|
||||
|
||||
SubscriptionPlanModel(
|
||||
{this.createdAt,
|
||||
this.description,
|
||||
this.expiryDay,
|
||||
this.features,
|
||||
this.id,
|
||||
this.isEnable,
|
||||
this.itemLimit,
|
||||
this.orderLimit,
|
||||
this.name,
|
||||
this.price,
|
||||
this.place,
|
||||
this.image,
|
||||
this.type,
|
||||
this.planPoints});
|
||||
|
||||
factory SubscriptionPlanModel.fromJson(Map<String, dynamic> json) {
|
||||
return SubscriptionPlanModel(
|
||||
createdAt: json['createdAt'],
|
||||
description: json['description'],
|
||||
expiryDay: json['expiryDay'],
|
||||
features: json['features'] == null ? null : Features.fromJson(json['features']),
|
||||
id: json['id'],
|
||||
isEnable: json['isEnable'],
|
||||
itemLimit: json['itemLimit'],
|
||||
orderLimit: json['orderLimit'],
|
||||
name: json['name'],
|
||||
price: json['price'],
|
||||
place: json['place'],
|
||||
image: json['image'],
|
||||
type: json['type'],
|
||||
planPoints: json['plan_points'] == null ? [] : List<String>.from(json['plan_points']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'createdAt': createdAt,
|
||||
'description': description,
|
||||
'expiryDay': expiryDay.toString(),
|
||||
'features': features?.toJson(),
|
||||
'id': id,
|
||||
'isEnable': isEnable,
|
||||
'itemLimit': itemLimit.toString(),
|
||||
'orderLimit': orderLimit.toString(),
|
||||
'name': name,
|
||||
'price': price.toString(),
|
||||
'place': place.toString(),
|
||||
'image': image.toString(),
|
||||
'type': type,
|
||||
'plan_points': planPoints
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class Features {
|
||||
bool? chat;
|
||||
bool? dineIn;
|
||||
bool? qrCodeGenerate;
|
||||
bool? restaurantMobileApp;
|
||||
|
||||
Features({
|
||||
this.chat,
|
||||
this.dineIn,
|
||||
this.qrCodeGenerate,
|
||||
this.restaurantMobileApp,
|
||||
});
|
||||
|
||||
// Factory constructor to create an instance from JSON
|
||||
factory Features.fromJson(Map<String, dynamic> json) {
|
||||
return Features(
|
||||
chat: json['chat'] ?? false,
|
||||
dineIn: json['dineIn'] ?? false,
|
||||
qrCodeGenerate: json['qrCodeGenerate'] ?? false,
|
||||
restaurantMobileApp: json['restaurantMobileApp'] ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
// Method to convert an instance to JSON
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'chat': chat,
|
||||
'dineIn': dineIn,
|
||||
'qrCodeGenerate': qrCodeGenerate,
|
||||
'restaurantMobileApp': restaurantMobileApp,
|
||||
};
|
||||
}
|
||||
}
|
||||
30
lib/models/tax_model.dart
Normal file
30
lib/models/tax_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class TaxModel {
|
||||
String? country;
|
||||
bool? enable;
|
||||
String? tax;
|
||||
String? id;
|
||||
String? type;
|
||||
String? title;
|
||||
|
||||
TaxModel({this.country, this.enable, this.tax, this.id, this.type, this.title});
|
||||
|
||||
TaxModel.fromJson(Map<String, dynamic> json) {
|
||||
country = json['country'];
|
||||
enable = json['enable'];
|
||||
tax = json['tax'];
|
||||
id = json['id'];
|
||||
type = json['type'];
|
||||
title = json['title'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['country'] = country;
|
||||
data['enable'] = enable;
|
||||
data['tax'] = tax;
|
||||
data['id'] = id;
|
||||
data['type'] = type;
|
||||
data['title'] = title;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
316
lib/models/user_model.dart
Normal file
316
lib/models/user_model.dart
Normal file
@@ -0,0 +1,316 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:driver/constant/constant.dart';
|
||||
import 'package:driver/models/admin_commission.dart';
|
||||
import 'package:driver/models/cab_order_model.dart';
|
||||
import 'package:driver/models/subscription_plan_model.dart';
|
||||
|
||||
class UserModel {
|
||||
String? id;
|
||||
String? firstName;
|
||||
String? lastName;
|
||||
String? email;
|
||||
String? profilePictureURL;
|
||||
String? fcmToken;
|
||||
String? countryCode;
|
||||
String? phoneNumber;
|
||||
num? walletAmount;
|
||||
bool? active;
|
||||
bool? isActive;
|
||||
bool? isDocumentVerify;
|
||||
Timestamp? createdAt;
|
||||
String? role;
|
||||
UserLocation? location;
|
||||
UserBankDetails? userBankDetails;
|
||||
List<ShippingAddress>? shippingAddress;
|
||||
String? carName;
|
||||
String? carNumber;
|
||||
String? carPictureURL;
|
||||
List<dynamic>? inProgressOrderID;
|
||||
List<dynamic>? orderRequestData;
|
||||
String? vendorID;
|
||||
String? zoneId;
|
||||
num? rotation;
|
||||
String? appIdentifier;
|
||||
String? provider;
|
||||
String? subscriptionPlanId;
|
||||
Timestamp? subscriptionExpiryDate;
|
||||
SubscriptionPlanModel? subscriptionPlan;
|
||||
String? serviceType;
|
||||
String? sectionId;
|
||||
String? vehicleId;
|
||||
String? vehicleType;
|
||||
String? carMakes;
|
||||
String? reviewsCount;
|
||||
String? reviewsSum;
|
||||
AdminCommission? adminCommissionModel;
|
||||
CabOrderModel? orderCabRequestData;
|
||||
String? rideType;
|
||||
String? ownerId;
|
||||
bool? isOwner;
|
||||
|
||||
UserModel({
|
||||
this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.active,
|
||||
this.isActive,
|
||||
this.isDocumentVerify,
|
||||
this.email,
|
||||
this.profilePictureURL,
|
||||
this.fcmToken,
|
||||
this.countryCode,
|
||||
this.phoneNumber,
|
||||
this.walletAmount,
|
||||
this.createdAt,
|
||||
this.role,
|
||||
this.location,
|
||||
this.shippingAddress,
|
||||
this.carName,
|
||||
this.carNumber,
|
||||
this.carPictureURL,
|
||||
this.inProgressOrderID,
|
||||
this.orderRequestData,
|
||||
this.vendorID,
|
||||
this.zoneId,
|
||||
this.rotation,
|
||||
this.appIdentifier,
|
||||
this.provider,
|
||||
this.subscriptionPlanId,
|
||||
this.subscriptionExpiryDate,
|
||||
this.subscriptionPlan,
|
||||
this.serviceType,
|
||||
this.sectionId,
|
||||
this.vehicleId,
|
||||
this.vehicleType,
|
||||
this.carMakes,
|
||||
this.reviewsCount,
|
||||
this.reviewsSum,
|
||||
this.adminCommissionModel,
|
||||
this.orderCabRequestData,
|
||||
this.rideType,
|
||||
this.ownerId,
|
||||
this.isOwner,
|
||||
});
|
||||
|
||||
String fullName() {
|
||||
return "${firstName ?? ''} ${lastName ?? ''}";
|
||||
}
|
||||
|
||||
double get averageRating {
|
||||
final double sum = double.tryParse(reviewsSum ?? '0') ?? 0.0;
|
||||
final double count = double.tryParse(reviewsCount ?? '0') ?? 0.0;
|
||||
|
||||
if (count <= 0) return 0.0;
|
||||
return sum / count;
|
||||
}
|
||||
|
||||
UserModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
email = json['email'];
|
||||
firstName = json['firstName'];
|
||||
lastName = json['lastName'];
|
||||
profilePictureURL = json['profilePictureURL'];
|
||||
fcmToken = json['fcmToken'];
|
||||
countryCode = json['countryCode'];
|
||||
phoneNumber = json['phoneNumber'];
|
||||
walletAmount = json['wallet_amount'] ?? 0;
|
||||
createdAt = json['createdAt'];
|
||||
active = json['active'];
|
||||
isActive = json['isActive'];
|
||||
isDocumentVerify = json['isDocumentVerify'] ?? false;
|
||||
role = json['role'] ?? 'user';
|
||||
location = json['location'] != null ? UserLocation.fromJson(json['location']) : null;
|
||||
userBankDetails = json['userBankDetails'] != null ? UserBankDetails.fromJson(json['userBankDetails']) : null;
|
||||
if (json['shippingAddress'] != null) {
|
||||
shippingAddress = <ShippingAddress>[];
|
||||
json['shippingAddress'].forEach((v) {
|
||||
shippingAddress!.add(ShippingAddress.fromJson(v));
|
||||
});
|
||||
}
|
||||
carName = json['carName'];
|
||||
carNumber = json['carNumber'];
|
||||
carPictureURL = json['carPictureURL'];
|
||||
inProgressOrderID = json['inProgressOrderID'] ?? [];
|
||||
orderRequestData = json['orderRequestData'] ?? [];
|
||||
vendorID = json['vendorID'] ?? '';
|
||||
zoneId = json['zoneId'] ?? '';
|
||||
rotation = json['rotation'];
|
||||
appIdentifier = json['appIdentifier'];
|
||||
provider = json['provider'];
|
||||
subscriptionPlanId = json['subscriptionPlanId'];
|
||||
subscriptionExpiryDate = json['subscriptionExpiryDate'];
|
||||
subscriptionPlan = json['subscription_plan'] != null ? SubscriptionPlanModel.fromJson(json['subscription_plan']) : null;
|
||||
serviceType = json['serviceType'];
|
||||
sectionId = json['sectionId'] ?? '';
|
||||
vehicleId = json['vehicleId'];
|
||||
vehicleType = json['vehicleType'];
|
||||
carMakes = json['carMakes'];
|
||||
reviewsCount = json['reviewsCount'] == null ? '0' : json['reviewsCount'].toString();
|
||||
reviewsSum = json['reviewsSum'] == null ? '0' : json['reviewsSum'].toString();
|
||||
adminCommissionModel = json['adminCommission'] != null ? AdminCommission.fromJson(json['adminCommission']) : null;
|
||||
orderCabRequestData = json['ordercabRequestData'] != null ? CabOrderModel.fromJson(json['ordercabRequestData']) : null;
|
||||
rideType = json['rideType'];
|
||||
ownerId = json['ownerId'];
|
||||
isOwner = json['isOwner'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['email'] = email;
|
||||
data['firstName'] = firstName;
|
||||
data['lastName'] = lastName;
|
||||
data['profilePictureURL'] = profilePictureURL;
|
||||
data['fcmToken'] = fcmToken;
|
||||
data['countryCode'] = countryCode;
|
||||
data['phoneNumber'] = phoneNumber;
|
||||
data['wallet_amount'] = walletAmount ?? 0;
|
||||
data['createdAt'] = createdAt;
|
||||
data['active'] = active;
|
||||
data['isActive'] = isActive;
|
||||
data['role'] = role;
|
||||
data['isDocumentVerify'] = isDocumentVerify;
|
||||
data['zoneId'] = zoneId;
|
||||
data['sectionId'] = sectionId ?? '';
|
||||
|
||||
if (location != null) {
|
||||
data['location'] = location!.toJson();
|
||||
}
|
||||
if (userBankDetails != null) {
|
||||
data['userBankDetails'] = userBankDetails!.toJson();
|
||||
}
|
||||
if (shippingAddress != null) {
|
||||
data['shippingAddress'] = shippingAddress!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['serviceType'] = serviceType;
|
||||
data['rotation'] = rotation;
|
||||
data['inProgressOrderID'] = inProgressOrderID;
|
||||
|
||||
if (role == Constant.userRoleDriver) {
|
||||
data['vendorID'] = vendorID;
|
||||
data['carName'] = carName;
|
||||
data['carNumber'] = carNumber;
|
||||
data['carPictureURL'] = carPictureURL;
|
||||
data['orderRequestData'] = orderRequestData;
|
||||
|
||||
data['vehicleType'] = vehicleType;
|
||||
data['carMakes'] = carMakes;
|
||||
data['vehicleId'] = vehicleId ?? '';
|
||||
if (orderCabRequestData != null) {
|
||||
data['ordercabRequestData'] = orderCabRequestData!.toJson();
|
||||
}
|
||||
data['rideType'] = rideType;
|
||||
data['ownerId'] = ownerId;
|
||||
data['isOwner'] = isOwner;
|
||||
}
|
||||
if (role == Constant.userRoleVendor) {
|
||||
data['vendorID'] = vendorID;
|
||||
data['subscriptionPlanId'] = subscriptionPlanId;
|
||||
data['subscriptionExpiryDate'] = subscriptionExpiryDate;
|
||||
data['subscription_plan'] = subscriptionPlan?.toJson();
|
||||
}
|
||||
data['appIdentifier'] = appIdentifier;
|
||||
data['provider'] = provider;
|
||||
data['reviewsCount'] = reviewsCount;
|
||||
data['reviewsSum'] = reviewsSum;
|
||||
if (adminCommissionModel != null) {
|
||||
data['adminCommission'] = adminCommissionModel!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class UserLocation {
|
||||
double? latitude;
|
||||
double? longitude;
|
||||
|
||||
UserLocation({this.latitude, this.longitude});
|
||||
|
||||
UserLocation.fromJson(Map<String, dynamic> json) {
|
||||
latitude = json['latitude'];
|
||||
longitude = json['longitude'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['latitude'] = latitude;
|
||||
data['longitude'] = longitude;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ShippingAddress {
|
||||
String? id;
|
||||
String? address;
|
||||
String? addressAs;
|
||||
String? landmark;
|
||||
String? locality;
|
||||
UserLocation? location;
|
||||
bool? isDefault;
|
||||
|
||||
ShippingAddress({this.address, this.landmark, this.locality, this.location, this.isDefault, this.addressAs, this.id});
|
||||
|
||||
ShippingAddress.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
address = json['address'];
|
||||
landmark = json['landmark'];
|
||||
locality = json['locality'];
|
||||
isDefault = json['isDefault'];
|
||||
addressAs = json['addressAs'];
|
||||
location = json['location'] == null ? null : UserLocation.fromJson(json['location']);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['address'] = address;
|
||||
data['landmark'] = landmark;
|
||||
data['locality'] = locality;
|
||||
data['isDefault'] = isDefault;
|
||||
data['addressAs'] = addressAs;
|
||||
if (location != null) {
|
||||
data['location'] = location!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
String getFullAddress() {
|
||||
return '${address == null || address!.isEmpty ? "" : address} $locality ${landmark == null || landmark!.isEmpty ? "" : landmark.toString()}';
|
||||
}
|
||||
}
|
||||
|
||||
class UserBankDetails {
|
||||
String bankName;
|
||||
String branchName;
|
||||
String holderName;
|
||||
String accountNumber;
|
||||
String otherDetails;
|
||||
|
||||
UserBankDetails({
|
||||
this.bankName = '',
|
||||
this.otherDetails = '',
|
||||
this.branchName = '',
|
||||
this.accountNumber = '',
|
||||
this.holderName = '',
|
||||
});
|
||||
|
||||
factory UserBankDetails.fromJson(Map<String, dynamic> parsedJson) {
|
||||
return UserBankDetails(
|
||||
bankName: parsedJson['bankName'] ?? '',
|
||||
branchName: parsedJson['branchName'] ?? '',
|
||||
holderName: parsedJson['holderName'] ?? '',
|
||||
accountNumber: parsedJson['accountNumber'] ?? '',
|
||||
otherDetails: parsedJson['otherDetails'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'bankName': bankName,
|
||||
'branchName': branchName,
|
||||
'holderName': holderName,
|
||||
'accountNumber': accountNumber,
|
||||
'otherDetails': otherDetails,
|
||||
};
|
||||
}
|
||||
}
|
||||
56
lib/models/vehicle_type.dart
Normal file
56
lib/models/vehicle_type.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
class VehicleType {
|
||||
String? shortDescription;
|
||||
String? vehicleIcon;
|
||||
String? name;
|
||||
String? description;
|
||||
String? id;
|
||||
bool? isActive;
|
||||
String? capacity;
|
||||
String? supportedVehicle;
|
||||
num? delivery_charges_per_km;
|
||||
num? minimum_delivery_charges;
|
||||
num? minimum_delivery_charges_within_km;
|
||||
|
||||
VehicleType(
|
||||
{this.shortDescription,
|
||||
this.vehicleIcon,
|
||||
this.name,
|
||||
this.description,
|
||||
this.id,
|
||||
this.isActive,
|
||||
this.capacity,
|
||||
this.delivery_charges_per_km,
|
||||
this.minimum_delivery_charges,
|
||||
this.minimum_delivery_charges_within_km,
|
||||
this.supportedVehicle});
|
||||
|
||||
VehicleType.fromJson(Map<String, dynamic> json) {
|
||||
shortDescription = json['short_description'];
|
||||
vehicleIcon = json['vehicle_icon'];
|
||||
name = json['name'];
|
||||
description = json['description'];
|
||||
id = json['id'];
|
||||
isActive = json['isActive'];
|
||||
capacity = json['capacity'];
|
||||
delivery_charges_per_km = json['delivery_charges_per_km'] ?? 0.0;
|
||||
minimum_delivery_charges = json['minimum_delivery_charges'] ?? 0.0;
|
||||
minimum_delivery_charges_within_km = json['minimum_delivery_charges_within_km'] ?? 0.0;
|
||||
supportedVehicle = json['supported_vehicle'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['short_description'] = shortDescription;
|
||||
data['vehicle_icon'] = vehicleIcon;
|
||||
data['name'] = name;
|
||||
data['description'] = description;
|
||||
data['id'] = id;
|
||||
data['isActive'] = isActive;
|
||||
data['capacity'] = capacity;
|
||||
data['supported_vehicle'] = supportedVehicle;
|
||||
data['delivery_charges_per_km'] = delivery_charges_per_km;
|
||||
data['minimum_delivery_charges'] = minimum_delivery_charges;
|
||||
data['minimum_delivery_charges_within_km'] = minimum_delivery_charges_within_km;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
391
lib/models/vendor_model.dart
Normal file
391
lib/models/vendor_model.dart
Normal file
@@ -0,0 +1,391 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:driver/models/admin_commission.dart';
|
||||
import 'package:driver/models/subscription_plan_model.dart';
|
||||
|
||||
class VendorModel {
|
||||
String? author;
|
||||
bool? dineInActive;
|
||||
String? openDineTime;
|
||||
List<dynamic>? categoryID;
|
||||
String? id;
|
||||
String? categoryPhoto;
|
||||
List<dynamic>? restaurantMenuPhotos;
|
||||
List<WorkingHours>? workingHours;
|
||||
String? location;
|
||||
String? fcmToken;
|
||||
G? g;
|
||||
bool? hidephotos;
|
||||
bool? reststatus;
|
||||
Filters? filters;
|
||||
AdminCommission? adminCommission;
|
||||
String? photo;
|
||||
String? description;
|
||||
num? walletAmount;
|
||||
String? closeDineTime;
|
||||
String? zoneId;
|
||||
Timestamp? createdAt;
|
||||
double? longitude;
|
||||
bool? enabledDiveInFuture;
|
||||
String? restaurantCost;
|
||||
DeliveryCharge? deliveryCharge;
|
||||
String? authorProfilePic;
|
||||
String? authorName;
|
||||
String? phonenumber;
|
||||
List<SpecialDiscount>? specialDiscount;
|
||||
bool? specialDiscountEnable;
|
||||
GeoPoint? coordinates;
|
||||
num? reviewsSum;
|
||||
num? reviewsCount;
|
||||
List<dynamic>? photos;
|
||||
String? title;
|
||||
List<dynamic>? categoryTitle;
|
||||
double? latitude;
|
||||
String? subscriptionPlanId;
|
||||
Timestamp? subscriptionExpiryDate;
|
||||
SubscriptionPlanModel? subscriptionPlan;
|
||||
String? subscriptionTotalOrders;
|
||||
bool? isSelfDelivery;
|
||||
|
||||
VendorModel({
|
||||
this.author,
|
||||
this.dineInActive,
|
||||
this.openDineTime,
|
||||
this.categoryID,
|
||||
this.id,
|
||||
this.categoryPhoto,
|
||||
this.restaurantMenuPhotos,
|
||||
this.workingHours,
|
||||
this.location,
|
||||
this.fcmToken,
|
||||
this.g,
|
||||
this.hidephotos,
|
||||
this.reststatus,
|
||||
this.filters,
|
||||
this.reviewsCount,
|
||||
this.photo,
|
||||
this.description,
|
||||
this.walletAmount,
|
||||
this.closeDineTime,
|
||||
this.zoneId,
|
||||
this.createdAt,
|
||||
this.longitude,
|
||||
this.enabledDiveInFuture,
|
||||
this.restaurantCost,
|
||||
this.deliveryCharge,
|
||||
this.adminCommission,
|
||||
this.authorProfilePic,
|
||||
this.authorName,
|
||||
this.phonenumber,
|
||||
this.specialDiscount,
|
||||
this.specialDiscountEnable,
|
||||
this.coordinates,
|
||||
this.reviewsSum,
|
||||
this.photos,
|
||||
this.title,
|
||||
this.categoryTitle,
|
||||
this.latitude,
|
||||
this.subscriptionPlanId,
|
||||
this.subscriptionExpiryDate,
|
||||
this.subscriptionPlan,
|
||||
this.subscriptionTotalOrders,
|
||||
this.isSelfDelivery,
|
||||
});
|
||||
|
||||
VendorModel.fromJson(Map<String, dynamic> json) {
|
||||
author = json['author'];
|
||||
dineInActive = json['dine_in_active'];
|
||||
openDineTime = json['openDineTime'];
|
||||
if (json['categoryID'].runtimeType != String) {
|
||||
categoryID = json['categoryID'] ?? [];
|
||||
}
|
||||
id = json['id'];
|
||||
categoryPhoto = json['categoryPhoto'];
|
||||
restaurantMenuPhotos = json['restaurantMenuPhotos'] ?? [];
|
||||
if (json['workingHours'] != null) {
|
||||
workingHours = <WorkingHours>[];
|
||||
json['workingHours'].forEach((v) {
|
||||
workingHours!.add(WorkingHours.fromJson(v));
|
||||
});
|
||||
}
|
||||
location = json['location'];
|
||||
fcmToken = json['fcmToken'];
|
||||
g = json['g'] != null ? G.fromJson(json['g']) : null;
|
||||
hidephotos = json['hidephotos'];
|
||||
reststatus = json['reststatus'];
|
||||
filters = json['filters'] != null ? Filters.fromJson(json['filters']) : null;
|
||||
reviewsCount = json['reviewsCount'] ?? 0.0;
|
||||
photo = json['photo'];
|
||||
description = json['description'];
|
||||
walletAmount = json['walletAmount'];
|
||||
closeDineTime = json['closeDineTime'];
|
||||
zoneId = json['zoneId'];
|
||||
createdAt = json['createdAt'];
|
||||
longitude = double.parse(json['longitude'].toString());
|
||||
enabledDiveInFuture = json['enabledDiveInFuture'];
|
||||
restaurantCost = json['restaurantCost']?.toString();
|
||||
deliveryCharge = json['DeliveryCharge'] != null ? DeliveryCharge.fromJson(json['DeliveryCharge']) : null;
|
||||
adminCommission = json['adminCommission'] != null ? AdminCommission.fromJson(json['adminCommission']) : null;
|
||||
authorProfilePic = json['authorProfilePic'];
|
||||
authorName = json['authorName'];
|
||||
phonenumber = json['phonenumber'];
|
||||
if (json['specialDiscount'] != null) {
|
||||
specialDiscount = <SpecialDiscount>[];
|
||||
json['specialDiscount'].forEach((v) {
|
||||
specialDiscount!.add(SpecialDiscount.fromJson(v));
|
||||
});
|
||||
}
|
||||
specialDiscountEnable = json['specialDiscountEnable'];
|
||||
coordinates = json['coordinates'];
|
||||
reviewsSum = json['reviewsSum'] ?? 0.0;
|
||||
photos = json['photos'] ?? [];
|
||||
title = json['title'];
|
||||
if (json['categoryTitle'].runtimeType != String) {
|
||||
categoryTitle = json['categoryTitle'] ?? [];
|
||||
}
|
||||
latitude = double.parse(json['latitude'].toString());
|
||||
subscriptionPlanId = json['subscriptionPlanId'];
|
||||
subscriptionExpiryDate = json['subscriptionExpiryDate'];
|
||||
subscriptionPlan = json['subscription_plan'] != null ? SubscriptionPlanModel.fromJson(json['subscription_plan']) : null;
|
||||
subscriptionTotalOrders = json['subscriptionTotalOrders'];
|
||||
isSelfDelivery = json['isSelfDelivery'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['author'] = author;
|
||||
data['dine_in_active'] = dineInActive;
|
||||
data['openDineTime'] = openDineTime;
|
||||
data['categoryID'] = categoryID;
|
||||
data['id'] = id;
|
||||
data['categoryPhoto'] = categoryPhoto;
|
||||
data['restaurantMenuPhotos'] = restaurantMenuPhotos;
|
||||
data['subscriptionPlanId'] = subscriptionPlanId;
|
||||
data['subscriptionExpiryDate'] = subscriptionExpiryDate;
|
||||
data['subscription_plan'] = subscriptionPlan?.toJson();
|
||||
if (workingHours != null) {
|
||||
data['workingHours'] = workingHours!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['location'] = location;
|
||||
data['fcmToken'] = fcmToken;
|
||||
if (g != null) {
|
||||
data['g'] = g!.toJson();
|
||||
}
|
||||
data['hidephotos'] = hidephotos;
|
||||
data['reststatus'] = reststatus;
|
||||
if (filters != null) {
|
||||
data['filters'] = filters!.toJson();
|
||||
}
|
||||
data['reviewsCount'] = reviewsCount;
|
||||
data['photo'] = photo;
|
||||
data['description'] = description;
|
||||
data['walletAmount'] = walletAmount;
|
||||
data['closeDineTime'] = closeDineTime;
|
||||
data['zoneId'] = zoneId;
|
||||
data['createdAt'] = createdAt;
|
||||
data['longitude'] = longitude;
|
||||
data['enabledDiveInFuture'] = enabledDiveInFuture;
|
||||
data['restaurantCost'] = restaurantCost;
|
||||
if (deliveryCharge != null) {
|
||||
data['DeliveryCharge'] = deliveryCharge!.toJson();
|
||||
}
|
||||
if (adminCommission != null) {
|
||||
data['adminCommission'] = adminCommission!.toJson();
|
||||
}
|
||||
data['authorProfilePic'] = authorProfilePic;
|
||||
data['authorName'] = authorName;
|
||||
data['phonenumber'] = phonenumber;
|
||||
if (specialDiscount != null) {
|
||||
data['specialDiscount'] = specialDiscount!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['specialDiscountEnable'] = specialDiscountEnable;
|
||||
data['coordinates'] = coordinates;
|
||||
data['reviewsSum'] = reviewsSum;
|
||||
data['photos'] = photos;
|
||||
data['title'] = title;
|
||||
data['categoryTitle'] = categoryTitle;
|
||||
data['latitude'] = latitude;
|
||||
data['subscriptionTotalOrders'] = subscriptionTotalOrders;
|
||||
data['isSelfDelivery'] = isSelfDelivery;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class WorkingHours {
|
||||
String? day;
|
||||
List<Timeslot>? timeslot;
|
||||
|
||||
WorkingHours({this.day, this.timeslot});
|
||||
|
||||
WorkingHours.fromJson(Map<String, dynamic> json) {
|
||||
day = json['day'];
|
||||
if (json['timeslot'] != null) {
|
||||
timeslot = <Timeslot>[];
|
||||
json['timeslot'].forEach((v) {
|
||||
timeslot!.add(Timeslot.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['day'] = day;
|
||||
if (timeslot != null) {
|
||||
data['timeslot'] = timeslot!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Timeslot {
|
||||
String? to;
|
||||
String? from;
|
||||
|
||||
Timeslot({this.to, this.from});
|
||||
|
||||
Timeslot.fromJson(Map<String, dynamic> json) {
|
||||
to = json['to'];
|
||||
from = json['from'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['to'] = to;
|
||||
data['from'] = from;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class G {
|
||||
String? geohash;
|
||||
GeoPoint? geopoint;
|
||||
|
||||
G({this.geohash, this.geopoint});
|
||||
|
||||
G.fromJson(Map<String, dynamic> json) {
|
||||
geohash = json['geohash'];
|
||||
geopoint = json['geopoint'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['geohash'] = geohash;
|
||||
data['geopoint'] = geopoint;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Filters {
|
||||
String? goodForLunch;
|
||||
String? outdoorSeating;
|
||||
String? liveMusic;
|
||||
String? vegetarianFriendly;
|
||||
String? goodForDinner;
|
||||
String? goodForBreakfast;
|
||||
String? freeWiFi;
|
||||
String? takesReservations;
|
||||
|
||||
Filters({this.goodForLunch, this.outdoorSeating, this.liveMusic, this.vegetarianFriendly, this.goodForDinner, this.goodForBreakfast, this.freeWiFi, this.takesReservations});
|
||||
|
||||
Filters.fromJson(Map<String, dynamic> json) {
|
||||
goodForLunch = json['Good for Lunch'];
|
||||
outdoorSeating = json['Outdoor Seating'];
|
||||
liveMusic = json['Live Music'];
|
||||
vegetarianFriendly = json['Vegetarian Friendly'];
|
||||
goodForDinner = json['Good for Dinner'];
|
||||
goodForBreakfast = json['Good for Breakfast'];
|
||||
freeWiFi = json['Free Wi-Fi'];
|
||||
takesReservations = json['Takes Reservations'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['Good for Lunch'] = goodForLunch;
|
||||
data['Outdoor Seating'] = outdoorSeating;
|
||||
data['Live Music'] = liveMusic;
|
||||
data['Vegetarian Friendly'] = vegetarianFriendly;
|
||||
data['Good for Dinner'] = goodForDinner;
|
||||
data['Good for Breakfast'] = goodForBreakfast;
|
||||
data['Free Wi-Fi'] = freeWiFi;
|
||||
data['Takes Reservations'] = takesReservations;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class DeliveryCharge {
|
||||
num? minimumDeliveryChargesWithinKm;
|
||||
num? minimumDeliveryCharges;
|
||||
num? deliveryChargesPerKm;
|
||||
bool? vendorCanModify;
|
||||
|
||||
DeliveryCharge({this.minimumDeliveryChargesWithinKm, this.minimumDeliveryCharges, this.deliveryChargesPerKm, this.vendorCanModify});
|
||||
|
||||
DeliveryCharge.fromJson(Map<String, dynamic> json) {
|
||||
minimumDeliveryChargesWithinKm = json['minimum_delivery_charges_within_km'];
|
||||
minimumDeliveryCharges = json['minimum_delivery_charges'];
|
||||
deliveryChargesPerKm = json['delivery_charges_per_km'];
|
||||
vendorCanModify = json['vendor_can_modify'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['minimum_delivery_charges_within_km'] = minimumDeliveryChargesWithinKm;
|
||||
data['minimum_delivery_charges'] = minimumDeliveryCharges;
|
||||
data['delivery_charges_per_km'] = deliveryChargesPerKm;
|
||||
data['vendor_can_modify'] = vendorCanModify;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class SpecialDiscount {
|
||||
String? day;
|
||||
List<SpecialDiscountTimeslot>? timeslot;
|
||||
|
||||
SpecialDiscount({this.day, this.timeslot});
|
||||
|
||||
SpecialDiscount.fromJson(Map<String, dynamic> json) {
|
||||
day = json['day'];
|
||||
if (json['timeslot'] != null) {
|
||||
timeslot = <SpecialDiscountTimeslot>[];
|
||||
json['timeslot'].forEach((v) {
|
||||
timeslot!.add(SpecialDiscountTimeslot.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['day'] = day;
|
||||
if (timeslot != null) {
|
||||
data['timeslot'] = timeslot!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class SpecialDiscountTimeslot {
|
||||
String? discount;
|
||||
String? discountType;
|
||||
String? to;
|
||||
String? type;
|
||||
String? from;
|
||||
|
||||
SpecialDiscountTimeslot({this.discount, this.discountType, this.to, this.type, this.from});
|
||||
|
||||
SpecialDiscountTimeslot.fromJson(Map<String, dynamic> json) {
|
||||
discount = json['discount'];
|
||||
discountType = json['discount_type'];
|
||||
to = json['to'];
|
||||
type = json['type'];
|
||||
from = json['from'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['discount'] = discount;
|
||||
data['discount_type'] = discountType;
|
||||
data['to'] = to;
|
||||
data['type'] = type;
|
||||
data['from'] = from;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
55
lib/models/wallet_transaction_model.dart
Normal file
55
lib/models/wallet_transaction_model.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class WalletTransactionModel {
|
||||
String? userId;
|
||||
String? paymentMethod;
|
||||
double? amount;
|
||||
bool? isTopup;
|
||||
String? orderId;
|
||||
String? paymentStatus;
|
||||
Timestamp? date;
|
||||
String? id;
|
||||
String? transactionUser;
|
||||
String? note;
|
||||
|
||||
WalletTransactionModel({
|
||||
this.userId,
|
||||
this.paymentMethod,
|
||||
this.amount,
|
||||
this.isTopup,
|
||||
this.orderId,
|
||||
this.paymentStatus,
|
||||
this.date,
|
||||
this.id,
|
||||
this.transactionUser,
|
||||
this.note,
|
||||
});
|
||||
|
||||
WalletTransactionModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userId = json['user_id'];
|
||||
paymentMethod = json['payment_method'];
|
||||
amount = double.parse("${json['amount'] ?? 0.0}");
|
||||
isTopup = json['isTopUp'];
|
||||
orderId = json['order_id'];
|
||||
paymentStatus = json['payment_status'];
|
||||
date = json['date'];
|
||||
transactionUser = json['transactionUser'] ?? 'customer';
|
||||
note = json['note'] ?? 'Wallet Top-up';
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['user_id'] = userId;
|
||||
data['payment_method'] = paymentMethod;
|
||||
data['amount'] = amount;
|
||||
data['isTopUp'] = isTopup;
|
||||
data['order_id'] = orderId;
|
||||
data['payment_status'] = paymentStatus;
|
||||
data['date'] = date;
|
||||
data['transactionUser'] = transactionUser;
|
||||
data['note'] = note;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
117
lib/models/withdraw_method_model.dart
Normal file
117
lib/models/withdraw_method_model.dart
Normal file
@@ -0,0 +1,117 @@
|
||||
class WithdrawMethodModel {
|
||||
String? id;
|
||||
String? userId;
|
||||
FlutterWave? flutterWave;
|
||||
Paypal? paypal;
|
||||
RazorpayModel? razorpay;
|
||||
Stripe? stripe;
|
||||
|
||||
WithdrawMethodModel({this.id, this.userId, this.flutterWave, this.stripe, this.razorpay, this.paypal});
|
||||
|
||||
WithdrawMethodModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'] ?? "";
|
||||
userId = json['userId'] ?? "";
|
||||
flutterWave = json['flutterwave'] != null ? FlutterWave.fromJson(json['flutterwave']) : null;
|
||||
stripe = json['stripe'] != null ? Stripe.fromJson(json['stripe']) : null;
|
||||
razorpay = json['razorpay'] != null ? RazorpayModel.fromJson(json['razorpay']) : null;
|
||||
paypal = json['paypal'] != null ? Paypal.fromJson(json['paypal']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['userId'] = userId;
|
||||
if (flutterWave != null) {
|
||||
data['flutterwave'] = flutterWave!.toJson();
|
||||
}
|
||||
if (razorpay != null) {
|
||||
data['razorpay'] = razorpay!.toJson();
|
||||
}
|
||||
if (paypal != null) {
|
||||
data['paypal'] = paypal!.toJson();
|
||||
}
|
||||
if (stripe != null) {
|
||||
data['stripe'] = stripe!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class FlutterWave {
|
||||
String? name;
|
||||
String? accountNumber;
|
||||
String? bankCode;
|
||||
|
||||
FlutterWave({this.name, this.accountNumber, this.bankCode});
|
||||
|
||||
FlutterWave.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'] ?? "FlutterWave";
|
||||
accountNumber = json['accountNumber'];
|
||||
bankCode = json['bankCode'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['name'] = name;
|
||||
data['accountNumber'] = accountNumber;
|
||||
data['bankCode'] = bankCode;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Stripe {
|
||||
String? name;
|
||||
String? accountId;
|
||||
|
||||
Stripe({this.name, this.accountId});
|
||||
|
||||
Stripe.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'] ?? "Stripe";
|
||||
accountId = json['accountId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['name'] = name;
|
||||
data['accountId'] = accountId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class RazorpayModel {
|
||||
String? accountId;
|
||||
String? name;
|
||||
|
||||
RazorpayModel({this.name, this.accountId});
|
||||
|
||||
RazorpayModel.fromJson(Map<String, dynamic> json) {
|
||||
accountId = json['accountId'];
|
||||
name = json['name'] ?? "RazorPay";
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['accountId'] = accountId;
|
||||
data['name'] = name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Paypal {
|
||||
String? name;
|
||||
String? email;
|
||||
|
||||
Paypal({this.name, this.email});
|
||||
|
||||
Paypal.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'] ?? "PayPal";
|
||||
email = json['email'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['name'] = name;
|
||||
data['email'] = email;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
41
lib/models/withdrawal_model.dart
Normal file
41
lib/models/withdrawal_model.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class WithdrawalModel {
|
||||
String? amount;
|
||||
String? adminNote;
|
||||
String? note;
|
||||
String? id;
|
||||
Timestamp? paidDate;
|
||||
String? paymentStatus;
|
||||
String? vendorID;
|
||||
String? driverID;
|
||||
String? withdrawMethod;
|
||||
|
||||
WithdrawalModel({this.amount, this.adminNote, this.note, this.id, this.paidDate, this.driverID, this.paymentStatus, this.vendorID, this.withdrawMethod});
|
||||
|
||||
WithdrawalModel.fromJson(Map<String, dynamic> json) {
|
||||
amount = json['amount'] == null ? "0.0" : json['amount'].toString();
|
||||
adminNote = json['adminNote'];
|
||||
note = json['note'];
|
||||
id = json['id'];
|
||||
paidDate = json['paidDate'];
|
||||
paymentStatus = json['paymentStatus'];
|
||||
vendorID = json['vendorID'];
|
||||
withdrawMethod = json['withdrawMethod'];
|
||||
driverID = json['driverID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['amount'] = amount;
|
||||
data['adminNote'] = adminNote;
|
||||
data['note'] = note;
|
||||
data['id'] = id;
|
||||
data['paidDate'] = paidDate;
|
||||
data['paymentStatus'] = paymentStatus;
|
||||
data['vendorID'] = vendorID;
|
||||
data['driverID'] = driverID;
|
||||
data['withdrawMethod'] = withdrawMethod;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
40
lib/models/zone_model.dart
Normal file
40
lib/models/zone_model.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class ZoneModel {
|
||||
List<GeoPoint>? area;
|
||||
bool? publish;
|
||||
double? latitude;
|
||||
String? name;
|
||||
String? id;
|
||||
double? longitude;
|
||||
|
||||
ZoneModel({this.area, this.publish, this.latitude, this.name, this.id, this.longitude});
|
||||
|
||||
ZoneModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['area'] != null) {
|
||||
area = <GeoPoint>[];
|
||||
json['area'].forEach((v) {
|
||||
area!.add(v);
|
||||
});
|
||||
}
|
||||
|
||||
publish = json['publish'];
|
||||
latitude = json['latitude'];
|
||||
name = json['name'];
|
||||
id = json['id'];
|
||||
longitude = json['longitude'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (area != null) {
|
||||
data['area'] = area!.map((v) => v).toList();
|
||||
}
|
||||
data['publish'] = publish;
|
||||
data['latitude'] = latitude;
|
||||
data['name'] = name;
|
||||
data['id'] = id;
|
||||
data['longitude'] = longitude;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user