2026-04-11

This commit is contained in:
Sarankumar committed 2026-04-11 10:21:31 +05:30
commit 27e27fb70b
270 files changed
+30296

No files matched your search

+242
View File
@@ -0,0 +1,242 @@
// ------------------------------------------------------------
// CHAT MODEL
// ------------------------------------------------------------
class ChatModel {
final bool status;
final List<MessageModel> messages;
final String? chatStatus;
final int? draw;
final int? recordsTotal;
final int? recordsFiltered;
final String? profile;
final String? name;
final String? role;
final List<DocumentModel> userUploadedDocuments;
final List<DocumentModel> adminUploadedDocuments;
ChatModel({
required this.status,
required this.messages,
this.chatStatus,
this.draw,
this.recordsTotal,
this.recordsFiltered,
this.profile,
this.name,
this.role,
required this.userUploadedDocuments,
required this.adminUploadedDocuments,
});
factory ChatModel.fromJson(Map<String, dynamic> json) {
final msg = json["messages"];
return ChatModel(
status: json['status'] ?? false,
messages: (msg?['data'] != null && msg['data'] is List)
? List<MessageModel>.from(
msg['data'].map((x) => MessageModel.fromJson(x)),
)
: [],
chatStatus: msg?['status'],
draw: msg?['draw'],
recordsTotal: msg?['recordsTotal'],
recordsFiltered: msg?['recordsFiltered'],
profile: msg?['profile'],
name: msg?['name'],
role: msg?['role'],
userUploadedDocuments:
(msg?['user_uploaded_documents'] != null &&
msg['user_uploaded_documents'] is List)
? List<DocumentModel>.from(
msg['user_uploaded_documents'].map(
(x) => DocumentModel.fromJson(x),
),
)
: [],
adminUploadedDocuments:
(msg?['admin_uploaded_documents'] != null &&
msg['admin_uploaded_documents'] is List)
? List<DocumentModel>.from(
msg['admin_uploaded_documents'].map(
(x) => DocumentModel.fromJson(x),
),
)
: [],
);
}
}
// ------------------------------------------------------------
// MESSAGE MODEL
// ------------------------------------------------------------
class MessageModel {
final int id;
final String chatBy;
final String message;
final String type;
final int isDelivered;
final int isRead;
final String? createdAt;
final String? readAt;
final String? time;
final int userId;
final int? tagId;
final String? fileName;
final List<DocumentModel> uploadedDocuments;
final UserModel? user;
final ParentTagModel? parentTag;
final List<DocumentModel> documents;
MessageModel({
required this.id,
required this.chatBy,
required this.message,
required this.type,
required this.isDelivered,
required this.isRead,
this.createdAt,
this.readAt,
this.time,
required this.userId,
this.tagId,
this.fileName,
required this.uploadedDocuments,
this.user,
this.parentTag,
required this.documents,
});
factory MessageModel.fromJson(Map<String, dynamic> json) {
return MessageModel(
id: json['id'] ?? 0,
chatBy: json['chat_by'] ?? "",
message: json['message'] ?? "",
type: json['type'] ?? "",
isDelivered: json['is_delivered'] ?? 0,
isRead: json['is_read'] ?? 0,
createdAt: json['created_at'],
readAt: json['read_at'],
time: json['time'],
userId: json['user_id'] ?? 0,
tagId: json['tag_id'],
fileName: json['file_name'],
uploadedDocuments:
(json['uploaded_documents'] != null &&
json['uploaded_documents'] is List)
? List<DocumentModel>.from(
json['uploaded_documents'].map((x) => DocumentModel.fromJson(x)),
)
: [],
documents: (json['documents'] != null && json['documents'] is List)
? List<DocumentModel>.from(
json['documents'].map((x) => DocumentModel.fromJson(x)),
)
: [],
user: json['user'] != null ? UserModel.fromJson(json['user']) : null,
parentTag: json['parent_tag'] != null
? ParentTagModel.fromJson(json['parent_tag'])
: null,
);
}
}
// ------------------------------------------------------------
// DOCUMENT MODEL
// ------------------------------------------------------------
class DocumentModel {
final String filePath;
final String fileName;
final String fileType;
final int? id;
final String? type;
DocumentModel({
this.id,
required this.filePath,
required this.fileName,
required this.fileType,
this.type,
});
factory DocumentModel.fromJson(Map<String, dynamic> json) {
return DocumentModel(
id: json['id'],
filePath: json['file_path'] ?? "",
fileName: json['file_name'] ?? "",
fileType: json['file_type'] ?? "",
type: json['type'],
);
}
}
// ------------------------------------------------------------
// USER MODEL
// ------------------------------------------------------------
class UserModel {
final int id;
final String name;
final String role;
final String? profilePicture;
final Map<String, dynamic>? profile;
UserModel({
required this.id,
required this.name,
required this.role,
this.profilePicture,
this.profile,
});
factory UserModel.fromJson(Map<String, dynamic> json) {
return UserModel(
id: json['id'] ?? 0,
name: json['name'] ?? "",
role: json['role'] ?? "",
profilePicture: json['profile_picture'],
profile: json['profile'],
);
}
}
// ------------------------------------------------------------
// PARENT TAG MODEL
// ------------------------------------------------------------
class ParentTagModel {
final int id;
final String message;
final String type;
final String? fileName;
ParentTagModel({
required this.id,
required this.message,
required this.type,
this.fileName,
});
factory ParentTagModel.fromJson(Map<String, dynamic> json) {
return ParentTagModel(
id: json['id'] ?? 0,
message: json['message'] ?? "",
type: json['type'] ?? "",
fileName: json['file_name'],
);
}
}
+80
View File
@@ -0,0 +1,80 @@
import 'dart:convert';
ChatProfileModel chatProfileModelFromJson(String str) =>
ChatProfileModel.fromJson(json.decode(str));
String chatProfileModelToJson(ChatProfileModel data) =>
json.encode(data.toJson());
class ChatProfileModel {
final bool status;
final String profile;
final String name;
final String role;
final List<ChatDocument> userUploadedDocuments;
final List<ChatDocument> adminUploadedDocuments;
ChatProfileModel({
required this.status,
required this.profile,
required this.name,
required this.role,
required this.userUploadedDocuments,
required this.adminUploadedDocuments,
});
factory ChatProfileModel.fromJson(Map<String, dynamic> json) =>
ChatProfileModel(
status: json["status"] ?? false,
profile: json["profile"] ?? "",
name: json["name"] ?? "",
role: json["role"] ?? "",
userUploadedDocuments: json["userUploadedDocuments"] == null
? []
: List<ChatDocument>.from(
json["userUploadedDocuments"]
.map((x) => ChatDocument.fromJson(x)),
),
adminUploadedDocuments: json["adminUploadedDocuments"] == null
? []
: List<ChatDocument>.from(
json["adminUploadedDocuments"]
.map((x) => ChatDocument.fromJson(x)),
),
);
Map<String, dynamic> toJson() => {
"status": status,
"profile": profile,
"name": name,
"role": role,
"userUploadedDocuments":
userUploadedDocuments.map((x) => x.toJson()).toList(),
"adminUploadedDocuments":
adminUploadedDocuments.map((x) => x.toJson()).toList(),
};
}
class ChatDocument {
final String fileName;
final String filePath;
final String fileType;
ChatDocument({
required this.fileName,
required this.filePath,
required this.fileType,
});
factory ChatDocument.fromJson(Map<String, dynamic> json) => ChatDocument(
fileName: json["file_name"] ?? "",
filePath: json["file_path"] ?? "",
fileType: json["file_type"] ?? "",
);
Map<String, dynamic> toJson() => {
"file_name": fileName,
"file_path": filePath,
"file_type": fileType,
};
}
+72
View File
@@ -0,0 +1,72 @@
class CityModel {
final bool? status;
final List<DistrictData>? districtsData;
CityModel({this.status, this.districtsData});
factory CityModel.fromJson(Map<String, dynamic> json) {
return CityModel(
status: json['status'],
districtsData: json['districts_data'] != null
? List<DistrictData>.from(
json['districts_data'].map((x) => DistrictData.fromJson(x)),
)
: [],
);
}
Map<String, dynamic> toJson() {
return {
'status': status,
'districts_data': districtsData?.map((x) => x.toJson()).toList(),
};
}
}
class DistrictData {
final int? id;
final String? districtName;
final int? active;
final int? stateId;
final dynamic createdBy;
final dynamic updatedBy;
final String? createdAt;
final String? updatedAt;
DistrictData({
this.id,
this.districtName,
this.active,
this.stateId,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
});
factory DistrictData.fromJson(Map<String, dynamic> json) {
return DistrictData(
id: json['id'],
districtName: json['district_name'],
active: json['active'],
stateId: json['state_id'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'district_name': districtName,
'active': active,
'state_id': stateId,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
};
}
}
+23
View File
@@ -0,0 +1,23 @@
class CountModel {
final bool status;
final int count;
CountModel({
required this.status,
required this.count,
});
factory CountModel.fromJson(Map<String, dynamic> json) {
return CountModel(
status: json['status'] ?? false,
count: json['count'] ?? 0,
);
}
Map<String, dynamic> toJson() {
return {
'status': status,
'count': count,
};
}
}
+129
View File
@@ -0,0 +1,129 @@
class CountryModel {
final bool? status;
final List<CountryData>? countriesData;
final List<StateData>? statesData;
CountryModel({
this.status,
this.countriesData,
this.statesData,
});
factory CountryModel.fromJson(Map<String, dynamic> json) {
return CountryModel(
status: json['status'],
countriesData: json['countries_data'] != null
? List<CountryData>.from(
json['countries_data'].map((x) => CountryData.fromJson(x)))
: [],
statesData: json['states_data'] != null
? List<StateData>.from(
json['states_data'].map((x) => StateData.fromJson(x)))
: [],
);
}
Map<String, dynamic> toJson() {
return {
'status': status,
'countries_data': countriesData?.map((x) => x.toJson()).toList(),
'states_data': statesData?.map((x) => x.toJson()).toList(),
};
}
}
class CountryData {
final int? id;
final String? countryCode;
final String? countryName;
final int? active;
final dynamic createdBy;
final dynamic updatedBy;
final String? createdAt;
final String? updatedAt;
CountryData({
this.id,
this.countryCode,
this.countryName,
this.active,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
});
factory CountryData.fromJson(Map<String, dynamic> json) {
return CountryData(
id: json['id'],
countryCode: json['country_code'],
countryName: json['country_name'],
active: json['active'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'country_code': countryCode,
'country_name': countryName,
'active': active,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
};
}
}
class StateData {
final int? id;
final String? stateName;
final int? active;
final int? countryId;
final dynamic createdBy;
final dynamic updatedBy;
final String? createdAt;
final String? updatedAt;
StateData({
this.id,
this.stateName,
this.active,
this.countryId,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
});
factory StateData.fromJson(Map<String, dynamic> json) {
return StateData(
id: json['id'],
stateName: json['state_name'],
active: json['active'],
countryId: json['country_id'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'state_name': stateName,
'active': active,
'country_id': countryId,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
};
}
}
+193
View File
@@ -0,0 +1,193 @@
class DashBoardModel {
final String status;
final bool isKycCompleted;
final List<ServiceList> serviceLists;
final String userName;
final String companyName;
final int generalChatId;
final List<Review> reviews;
final ServiceRequestList serviceRequestLists;
final List<ImageSlider> imageSlider;
DashBoardModel({
required this.status,
required this.isKycCompleted,
required this.serviceLists,
required this.userName,
required this.companyName,
required this.generalChatId,
required this.imageSlider,
required this.reviews,
required this.serviceRequestLists,
});
factory DashBoardModel.fromJson(Map<String, dynamic> json) {
return DashBoardModel(
status: json['status'] ?? '',
isKycCompleted: json['is_kyc_completed'] ?? false,
serviceLists:
(json['service_lists'] as List<dynamic>?)
?.map((e) => ServiceList.fromJson(e))
.toList() ??
[],
imageSlider: (json['imageSlider'] as List)
.map((e) => ImageSlider.fromJson(e))
.toList(),
userName: json['user_name'] ?? '',
companyName: json['company_name'] ?? '',
generalChatId: json['general_chat_id'] ?? 0,
reviews:
(json['reviews'] as List<dynamic>?)
?.map((e) => Review.fromJson(e))
.toList() ??
[],
serviceRequestLists: ServiceRequestList.fromJson(
json['service_request_lists'] ?? {},
),
);
}
}
// ---------------------------------------------------------------
// SERVICE LIST MODEL
// ---------------------------------------------------------------
class ServiceList {
final int id;
final String service;
final String icon;
ServiceList({required this.id, required this.service, required this.icon});
factory ServiceList.fromJson(Map<String, dynamic> json) {
return ServiceList(
id: json['id'] ?? 0,
service: json['service'] ?? '',
icon: json['icon'] ?? '',
);
}
}
class ImageSlider {
final String image;
ImageSlider({required this.image});
factory ImageSlider.fromJson(Map<String, dynamic> json) {
return ImageSlider(image: json['image'] ?? '');
}
}
// ---------------------------------------------------------------
// REVIEW MODEL
// ---------------------------------------------------------------
class Review {
final int id;
final String name;
final String about;
final String content;
final int rating;
Review({
required this.id,
required this.name,
required this.about,
required this.content,
required this.rating,
});
factory Review.fromJson(Map<String, dynamic> json) {
return Review(
id: json['id'] ?? 0,
name: json['name'] ?? '',
about: json['about'] ?? '',
content: json['content'] ?? '',
rating: json['rating'] ?? 0,
);
}
}
// ---------------------------------------------------------------
// SERVICE REQUEST LIST WRAPPER
// ---------------------------------------------------------------
class ServiceRequestList {
final String status;
final int recordsTotal;
final int recordsFiltered;
final List<ServiceRequestItem> data;
ServiceRequestList({
required this.status,
required this.recordsTotal,
required this.recordsFiltered,
required this.data,
});
factory ServiceRequestList.fromJson(Map<String, dynamic> json) {
return ServiceRequestList(
status: json['status'] ?? '',
recordsTotal: json['recordsTotal'] ?? 0,
recordsFiltered: json['recordsFiltered'] ?? 0,
data:
(json['data'] as List<dynamic>?)
?.map((e) => ServiceRequestItem.fromJson(e))
.toList() ??
[],
);
}
}
// ---------------------------------------------------------------
// SERVICE REQUEST ITEM
// ---------------------------------------------------------------
class ServiceRequestItem {
final int id;
final String name;
final String logo;
final String email;
final String mobile;
final String paymentStatus;
final num paymentAmount;
final String status;
final String service;
final String message;
final String createdDate;
final String createdTime;
final int actions;
final int? chatId;
ServiceRequestItem({
required this.id,
required this.name,
required this.logo,
required this.email,
required this.mobile,
required this.paymentStatus,
required this.paymentAmount,
required this.status,
required this.service,
required this.message,
required this.createdDate,
required this.createdTime,
required this.actions,
required this.chatId,
});
factory ServiceRequestItem.fromJson(Map<String, dynamic> json) {
return ServiceRequestItem(
id: json['id'] ?? 0,
name: json['name'] ?? '',
logo: json['logo'] ?? '',
email: json['email'] ?? '',
mobile: json['mobile'] ?? '',
paymentStatus: json['payment_status'] ?? '',
paymentAmount: json['payment_amount'] ?? 0,
status: json['status'] ?? '',
service: json['service'] ?? '',
message: json['message'] ?? '',
createdDate: json['created_date'] ?? '',
createdTime: json['created_time'] ?? '',
actions: json['actions'] ?? 0,
chatId: json['chat_id'],
);
}
}
+235
View File
@@ -0,0 +1,235 @@
import 'dart:convert';
/// ------------------------------
/// JSON Helpers
/// ------------------------------
DetailModel detailModelFromJson(String str) =>
DetailModel.fromJson(json.decode(str));
String detailModelToJson(DetailModel data) => json.encode(data.toJson());
/// ------------------------------
/// Root Model
/// ------------------------------
class DetailModel {
final String? status;
final DetailData? data;
DetailModel({this.status, this.data});
factory DetailModel.fromJson(Map<String, dynamic> json) => DetailModel(
status: json["status"],
data: json["data"] == null ? null : DetailData.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {"status": status, "data": data?.toJson()};
}
/// ------------------------------
/// Detail Data Model
/// ------------------------------
class DetailData {
final int? id;
final int? firmId;
final String? dueDate;
final String? service;
final String? serviceStatus;
final String? paymentStatus;
final String? paidStatus;
final String? paymentDate;
final String? paymentAmount;
final String? invoice;
final String? invoiceNumber;
final String? proforma;
final int? proformaId;
final String? proformaNumber;
final String? proformastatus;
final String? createdDate;
final String? createdTime;
final String? createdBy;
final String? message;
final String? completedDate;
final String? paidBy;
final List<UserUploadedDocument> userUploadedDocuments;
final List<UserHandoverDocument> userHandoverDocuments;
final String? chatId;
final String? completedChatId;
DetailData({
this.id,
this.firmId,
this.dueDate,
this.service,
this.proformastatus,
this.serviceStatus,
this.paymentStatus,
this.paidStatus,
this.paymentDate,
this.paymentAmount,
this.invoice,
this.invoiceNumber,
this.proforma,
this.proformaId,
this.proformaNumber,
this.createdDate,
this.createdTime,
this.createdBy,
this.message,
this.completedDate,
this.paidBy,
required this.userUploadedDocuments,
required this.userHandoverDocuments,
this.chatId,
this.completedChatId,
});
factory DetailData.fromJson(Map<String, dynamic> json) => DetailData(
id: json["id"],
firmId: json["firm_id"],
dueDate: json["due_date"],
service: json["service"],
serviceStatus: json["service_status"],
paymentStatus: json["payment_status"],
proformastatus: json["proforma_status"],
paidStatus: json["paid_status"],
paymentDate: json["payment_date"],
paymentAmount: json["payment_amount"]?.toString(),
invoice: json["invoice"],
invoiceNumber: json["invoice_number"],
proforma: json["proforma"],
proformaId: json["proforma_id"],
proformaNumber: json["proforma_number"],
createdDate: json["created_date"],
createdTime: json["created_time"],
createdBy: json["created_by"],
message: json["message"],
completedDate: json["completed_date"],
paidBy: json["paid_by"],
userUploadedDocuments: json["user_uploaded_documents"] == null
? []
: List<UserUploadedDocument>.from(
json["user_uploaded_documents"].map(
(x) => UserUploadedDocument.fromJson(x),
),
),
userHandoverDocuments: json["user_handover_documents"] == null
? []
: List<UserHandoverDocument>.from(
json["user_handover_documents"].map(
(x) => UserHandoverDocument.fromJson(x),
),
),
chatId: json["chat_id"]?.toString(),
completedChatId: json["completed_chat_id"]?.toString(),
);
Map<String, dynamic> toJson() => {
"id": id,
"firm_id": firmId,
"due_date": dueDate,
"service": service,
"service_status": serviceStatus,
"payment_status": paymentStatus,
"paid_status": paidStatus,
"payment_date": paymentDate,
"payment_amount": paymentAmount,
"invoice": invoice,
"proforma_status": proformastatus,
"invoice_number": invoiceNumber,
"proforma": proforma,
"proforma_id": proformaId,
"proforma_number": proformaNumber,
"created_date": createdDate,
"created_time": createdTime,
"created_by": createdBy,
"message": message,
"completed_date": completedDate,
"paid_by": paidBy,
"user_uploaded_documents": userUploadedDocuments
.map((x) => x.toJson())
.toList(),
"user_handover_documents": userHandoverDocuments
.map((x) => x.toJson())
.toList(),
"chat_id": chatId,
"completed_chat_id": completedChatId,
};
}
/// ------------------------------
/// User Uploaded Document
/// ------------------------------
class UserUploadedDocument {
final int? id;
final String? filePath;
final String? fileName;
final String? uploadedBy;
final bool? viewable;
UserUploadedDocument({
this.id,
this.filePath,
this.fileName,
this.uploadedBy,
this.viewable,
});
factory UserUploadedDocument.fromJson(Map<String, dynamic> json) =>
UserUploadedDocument(
id: json["id"],
filePath: json["file_path"],
fileName: json["file_name"],
uploadedBy: json["uploaded_by"],
viewable: json["viewable"],
);
Map<String, dynamic> toJson() => {
"id": id,
"file_path": filePath,
"file_name": fileName,
"uploaded_by": uploadedBy,
"viewable": viewable,
};
}
/// ------------------------------
/// User Handover Document
/// ------------------------------
class UserHandoverDocument {
final String? filePath;
final String? fileName;
UserHandoverDocument({this.filePath, this.fileName});
factory UserHandoverDocument.fromJson(Map<String, dynamic> json) =>
UserHandoverDocument(
filePath: json["file_path"],
fileName: json["file_name"],
);
Map<String, dynamic> toJson() => {
"file_path": filePath,
"file_name": fileName,
};
}
+85
View File
@@ -0,0 +1,85 @@
class EmployeeProfileModel {
final bool status;
final EmployeeData? data;
EmployeeProfileModel({required this.status, this.data});
factory EmployeeProfileModel.fromJson(Map<String, dynamic> json) {
return EmployeeProfileModel(
status: json['status'] ?? false,
data: json['data'] != null ? EmployeeData.fromJson(json['data']) : null,
);
}
Map<String, dynamic> toJson() {
return {'status': status, 'data': data?.toJson()};
}
}
class EmployeeData {
final int id;
final String name;
final String mobile;
final String email;
final int status;
final int generalChat;
final int createService;
final Company? company;
EmployeeData({
required this.id,
required this.name,
required this.mobile,
required this.email,
required this.status,
required this.generalChat,
required this.createService,
this.company,
});
factory EmployeeData.fromJson(Map<String, dynamic> json) {
return EmployeeData(
id: json['id'] ?? 0,
name: json['name'] ?? '',
mobile: json['mobile'] ?? '',
email: json['email'] ?? '',
status: json['status'] ?? 0,
generalChat: json['general_chat'] ?? 0,
createService: json['create_service'] ?? 0,
company: json['company'] != null
? Company.fromJson(json['company'])
: null,
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'mobile': mobile,
'email': email,
'status': status,
'general_chat': generalChat,
'create_service': createService,
'company': company?.toJson(),
};
}
}
class Company {
final String? companyName;
final String? companyLogo;
Company({this.companyName, this.companyLogo});
factory Company.fromJson(Map<String, dynamic> json) {
return Company(
companyName: json['company_name'],
companyLogo: json['company_logo'],
);
}
Map<String, dynamic> toJson() {
return {'company_name': companyName, 'company_logo': companyLogo};
}
}
+23
View File
@@ -0,0 +1,23 @@
// login_model.dart
class LoginModel {
String? mobile;
String? otp;
LoginModel({this.mobile, this.otp});
// For sending mobile number to request OTP
Map<String, dynamic> toJsonMobile() {
return {'mobile': mobile};
}
// For sending mobile + OTP for verification
Map<String, dynamic> toJsonOtp() {
return {'mobile': mobile, 'otp': otp};
}
// Response from API
factory LoginModel.fromJson(Map<String, dynamic> json) {
return LoginModel(mobile: json['mobile'], otp: json['otp']);
}
}
+79
View File
@@ -0,0 +1,79 @@
class NotificationResponse {
final String status;
final int? draw;
final int recordsTotal;
final int recordsFiltered;
final List<NotificationModel> data;
NotificationResponse({
required this.status,
required this.draw,
required this.recordsTotal,
required this.recordsFiltered,
required this.data,
});
factory NotificationResponse.fromJson(Map<String, dynamic> json) {
return NotificationResponse(
status: json['status'] ?? '',
draw: json['draw'],
recordsTotal: json['recordsTotal'] ?? 0,
recordsFiltered: json['recordsFiltered'] ?? 0,
data: (json['data'] as List<dynamic>? ?? [])
.map((e) => NotificationModel.fromJson(e))
.toList(),
);
}
Map<String, dynamic> toJson() {
return {
"status": status,
"draw": draw,
"recordsTotal": recordsTotal,
"recordsFiltered": recordsFiltered,
"data": data.map((e) => e.toJson()).toList(),
};
}
}
// -------------------------------------------------------------
class NotificationModel {
final int id;
final String title;
final String description;
final int? pageId;
final String page;
final String createdAt; // Keeping as string because format is custom
NotificationModel({
required this.id,
required this.title,
required this.description,
required this.pageId,
required this.page,
required this.createdAt,
});
factory NotificationModel.fromJson(Map<String, dynamic> json) {
return NotificationModel(
id: json['id'] ?? 0,
title: json['tittle'] ?? '', // API spelled as "tittle"
description: json['description'] ?? '',
pageId: json['page_id'],
page: json['page'] ?? '',
createdAt: json['created_at'] ?? '',
);
}
Map<String, dynamic> toJson() {
return {
"id": id,
"tittle": title,
"description": description,
"page_id": pageId,
"page": page,
"created_at": createdAt,
};
}
}
+17
View File
@@ -0,0 +1,17 @@
class NotificationCountModel {
final bool status;
final int count;
NotificationCountModel({required this.status, required this.count});
factory NotificationCountModel.fromJson(Map<String, dynamic> json) {
return NotificationCountModel(
status: json['status'] ?? false,
count: json['count'] ?? 0,
);
}
Map<String, dynamic> toJson() {
return {'status': status, 'count': count};
}
}
+313
View File
@@ -0,0 +1,313 @@
class ProfileGetModel {
final bool status;
final ProfileData? data;
ProfileGetModel({required this.status, this.data});
factory ProfileGetModel.fromJson(Map<String, dynamic> json) {
return ProfileGetModel(
status: json['status'] ?? false,
data: json['data'] != null ? ProfileData.fromJson(json['data']) : null,
);
}
Map<String, dynamic> toJson() {
return {'status': status, 'data': data?.toJson()};
}
}
class ProfileData {
final int? id;
final String? companyName;
final String? companyEmail;
final String? companyMobile;
final String? companyAddress;
final String? companyPincode;
final String? panNumber;
final String? gstNumber;
final String? tanNumber;
final String? cin;
final int? yearOfIncorporation;
final String? logo;
final String? panFile;
final String? gstFile;
final String? incorporationFile;
final int? active;
final int? createdBy;
final int? updatedBy;
final String? createdAt;
final String? updatedAt;
final int? countryId;
final int? stateId;
final int? districtId;
final String? countryName;
final String? stateName;
final String? districtName;
final String? name;
final String? email;
final String? mobile;
final int? userId;
final Country? country;
final StateData? state;
final District? district;
ProfileData({
this.id,
this.companyName,
this.companyEmail,
this.companyMobile,
this.companyAddress,
this.companyPincode,
this.panNumber,
this.gstNumber,
this.tanNumber,
this.cin,
this.yearOfIncorporation,
this.logo,
this.panFile,
this.gstFile,
this.incorporationFile,
this.active,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
this.countryId,
this.stateId,
this.districtId,
this.countryName,
this.stateName,
this.districtName,
this.name,
this.email,
this.mobile,
this.userId,
this.country,
this.state,
this.district,
});
factory ProfileData.fromJson(Map<String, dynamic> json) {
return ProfileData(
id: json['id'],
companyName: json['company_name'],
companyEmail: json['company_email'],
companyMobile: json['company_mobile'],
companyAddress: json['company_address'],
companyPincode: json['company_pincode'],
panNumber: json['pan_number'],
gstNumber: json['gst_number'],
tanNumber: json['tan_number'],
cin: json['cin'],
yearOfIncorporation: json['year_of_incorporation'],
logo: json['logo'],
panFile: json['pan_file'],
gstFile: json['gst_file'],
incorporationFile: json['incorporation_file'],
active: json['active'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
countryId: json['country_id'],
stateId: json['state_id'],
districtId: json['district_id'],
countryName: json['country_name'],
stateName: json['state_name'],
districtName: json['district_name'],
name: json['name'],
email: json['email'],
mobile: json['mobile'],
userId: json['user_id'],
country: json['country'] != null
? Country.fromJson(json['country'])
: null,
state: json['state'] != null ? StateData.fromJson(json['state']) : null,
district: json['district'] != null
? District.fromJson(json['district'])
: null,
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'company_name': companyName,
'company_email': companyEmail,
'company_mobile': companyMobile,
'company_address': companyAddress,
'company_pincode': companyPincode,
'pan_number': panNumber,
'gst_number': gstNumber,
'tan_number': tanNumber,
'cin': cin,
'year_of_incorporation': yearOfIncorporation,
'logo': logo,
'pan_file': panFile,
'gst_file': gstFile,
'incorporation_file': incorporationFile,
'active': active,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
'country_id': countryId,
'state_id': stateId,
'district_id': districtId,
'country_name': countryName,
'state_name': stateName,
'district_name': districtName,
'name': name,
'email': email,
'mobile': mobile,
'user_id': userId,
'country': country?.toJson(),
'state': state?.toJson(),
'district': district?.toJson(),
};
}
}
class Country {
final int? id;
final String? countryCode;
final String? countryName;
final int? active;
final dynamic createdBy;
final dynamic updatedBy;
final String? createdAt;
final String? updatedAt;
Country({
this.id,
this.countryCode,
this.countryName,
this.active,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
});
factory Country.fromJson(Map<String, dynamic> json) {
return Country(
id: json['id'],
countryCode: json['country_code'],
countryName: json['country_name'],
active: json['active'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'country_code': countryCode,
'country_name': countryName,
'active': active,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
};
}
}
class StateData {
final int? id;
final String? stateName;
final int? active;
final int? countryId;
final dynamic createdBy;
final dynamic updatedBy;
final String? createdAt;
final String? updatedAt;
StateData({
this.id,
this.stateName,
this.active,
this.countryId,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
});
factory StateData.fromJson(Map<String, dynamic> json) {
return StateData(
id: json['id'],
stateName: json['state_name'],
active: json['active'],
countryId: json['country_id'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'state_name': stateName,
'active': active,
'country_id': countryId,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
};
}
}
class District {
final int? id;
final String? districtName;
final int? active;
final int? stateId;
final dynamic createdBy;
final dynamic updatedBy;
final String? createdAt;
final String? updatedAt;
District({
this.id,
this.districtName,
this.active,
this.stateId,
this.createdBy,
this.updatedBy,
this.createdAt,
this.updatedAt,
});
factory District.fromJson(Map<String, dynamic> json) {
return District(
id: json['id'],
districtName: json['district_name'],
active: json['active'],
stateId: json['state_id'],
createdBy: json['created_by'],
updatedBy: json['updated_by'],
createdAt: json['created_at'],
updatedAt: json['updated_at'],
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'district_name': districtName,
'active': active,
'state_id': stateId,
'created_by': createdBy,
'updated_by': updatedBy,
'created_at': createdAt,
'updated_at': updatedAt,
};
}
}
+43
View File
@@ -0,0 +1,43 @@
class ServiceListModel {
final int id;
final String service;
final String icon;
ServiceListModel({
required this.id,
required this.service,
required this.icon,
});
factory ServiceListModel.fromJson(Map<String, dynamic> json) {
return ServiceListModel(
id: json['id'] ?? 0,
service: json['service'] ?? '',
icon: json['icon'] ?? '',
);
}
Map<String, dynamic> toJson() {
return {'id': id, 'service': service, 'icon': icon};
}
}
class ServiceListResponse {
final String status;
final List<ServiceListModel> data;
ServiceListResponse({required this.status, required this.data});
factory ServiceListResponse.fromJson(Map<String, dynamic> json) {
return ServiceListResponse(
status: json['status'] ?? '',
data: (json['data'] as List<dynamic>)
.map((e) => ServiceListModel.fromJson(e))
.toList(),
);
}
Map<String, dynamic> toJson() {
return {'status': status, 'data': data.map((e) => e.toJson()).toList()};
}
}
+91
View File
@@ -0,0 +1,91 @@
class ServiceListHistoryModel {
final String? status;
final dynamic draw;
final int? recordsTotal;
final int? recordsFiltered;
final List<ServiceHistoryData>? data;
ServiceListHistoryModel({
this.status,
this.draw,
this.recordsTotal,
this.recordsFiltered,
this.data,
});
factory ServiceListHistoryModel.fromJson(Map<String, dynamic> json) {
return ServiceListHistoryModel(
status: json['status'] as String?,
draw: json['draw'],
recordsTotal: json['recordsTotal'] is int
? json['recordsTotal']
: int.tryParse(json['recordsTotal']?.toString() ?? ''),
recordsFiltered: json['recordsFiltered'] is int
? json['recordsFiltered']
: int.tryParse(json['recordsFiltered']?.toString() ?? ''),
data: (json['data'] as List?)
?.map((e) => ServiceHistoryData.fromJson(e))
.toList(),
);
}
Map<String, dynamic> toJson() {
return {
'status': status,
'draw': draw,
'recordsTotal': recordsTotal,
'recordsFiltered': recordsFiltered,
'data': data?.map((e) => e.toJson()).toList(),
};
}
}
class ServiceHistoryData {
final int? id;
final String? paymentStatus;
final String? paymentAmount;
final String? status;
final String? service;
final String? message;
final String? createdDate;
final String? createdTime;
ServiceHistoryData({
this.id,
this.paymentStatus,
this.paymentAmount,
this.status,
this.service,
this.message,
this.createdDate,
this.createdTime,
});
factory ServiceHistoryData.fromJson(Map<String, dynamic> json) {
return ServiceHistoryData(
id: json['id'] is int
? json['id']
: int.tryParse(json['id']?.toString() ?? ''),
paymentStatus: json['payment_status']?.toString(),
paymentAmount: json['payment_amount']?.toString(),
status: json['status']?.toString(),
service: json['service']?.toString(),
message: json['message']?.toString(),
createdDate: json['created_date']?.toString(),
createdTime: json['created_time']?.toString(),
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'payment_status': paymentStatus,
'payment_amount': paymentAmount,
'status': status,
'service': service,
'message': message,
'created_date': createdDate,
'created_time': createdTime,
};
}
}
+25
View File
@@ -0,0 +1,25 @@
class SignupModel {
final String email;
final String name;
final String contactNumber;
SignupModel({
required this.email,
required this.name,
required this.contactNumber,
});
// Convert JSON to SignupModel
factory SignupModel.fromJson(Map<String, dynamic> json) {
return SignupModel(
email: json['email'] ?? '',
name: json['name'] ?? '',
contactNumber: json['mobile'] ?? '',
);
}
// Convert SignupModel to JSON
Map<String, dynamic> toJson() {
return {'email': email, 'name': name, 'mobile': contactNumber};
}
}
+47
View File
@@ -0,0 +1,47 @@
class StaffResponse {
final String status;
final List<StaffModel> data;
StaffResponse({required this.status, required this.data});
factory StaffResponse.fromJson(Map<String, dynamic> json) {
return StaffResponse(
status: json['status'] ?? '',
data: (json['data'] as List<dynamic>)
.map((item) => StaffModel.fromJson(item))
.toList(),
);
}
}
class StaffModel {
final int id;
final String name;
final String mobile;
final String email;
final int status;
final int generalChat;
final int createService;
StaffModel({
required this.id,
required this.name,
required this.mobile,
required this.email,
required this.status,
required this.generalChat,
required this.createService,
});
factory StaffModel.fromJson(Map<String, dynamic> json) {
return StaffModel(
id: json['id'] ?? 0,
name: json['name'] ?? '',
mobile: json['mobile'] ?? '',
email: json['email'] ?? '',
status: json['status'] ?? 0,
generalChat: json['general_chat'] ?? 0,
createService: json['create_service'] ?? 0,
);
}
}
+35
View File
@@ -0,0 +1,35 @@
class TermsModel {
final bool status;
final TermsData? data;
TermsModel({required this.status, this.data});
factory TermsModel.fromJson(Map<String, dynamic> json) {
return TermsModel(
status: json['status'] ?? false,
data: json['data'] != null ? TermsData.fromJson(json['data']) : null,
);
}
Map<String, dynamic> toJson() {
return {'status': status, 'data': data?.toJson()};
}
}
class TermsData {
final String? title;
final String? content;
TermsData({this.title, this.content});
factory TermsData.fromJson(Map<String, dynamic> json) {
return TermsData(
title: json['title'] ?? '',
content: json['content'] ?? '',
);
}
Map<String, dynamic> toJson() {
return {'title': title, 'content': content};
}
}