Merge branch 'master' of bitbucket.org:jubilian/nhance_partner
This commit is contained in:
commit
652c66c1fb
File diff suppressed because one or more lines are too long
@ -555,7 +555,7 @@ class ApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> findEnqQuotePolicyView(id) async {
|
Future<Map<String, dynamic>> findEnqQuotePolicyView(id) async {
|
||||||
// print(_token);
|
print('findEnqQuotePolicyView - $id');
|
||||||
if (_token == null) {
|
if (_token == null) {
|
||||||
await _initializeToken();
|
await _initializeToken();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
"email": controllers["email"]?.text,
|
"email": controllers["email"]?.text,
|
||||||
"reg_no": controllers["regNo"]?.text,
|
"reg_no": controllers["regNo"]?.text,
|
||||||
"vehicle_type_id": selectedVehicleType,
|
"vehicle_type_id": selectedVehicleType,
|
||||||
"insurer_id": selectedInsurer,
|
// "insurer_id": selectedInsurer,
|
||||||
// "rc_file_name": "rc_doc.pdf",
|
// "rc_file_name": "rc_doc.pdf",
|
||||||
// "id_proof_file_name": "id_proof.pdf",
|
// "id_proof_file_name": "id_proof.pdf",
|
||||||
// "previous_policy_file_name": "previous_policy.pdf",
|
// "previous_policy_file_name": "previous_policy.pdf",
|
||||||
@ -596,21 +596,24 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
_buildResponsiveRow(
|
_buildResponsiveRow(
|
||||||
context,
|
context,
|
||||||
buildVehicleType(context),
|
buildVehicleType(context),
|
||||||
buildInsurer(context),
|
// buildInsurer(context),
|
||||||
),
|
|
||||||
isMobile ? SizedBox(height: 5) : SizedBox(height: 20),
|
|
||||||
|
|
||||||
_buildResponsiveRow(
|
|
||||||
context,
|
|
||||||
buildUploadRCDocument(context),
|
buildUploadRCDocument(context),
|
||||||
|
),
|
||||||
|
isMobile ? SizedBox(height: 5) : SizedBox(height: 20),
|
||||||
|
|
||||||
|
_buildResponsiveRow(
|
||||||
|
context,
|
||||||
|
// buildUploadRCDocument(context),
|
||||||
buildUploadIDDocument(context),
|
buildUploadIDDocument(context),
|
||||||
|
buildUploadPolicyDocument(context),
|
||||||
),
|
),
|
||||||
|
|
||||||
isMobile ? SizedBox(height: 5) : SizedBox(height: 20),
|
isMobile ? SizedBox(height: 5) : SizedBox(height: 20),
|
||||||
_buildResponsiveRow(
|
_buildResponsiveRow(
|
||||||
context,
|
context,
|
||||||
buildUploadPolicyDocument(context),
|
// buildUploadPolicyDocument(context),
|
||||||
buildRemarks(context),
|
buildRemarks(context),
|
||||||
|
SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -11,10 +11,10 @@ import '../../providers/userRoleProvider.dart';
|
|||||||
final enquiriesProvider = Provider<List<Map<String, String>>>((ref) {
|
final enquiriesProvider = Provider<List<Map<String, String>>>((ref) {
|
||||||
return List.generate(5, (i) {
|
return List.generate(5, (i) {
|
||||||
return {
|
return {
|
||||||
"reg": "TN64V4387",
|
"reg": "rrTN64V4387",
|
||||||
"company": "New India",
|
"company": "rrNew India",
|
||||||
"date": "09/09/2025",
|
"date": "rr09/09/2025",
|
||||||
"time": "11:30 AM",
|
"time": "rr11:30 AM",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -54,14 +54,19 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
String? earningsMonth;
|
String? earningsMonth;
|
||||||
String? earningsYear;
|
String? earningsYear;
|
||||||
String? quotationsPendingCounts; // cross verify
|
String? quotationsPendingCounts; // cross verify
|
||||||
|
String? currentKey; // cross verify
|
||||||
|
|
||||||
// List<Map<String, dynamic>> dataVal = [];
|
// List<Map<String, dynamic>> dataVal = [];
|
||||||
List<Map<String, dynamic>> getStaffData = [];
|
List<Map<String, dynamic>> getStaffData = [];
|
||||||
List<Map<String, dynamic>> originalData = [];
|
List<Map<String, dynamic>> originalData = [];
|
||||||
List<Map<String, dynamic>> filteredData = [];
|
List<Map<String, dynamic>> filteredData = [];
|
||||||
|
int selectedTabIndex = 0;
|
||||||
|
List<Map<String, dynamic>> currentList = [];
|
||||||
|
|
||||||
List<Map<String, dynamic>> quotationsPendingList = []; // cross verify
|
List<Map<String, dynamic>> quotationsPendingList = []; // cross verify
|
||||||
List<Map<String, dynamic>> policiesPendingList = []; // cross verify
|
List<Map<String, dynamic>> policiesPendingList = []; // cross verify
|
||||||
|
List<Map<String, dynamic>> awaitingApprovalList = []; // cross verify
|
||||||
|
List<Map<String, dynamic>> unAssignedEnqList = []; // cross verify
|
||||||
List<Map<String, dynamic>> agentsPerformanceList = []; // cross verify
|
List<Map<String, dynamic>> agentsPerformanceList = []; // cross verify
|
||||||
List<Map<String, dynamic>> nonAgentsPerformanceList = []; // cross verify
|
List<Map<String, dynamic>> nonAgentsPerformanceList = []; // cross verify
|
||||||
|
|
||||||
@ -98,15 +103,53 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('B99 => getStaffListData => ${response['data']}');
|
print('B99 => getStaffListData => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
policiesIssuedToday = data['policies_issued']['today'].toString();
|
// policiesIssuedToday = data['policies_issued']['today'].toString();
|
||||||
policiesIssuedYear = data['policies_issued']['year'].toString();
|
// policiesIssuedYear = data['policies_issued']['year'].toString();
|
||||||
policiesIssuedMonth = data['policies_issued']['month'].toString();
|
// policiesIssuedMonth = data['policies_issued']['month'].toString();
|
||||||
premiumValueToday = data['premium_value']['today'].toString();
|
// premiumValueToday = data['premium_value']['today'].toString();
|
||||||
premiumValueYear = data['premium_value']['year'].toString();
|
// premiumValueYear = data['premium_value']['year'].toString();
|
||||||
premiumValueMonth = data['premium_value']['month'].toString();
|
// premiumValueMonth = data['premium_value']['month'].toString();
|
||||||
earningsToday = data['earnings']['today'].toString();
|
// earningsToday = data['earnings']['today'].toString();
|
||||||
earningsYear = data['earnings']['year'].toString();
|
// earningsYear = data['earnings']['year'].toString();
|
||||||
earningsMonth = data['earnings']['month'].toString();
|
// earningsMonth = data['earnings']['month'].toString();
|
||||||
|
|
||||||
|
// Policies Issued
|
||||||
|
if (data['policies_issued'] != null) {
|
||||||
|
policiesIssuedToday =
|
||||||
|
data['policies_issued']['today']?.toString() ?? "0";
|
||||||
|
policiesIssuedYear =
|
||||||
|
data['policies_issued']['year']?.toString() ?? "0";
|
||||||
|
policiesIssuedMonth =
|
||||||
|
data['policies_issued']['month']?.toString() ?? "0";
|
||||||
|
} else {
|
||||||
|
policiesIssuedToday = "0";
|
||||||
|
policiesIssuedYear = "0";
|
||||||
|
policiesIssuedMonth = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Premium Value
|
||||||
|
if (data['premium_value'] != null) {
|
||||||
|
premiumValueToday =
|
||||||
|
data['premium_value']['today']?.toString() ?? "0";
|
||||||
|
premiumValueYear = data['premium_value']['year']?.toString() ?? "0";
|
||||||
|
premiumValueMonth =
|
||||||
|
data['premium_value']['month']?.toString() ?? "0";
|
||||||
|
} else {
|
||||||
|
premiumValueToday = "0";
|
||||||
|
premiumValueYear = "0";
|
||||||
|
premiumValueMonth = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Earnings
|
||||||
|
if (data['earnings'] != null) {
|
||||||
|
earningsToday = data['earnings']['today']?.toString() ?? "0";
|
||||||
|
earningsYear = data['earnings']['year']?.toString() ?? "0";
|
||||||
|
earningsMonth = data['earnings']['month']?.toString() ?? "0";
|
||||||
|
} else {
|
||||||
|
earningsToday = "0";
|
||||||
|
earningsYear = "0";
|
||||||
|
earningsMonth = "0";
|
||||||
|
}
|
||||||
|
|
||||||
// agents_performance
|
// agents_performance
|
||||||
if (data['agents_performance'] != null) {
|
if (data['agents_performance'] != null) {
|
||||||
@ -115,6 +158,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
(item) => Map<String, dynamic>.from(item),
|
(item) => Map<String, dynamic>.from(item),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
agentsPerformanceList.sort((a, b) {
|
agentsPerformanceList.sort((a, b) {
|
||||||
int aValue = a['total_policis_pending'] ?? 0;
|
int aValue = a['total_policis_pending'] ?? 0;
|
||||||
int bValue = b['total_policis_pending'] ?? 0;
|
int bValue = b['total_policis_pending'] ?? 0;
|
||||||
@ -138,6 +182,21 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data['quotations_pending'] != null) {
|
||||||
|
quotationsPendingList = List<Map<String, dynamic>>.from(
|
||||||
|
(data['quotations_pending'] as List).map(
|
||||||
|
(item) => Map<String, dynamic>.from(item),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data['quotations_approval_pending'] != null) {
|
||||||
|
awaitingApprovalList = List<Map<String, dynamic>>.from(
|
||||||
|
(data['quotations_approval_pending'] as List).map(
|
||||||
|
(item) => Map<String, dynamic>.from(item),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
if (data['policies_pending'] != null) {
|
if (data['policies_pending'] != null) {
|
||||||
policiesPendingList = List<Map<String, dynamic>>.from(
|
policiesPendingList = List<Map<String, dynamic>>.from(
|
||||||
(data['policies_pending'] as List).map(
|
(data['policies_pending'] as List).map(
|
||||||
@ -146,9 +205,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data['quotations_pending'] != null) {
|
if (data['unassigned_enquiry'] != null) {
|
||||||
quotationsPendingList = List<Map<String, dynamic>>.from(
|
unAssignedEnqList = List<Map<String, dynamic>>.from(
|
||||||
(data['quotations_pending'] as List).map(
|
(data['unassigned_enquiry'] as List).map(
|
||||||
(item) => Map<String, dynamic>.from(item),
|
(item) => Map<String, dynamic>.from(item),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -177,7 +236,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
return MainLayout(
|
return MainLayout(
|
||||||
title: "Home",
|
title: "Home",
|
||||||
body: ResponsiveBuilder.isMobile(context)
|
body: ResponsiveBuilder.isMobile(context)
|
||||||
? Expanded(
|
? Container(
|
||||||
|
// color: Colors.redAccent,
|
||||||
|
// height: MediaQuery.of(context).size.height,
|
||||||
// ✅ take available space
|
// ✅ take available space
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
@ -238,29 +299,57 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
borderRadius: BorderRadius.circular(25),
|
borderRadius: BorderRadius.circular(25),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Padding(
|
||||||
child: buildTab("Enquiries Pending", 0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: buildTab("Awaiting Quotation", 0),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Padding(
|
||||||
child: buildTab("Quotation Pending", 1),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: buildTab("Awaiting Approval", 1),
|
||||||
|
),
|
||||||
|
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: buildTab("Awaiting Policy", 2),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
// 🔹 Scrollable list
|
// 🔹 Scrollable list
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
itemCount: enquiries.length,
|
itemCount: currentList.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics:
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
const NeverScrollableScrollPhysics(), // disable inner scroll
|
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final item = enquiries[index];
|
final item = currentList[index];
|
||||||
|
|
||||||
|
// Split date & time from created_on
|
||||||
|
String date = "";
|
||||||
|
String time = "";
|
||||||
|
if ((item['created_on'] ?? "").isNotEmpty) {
|
||||||
|
final parts = item['created_on'].split(' ');
|
||||||
|
date = parts[0];
|
||||||
|
if (parts.isNotEmpty) {
|
||||||
|
DateTime parsedDate = DateTime.parse(
|
||||||
|
parts[0],
|
||||||
|
);
|
||||||
|
date = DateFormat(
|
||||||
|
'dd/MM/yyyy',
|
||||||
|
).format(parsedDate); // 19/09/2025
|
||||||
|
}
|
||||||
|
time = parts.length > 1 ? parts[1] : "";
|
||||||
|
}
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 2,
|
elevation: 2,
|
||||||
margin: const EdgeInsets.symmetric(vertical: 8),
|
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||||
@ -270,30 +359,33 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
item["reg"]!,
|
item["reg_no"] ?? "-", // from API
|
||||||
style: GoogleFonts.inter(
|
style: GoogleFonts.inter(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
|
||||||
item["company"]!,
|
subtitle: (currentKey == 'policies')
|
||||||
|
? Text(
|
||||||
|
item["insurer_name"] ?? "-",
|
||||||
style: GoogleFonts.inter(
|
style: GoogleFonts.inter(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
|
: SizedBox.shrink(),
|
||||||
trailing: Column(
|
trailing: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
item["date"]!,
|
'$date ${time}',
|
||||||
style: GoogleFonts.inter(fontSize: 12),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
item["time"]!,
|
|
||||||
style: GoogleFonts.inter(fontSize: 12),
|
style: GoogleFonts.inter(fontSize: 12),
|
||||||
),
|
),
|
||||||
|
// Text(
|
||||||
|
// (time ?? "").toString().split(" ").last,
|
||||||
|
// style: GoogleFonts.inter(fontSize: 12),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -348,50 +440,37 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (role == 'manager')
|
|
||||||
SizedBox(
|
|
||||||
// ✅ replace Expanded
|
|
||||||
height: 350, // adjust height as needed
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Performance(
|
|
||||||
title: "Top Agent Performance",
|
|
||||||
data: agentsPerformanceList,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 16),
|
|
||||||
Expanded(
|
|
||||||
child: Performance(
|
|
||||||
title: "Bottom Non-Performing Agents",
|
|
||||||
data: nonAgentsPerformanceList,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
// ✅ replace Expanded
|
// ✅ replace Expanded
|
||||||
height: (role == 'agent')
|
height: (role == 'agent')
|
||||||
? MediaQuery.of(context).size.height *
|
? MediaQuery.of(context).size.height *
|
||||||
0.69 //400
|
0.69 //400
|
||||||
|
: (role == 'manager')
|
||||||
|
? MediaQuery.of(context).size.height * 0.5
|
||||||
: MediaQuery.of(context).size.height *
|
: MediaQuery.of(context).size.height *
|
||||||
0.5, // 350 adjust height as needed
|
0.85, // 350 adjust height as needed
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: (role == 'agent')
|
child: (role == 'agent')
|
||||||
? agentPendings(
|
? agentPendings(
|
||||||
title:
|
title:
|
||||||
"Enquiries Pending (${policiesPendingList.length})",
|
"Awaiting Quotation (${quotationsPendingList.length})",
|
||||||
data: policiesPendingList,
|
data: quotationsPendingList,
|
||||||
)
|
)
|
||||||
: othersPendings(
|
: (role == 'manager')
|
||||||
|
? othersPendings(
|
||||||
title:
|
title:
|
||||||
"Quotations Pending (${quotationsPendingList.length})",
|
"Awaiting Quotation (${quotationsPendingList.length})",
|
||||||
data: quotationsPendingList,
|
data: quotationsPendingList,
|
||||||
stringFlag: "Quotation",
|
stringFlag: "Quotation",
|
||||||
|
)
|
||||||
|
: agentPendings(
|
||||||
|
title:
|
||||||
|
"Awaiting Quotation (${quotationsPendingList.length})",
|
||||||
|
data: quotationsPendingList,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
@ -399,14 +478,73 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
child: (role == 'agent')
|
child: (role == 'agent')
|
||||||
? agentPendings(
|
? agentPendings(
|
||||||
title:
|
title:
|
||||||
"Quotations Pending (${quotationsPendingList.length})",
|
"Awaiting Approval (${awaitingApprovalList.length})",
|
||||||
data: quotationsPendingList,
|
data: awaitingApprovalList,
|
||||||
)
|
)
|
||||||
: othersPendings(
|
: (role == 'manager')
|
||||||
|
? awaitingApproval(
|
||||||
title:
|
title:
|
||||||
"Policies Pending (${policiesPendingList.length})",
|
"Awaiting Approval (${awaitingApprovalList.length})",
|
||||||
|
data: awaitingApprovalList,
|
||||||
|
stringFlag: "Quotation",
|
||||||
|
)
|
||||||
|
: agentPendings(
|
||||||
|
title:
|
||||||
|
"Awaiting Approval (${awaitingApprovalList.length})",
|
||||||
|
data: awaitingApprovalList,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: (role == 'agent')
|
||||||
|
? agentPendings(
|
||||||
|
title:
|
||||||
|
"Awaiting Policy (${policiesPendingList.length})",
|
||||||
data: policiesPendingList,
|
data: policiesPendingList,
|
||||||
stringFlag: "Policies",
|
stringFlag: "Policies",
|
||||||
|
)
|
||||||
|
: (role == 'manager')
|
||||||
|
? othersPendings(
|
||||||
|
title:
|
||||||
|
"Awaiting Policy (${policiesPendingList.length})",
|
||||||
|
data: policiesPendingList,
|
||||||
|
stringFlag: "Policies",
|
||||||
|
)
|
||||||
|
: agentPendings(
|
||||||
|
title:
|
||||||
|
"Awaiting Policy (${policiesPendingList.length})",
|
||||||
|
data: policiesPendingList,
|
||||||
|
stringFlag: "Policies",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
if (role == 'manager')
|
||||||
|
SizedBox(
|
||||||
|
// ✅ replace Expanded
|
||||||
|
height: 350, // adjust height as needed
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: UnassignedEnq(
|
||||||
|
title: "Unassigned Enquires",
|
||||||
|
data: unAssignedEnqList,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Performance(
|
||||||
|
title: "Performing Agents",
|
||||||
|
data: agentsPerformanceList,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Performance(
|
||||||
|
title: "Non-Performing Agents",
|
||||||
|
data: nonAgentsPerformanceList,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -465,14 +603,14 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
// children: [
|
// children: [
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: Performance(
|
// child: Performance(
|
||||||
// title: "Top Agent Performance",
|
// title: "Performing Agents",
|
||||||
// data: agentsPerformanceList,
|
// data: agentsPerformanceList,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// SizedBox(width: 16),
|
// SizedBox(width: 16),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: Performance(
|
// child: Performance(
|
||||||
// title: "Bottom Non-Performing Agents",
|
// title: "Non-Performing Agents",
|
||||||
// data: nonAgentsPerformanceList,
|
// data: nonAgentsPerformanceList,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
@ -528,38 +666,78 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Widget buildTab(String title, int index) {
|
||||||
|
// final isSelected = selectedIndex == index + 1;
|
||||||
|
// return GestureDetector(
|
||||||
|
// onTap: () {
|
||||||
|
// print('buildTab - $index');
|
||||||
|
//
|
||||||
|
// setState(() {
|
||||||
|
// selectedIndex = index + 1;
|
||||||
|
// print('buildTab1 - $selectedIndex');
|
||||||
|
// if (selectedIndex == 2) {
|
||||||
|
// switcherStatus = 0;
|
||||||
|
// } else {
|
||||||
|
// switcherStatus = 1;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// child: SizedBox(
|
||||||
|
// child: Container(
|
||||||
|
// padding: EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: isSelected ? const Color(0xFFFFFFFF) : Colors.transparent,
|
||||||
|
// borderRadius: BorderRadius.circular(16),
|
||||||
|
// ),
|
||||||
|
// child: Center(
|
||||||
|
// child: Text(
|
||||||
|
// title,
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// fontSize: 12,
|
||||||
|
//
|
||||||
|
// color: isSelected ? Colors.black : Colors.white,
|
||||||
|
// fontWeight: FontWeight.w500,
|
||||||
|
// ),
|
||||||
|
// maxLines: 2,
|
||||||
|
// softWrap: true,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
Widget buildTab(String title, int index) {
|
Widget buildTab(String title, int index) {
|
||||||
final isSelected = selectedIndex == index + 1;
|
final isSelected = selectedTabIndex == index;
|
||||||
|
if (selectedTabIndex == 0) {
|
||||||
|
currentList = quotationsPendingList;
|
||||||
|
currentKey = 'pending';
|
||||||
|
} else if (selectedTabIndex == 1) {
|
||||||
|
currentList = awaitingApprovalList;
|
||||||
|
currentKey = 'approval';
|
||||||
|
} else if (selectedTabIndex == 2) {
|
||||||
|
currentList = policiesPendingList;
|
||||||
|
currentKey = 'policies';
|
||||||
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedIndex = index + 1;
|
selectedTabIndex = index;
|
||||||
if (selectedIndex == 2) {
|
|
||||||
switcherStatus = 0;
|
|
||||||
} else {
|
|
||||||
switcherStatus = 1;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected ? const Color(0xFFFFFFFF) : Colors.transparent,
|
color: isSelected ? Colors.white : Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(20),
|
||||||
),
|
),
|
||||||
child: Center(
|
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.inter(
|
||||||
fontSize: 12,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
color: isSelected ? Colors.black : Colors.white,
|
color: isSelected ? const Color(0xFF425B5B) : Colors.white,
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
|
||||||
softWrap: true,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -682,9 +860,14 @@ class StatCard extends StatelessWidget {
|
|||||||
|
|
||||||
class agentPendings extends StatelessWidget {
|
class agentPendings extends StatelessWidget {
|
||||||
final String title;
|
final String title;
|
||||||
|
final String? stringFlag;
|
||||||
final List<Map<String, dynamic>> data;
|
final List<Map<String, dynamic>> data;
|
||||||
const agentPendings({Key? key, required this.title, required this.data})
|
const agentPendings({
|
||||||
: super(key: key);
|
Key? key,
|
||||||
|
required this.title,
|
||||||
|
required this.data,
|
||||||
|
this.stringFlag,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -865,6 +1048,15 @@ class agentPendings extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
"S.No",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Date & Time",
|
"Date & Time",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@ -872,13 +1064,16 @@ class agentPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Registration number",
|
"Registration number",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (stringFlag == "Policies") ...[
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Insurer Company",
|
"Insurer Company",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@ -886,6 +1081,7 @@ class agentPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
@ -924,8 +1120,17 @@ class agentPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
(index + 1).toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
// Date & Time
|
// Date & Time
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -937,22 +1142,25 @@ class agentPendings extends StatelessWidget {
|
|||||||
|
|
||||||
// Registration number
|
// Registration number
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
row['reg_no'] ?? "",
|
row['reg_no'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (stringFlag == "Policies") ...[
|
||||||
// Insurer company
|
// Insurer company
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
row['insurer_name'] ?? "",
|
row['insurer_short_name'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -1022,21 +1230,22 @@ class othersPendings extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
stringFlag + " Issued",
|
// stringFlag + " Issued",
|
||||||
|
'Pending Count',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(stringFlag == "Policies")
|
// (stringFlag == "Policies")
|
||||||
? Expanded(
|
// ? Expanded(
|
||||||
flex: 2,
|
// flex: 2,
|
||||||
child: Text(
|
// child: Text(
|
||||||
"Total Premium Value",
|
// "Total Premium Value",
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
// style: _headerStyle,
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
: const SizedBox.shrink(),
|
// : const SizedBox.shrink(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1081,6 +1290,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
row['staff_name'] ?? "",
|
row['staff_name'] ?? "",
|
||||||
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
@ -1090,23 +1300,182 @@ class othersPendings extends StatelessWidget {
|
|||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
issuedCount,
|
issuedCount,
|
||||||
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
stringFlag == "Policies"
|
// stringFlag == "Policies"
|
||||||
? Expanded(
|
// ? Expanded(
|
||||||
|
// flex: 2,
|
||||||
|
// child: Text(
|
||||||
|
// formatToCroresLakhsAndThousands(permiumValue),
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
// style: GoogleFonts.inter(
|
||||||
|
// fontSize: 14,
|
||||||
|
// fontWeight: FontWeight.w500,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : const SizedBox.shrink(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class awaitingApproval extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final String stringFlag;
|
||||||
|
final List<Map<String, dynamic>> data;
|
||||||
|
|
||||||
|
awaitingApproval({
|
||||||
|
Key? key,
|
||||||
|
required this.title,
|
||||||
|
required this.data,
|
||||||
|
required this.stringFlag,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
print(' Data: $data');
|
||||||
|
|
||||||
|
return Card(
|
||||||
|
color: const Color(0xFFEAF6F4),
|
||||||
|
elevation: 0,
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Title
|
||||||
|
Text(title, style: _title),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
|
// Header row
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF3E5B56),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
"S.No",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
formatToCroresLakhsAndThousands(permiumValue),
|
"Staff Name",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: GoogleFonts.inter(
|
style: _headerStyle,
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
Expanded(
|
||||||
: const SizedBox.shrink(),
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
// stringFlag + " Issued",
|
||||||
|
'Pending Count',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// (stringFlag == "Policies")
|
||||||
|
// ? Expanded(
|
||||||
|
// flex: 2,
|
||||||
|
// child: Text(
|
||||||
|
// "Total Premium Value",
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
// style: _headerStyle,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : const SizedBox.shrink(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
|
||||||
|
// List of rows
|
||||||
|
Flexible(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: data.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final row = data[index];
|
||||||
|
|
||||||
|
final issuedCount = stringFlag == "Policies"
|
||||||
|
? (row['total_policis_pending'] ?? 0).toString()
|
||||||
|
: (row['total_quotation_pending'] ?? 0).toString();
|
||||||
|
|
||||||
|
final permiumValue = row['total_premium_value'] == null
|
||||||
|
? '0'
|
||||||
|
: row['total_premium_value'];
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 5),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 5,
|
||||||
|
horizontal: 12,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
(index + 1).toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
row['staff_name'] ?? "",
|
||||||
|
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
// issuedCount,
|
||||||
|
(row['total_approval_pending'] ?? 0).toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// stringFlag == "Policies"
|
||||||
|
// ? Expanded(
|
||||||
|
// flex: 2,
|
||||||
|
// child: Text(
|
||||||
|
// formatToCroresLakhsAndThousands(permiumValue),
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
// style: GoogleFonts.inter(
|
||||||
|
// fontSize: 14,
|
||||||
|
// fontWeight: FontWeight.w500,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : const SizedBox.shrink(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -1174,9 +1543,7 @@ class Performance extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
title == "Top Agent Performance"
|
title == "Performing Agents" ? "Premium Value" : "Status",
|
||||||
? "Premium Value"
|
|
||||||
: "Status",
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
@ -1232,7 +1599,7 @@ class Performance extends StatelessWidget {
|
|||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
title == "Top Agent Performance"
|
title == "Performing Agents"
|
||||||
? formatToCroresLakhsAndThousands(
|
? formatToCroresLakhsAndThousands(
|
||||||
row['total_premium_value'] ?? 0,
|
row['total_premium_value'] ?? 0,
|
||||||
)
|
)
|
||||||
@ -1241,7 +1608,7 @@ class Performance extends StatelessWidget {
|
|||||||
style: GoogleFonts.inter(
|
style: GoogleFonts.inter(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: title == "Top Agent Performance"
|
color: title == "Performing Agents"
|
||||||
? Colors.black
|
? Colors.black
|
||||||
: (row['status']?.toString().toLowerCase() ==
|
: (row['status']?.toString().toLowerCase() ==
|
||||||
"active"
|
"active"
|
||||||
@ -1263,6 +1630,119 @@ class Performance extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UnassignedEnq extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final List<Map<String, dynamic>> data;
|
||||||
|
|
||||||
|
UnassignedEnq({Key? key, required this.title, required this.data})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Card(
|
||||||
|
color: const Color(0xFFEAF6F4),
|
||||||
|
elevation: 0,
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Title
|
||||||
|
Text(title, style: _title),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
|
// Header row
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF3E5B56),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"S.No",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"Registration number",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"Date",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
|
||||||
|
// List of rows
|
||||||
|
Flexible(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: data.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final row = data[index];
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
// height: 5200,
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 5),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 5,
|
||||||
|
horizontal: 12,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
(index + 1).toString(), // convert int to string
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
row['reg_no'] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
row['created_on'] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final _headerStyle = GoogleFonts.inter(
|
final _headerStyle = GoogleFonts.inter(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
|||||||
@ -287,7 +287,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
regNum,
|
regNum,
|
||||||
) {
|
) {
|
||||||
return [
|
return [
|
||||||
if (roleId == 'manager' && data['status'] != 'Quotation Created') ...[
|
if (roleId == 'manager' && data['status'] == 'Awaiting Quotation') ...[
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
|||||||
@ -250,7 +250,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
selectedEnquiryId = enquiryData['id'];
|
selectedEnquiryId = enquiryData['id'];
|
||||||
print('selectedEnquiryId- $selectedEnquiryId');
|
print('selectedEnquiryId- $selectedEnquiryId');
|
||||||
controllers["regNum"]?.text = enquiryData['reg_no'];
|
controllers["regNum"]?.text = enquiryData['reg_no'];
|
||||||
controllers["insurer"]?.text = enquiryData['insurer_name'];
|
// controllers["insurer"]?.text = enquiryData['insurer_name'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,6 +266,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
if (quotationAcceptedData != null) {
|
if (quotationAcceptedData != null) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
|
controllers["insurer"]?.text = quotationAcceptedData?['insurer_name'];
|
||||||
acceptedQuotationId = quotationAcceptedData?['id']?.toString() ?? '';
|
acceptedQuotationId = quotationAcceptedData?['id']?.toString() ?? '';
|
||||||
controllers["idv"]?.text =
|
controllers["idv"]?.text =
|
||||||
quotationAcceptedData?['insured_declared_value']?.toString() ??
|
quotationAcceptedData?['insured_declared_value']?.toString() ??
|
||||||
@ -764,7 +765,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -805,7 +806,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -842,7 +843,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -882,7 +883,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
final path =
|
final path =
|
||||||
'api/quotation/downloadAdditionalUploadedFile?id=$acceptedQuotationId';
|
'api/quotation/downloadAdditionalUploadedFile?id=$acceptedQuotationId';
|
||||||
|
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -1207,6 +1208,19 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
controllers['startDate']?.text = DateFormat(
|
controllers['startDate']?.text = DateFormat(
|
||||||
'dd-MM-yyyy',
|
'dd-MM-yyyy',
|
||||||
).format(date);
|
).format(date);
|
||||||
|
|
||||||
|
// auto set end date (1 year later - 1 day if needed)
|
||||||
|
final endDate = DateTime(
|
||||||
|
date.year + 1,
|
||||||
|
date.month,
|
||||||
|
date.day,
|
||||||
|
).subtract(const Duration(days: 1)); // optional: subtract 1 day
|
||||||
|
|
||||||
|
controllers['endDate']?.text = DateFormat(
|
||||||
|
'dd-MM-yyyy',
|
||||||
|
).format(endDate);
|
||||||
|
|
||||||
|
print("Auto-set End Date: $endDate");
|
||||||
// controllers['date']?.text = date as String;
|
// controllers['date']?.text = date as String;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -1227,13 +1241,75 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
: MediaQuery.of(context).size.width * 0.26,
|
: MediaQuery.of(context).size.width * 0.26,
|
||||||
txtheight: 50,
|
txtheight: 50,
|
||||||
// backgroundColor: const Color(0xFFECECEC),
|
// backgroundColor: const Color(0xFFECECEC),
|
||||||
validator: (value) => Validators.requiredField(value, "date"),
|
// validator: (value) => Validators.requiredField(value, "date"),
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return "Required";
|
||||||
|
}
|
||||||
|
|
||||||
|
final startDateControllerText = controllers['startDate']?.text;
|
||||||
|
if (startDateControllerText == null ||
|
||||||
|
startDateControllerText.isEmpty) {
|
||||||
|
return "Select start date first";
|
||||||
|
}
|
||||||
|
|
||||||
|
final startDate = DateFormat(
|
||||||
|
'dd-MM-yyyy',
|
||||||
|
).parse(startDateControllerText);
|
||||||
|
final endDate = DateFormat('dd-MM-yyyy').parse(value);
|
||||||
|
|
||||||
|
if (endDate.isBefore(startDate)) {
|
||||||
|
return "End date cannot be before start date";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minimum end date = start date + 1 year - 1 day (or just +1 year)
|
||||||
|
final minEndDate = DateTime(
|
||||||
|
startDate.year + 1,
|
||||||
|
startDate.month,
|
||||||
|
startDate.day,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (endDate.isBefore(minEndDate)) {
|
||||||
|
return "End date must be at least 1 year from start date";
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// final startDateControllerText = controllers['startDate']?.text;
|
||||||
|
// if (startDateControllerText == null ||
|
||||||
|
// startDateControllerText.isEmpty) {
|
||||||
|
// return "Select start date first";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// final startDate = DateFormat(
|
||||||
|
// 'dd-MM-yyyy',
|
||||||
|
// ).parse(startDateControllerText);
|
||||||
|
// final endDate = DateFormat('dd-MM-yyyy').parse(value);
|
||||||
|
//
|
||||||
|
// if (endDate.isBefore(startDate)) {
|
||||||
|
// return "End date cannot be before start date";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// final expectedEndDate = DateTime(
|
||||||
|
// startDate.year + 1,
|
||||||
|
// startDate.month,
|
||||||
|
// startDate.day,
|
||||||
|
// ).subtract(const Duration(days: 1));
|
||||||
|
//
|
||||||
|
// if (endDate != expectedEndDate) {
|
||||||
|
// return "End date must be exactly 1 year from start date";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return null; // valid
|
||||||
|
},
|
||||||
controller: controllers['endDate']!,
|
controller: controllers['endDate']!,
|
||||||
onDateSelected: (date) {
|
onDateSelected: (date) {
|
||||||
print("Picked Date: $date");
|
print("Picked Date: $date");
|
||||||
|
|
||||||
controllers['endDate']?.text = DateFormat(
|
controllers['endDate']?.text = DateFormat(
|
||||||
'dd-MM-yyyy',
|
'dd-MM-yyyy',
|
||||||
).format(date);
|
).format(date);
|
||||||
|
_formKey.currentState?.validate();
|
||||||
// controllers['date']?.text = date as String;
|
// controllers['date']?.text = date as String;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -46,6 +46,10 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
|
|
||||||
String? selectedFileNames;
|
String? selectedFileNames;
|
||||||
|
|
||||||
|
List<Map<String, dynamic>> getInsurersData = [];
|
||||||
|
List<Map<String, dynamic>> filteredInsurersData = [];
|
||||||
|
String? selectedInsurer;
|
||||||
|
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
late TextEditingController controller;
|
late TextEditingController controller;
|
||||||
Map<String, TextEditingController> controllers = {};
|
Map<String, TextEditingController> controllers = {};
|
||||||
@ -59,6 +63,9 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
final GlobalKey<DropdownSearchState<Map<String, dynamic>>> dropDownKey =
|
final GlobalKey<DropdownSearchState<Map<String, dynamic>>> dropDownKey =
|
||||||
GlobalKey<DropdownSearchState<Map<String, dynamic>>>();
|
GlobalKey<DropdownSearchState<Map<String, dynamic>>>();
|
||||||
|
|
||||||
|
final GlobalKey<DropdownSearchState<Map<String, dynamic>>>
|
||||||
|
dropDownKeyInsurer = GlobalKey<DropdownSearchState<Map<String, dynamic>>>();
|
||||||
|
|
||||||
List<String> tabHeader = ['idv', 'premium_Amount'];
|
List<String> tabHeader = ['idv', 'premium_Amount'];
|
||||||
|
|
||||||
List<Map<String, dynamic>> getInsuranceTypeData = [];
|
List<Map<String, dynamic>> getInsuranceTypeData = [];
|
||||||
@ -71,6 +78,7 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
final data = {
|
final data = {
|
||||||
"enquiry_id": widget.selectedEnquiryId,
|
"enquiry_id": widget.selectedEnquiryId,
|
||||||
"insured_declared_value": controllers["idv"]?.text,
|
"insured_declared_value": controllers["idv"]?.text,
|
||||||
|
"insurer_id": selectedInsurer,
|
||||||
"premium_amount": controllers["premium_Amount"]?.text,
|
"premium_amount": controllers["premium_Amount"]?.text,
|
||||||
"insurance_plan_type_id": selectedInsPlanType,
|
"insurance_plan_type_id": selectedInsPlanType,
|
||||||
// "additional_uploaded_file_name": "extra_doc.pdf",
|
// "additional_uploaded_file_name": "extra_doc.pdf",
|
||||||
@ -91,6 +99,7 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
// 🔹 Init logic here (API calls, token fetch, etc.)
|
// 🔹 Init logic here (API calls, token fetch, etc.)
|
||||||
_initializeToken();
|
_initializeToken();
|
||||||
getInsuranceType();
|
getInsuranceType();
|
||||||
|
getInsurers();
|
||||||
updateData();
|
updateData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +135,9 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
.selectedQuotationFrmListdata!['insurance_plan_type_id']
|
.selectedQuotationFrmListdata!['insurance_plan_type_id']
|
||||||
?.toString();
|
?.toString();
|
||||||
|
|
||||||
|
selectedInsurer =
|
||||||
|
widget.selectedQuotationFrmListdata!['insurer_id']?.toString() ?? '';
|
||||||
|
|
||||||
String? apiDocPath =
|
String? apiDocPath =
|
||||||
widget.selectedQuotationFrmListdata!["additional_uploaded_file_name"];
|
widget.selectedQuotationFrmListdata!["additional_uploaded_file_name"];
|
||||||
if (apiDocPath != null && apiDocPath.isNotEmpty) {
|
if (apiDocPath != null && apiDocPath.isNotEmpty) {
|
||||||
@ -143,6 +155,37 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> getInsurers() async {
|
||||||
|
print('Insurers called');
|
||||||
|
setState(() {
|
||||||
|
isLoading = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await apiService.fetchMasterDropDown('Insurers');
|
||||||
|
|
||||||
|
if (response['status'] == 200) {
|
||||||
|
print('getInsurers - ${response['data']}');
|
||||||
|
setState(() {
|
||||||
|
getInsurersData = List<Map<String, dynamic>>.from(response['data']);
|
||||||
|
print('API Data - $getInsurersData');
|
||||||
|
|
||||||
|
filteredInsurersData = List.from(getInsurersData);
|
||||||
|
print('originalData - $filteredInsurersData');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getInsurersData = [];
|
||||||
|
filteredInsurersData = [];
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception occurred: $e');
|
||||||
|
} finally {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> getInsuranceType() async {
|
Future<void> getInsuranceType() async {
|
||||||
print('getClaimList called');
|
print('getClaimList called');
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -383,6 +426,7 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
buildIdv(context),
|
buildIdv(context),
|
||||||
|
buildInsurer(context),
|
||||||
buildInsurancePlanType(context),
|
buildInsurancePlanType(context),
|
||||||
buildPremiumAmnt(context),
|
buildPremiumAmnt(context),
|
||||||
buildDocuments(context),
|
buildDocuments(context),
|
||||||
@ -420,6 +464,97 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildInsurer(BuildContext context) {
|
||||||
|
Map<String, dynamic>? selectedInsurerd = filteredInsurersData.firstWhere(
|
||||||
|
(item) => item['id'].toString() == selectedInsurer,
|
||||||
|
orElse: () => {},
|
||||||
|
);
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text('Insurer *', style: _textStyle),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
width: ResponsiveLayout.isMobile(context)
|
||||||
|
? null
|
||||||
|
: MediaQuery.of(context).size.width * 0.26,
|
||||||
|
// height: 40,
|
||||||
|
child: DropdownSearch<Map<String, dynamic>>(
|
||||||
|
key: dropDownKeyInsurer,
|
||||||
|
selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null,
|
||||||
|
items: (filter, infiniteScrollProps) {
|
||||||
|
return filteredInsurersData;
|
||||||
|
},
|
||||||
|
|
||||||
|
itemAsString: (val) => val['name'].toString(), // what to show
|
||||||
|
compareFn: (item, selectedItem) =>
|
||||||
|
item['id'] == selectedItem['id'], // ✅ compare by id
|
||||||
|
validator: (val) {
|
||||||
|
if (val == null) {
|
||||||
|
return "Required"; // ✅ error message
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
decoratorProps: DropDownDecoratorProps(
|
||||||
|
decoration:
|
||||||
|
AppInputDecorations.dropdownDecoration(
|
||||||
|
label: "Select Insurer",
|
||||||
|
).copyWith(
|
||||||
|
filled: true,
|
||||||
|
fillColor: Color(
|
||||||
|
0xFFEDF6F5,
|
||||||
|
), // 👈 makes the dropdown input white
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
popupProps: PopupProps.menu(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
constraints: BoxConstraints(maxHeight: 250),
|
||||||
|
menuProps: MenuProps(
|
||||||
|
backgroundColor:
|
||||||
|
Colors.white, // 👈 sets dropdown background to white
|
||||||
|
),
|
||||||
|
showSearchBox: true,
|
||||||
|
searchFieldProps: TextFieldProps(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
hintText: "Search Insurer...",
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.white,
|
||||||
|
), // 👈 Normal border
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.white,
|
||||||
|
width: 1.5,
|
||||||
|
), // 👈 Focused border
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// constraints: BoxConstraints(),
|
||||||
|
),
|
||||||
|
|
||||||
|
onChanged: (val) {
|
||||||
|
if (val != null) {
|
||||||
|
print("Selected Insurer : ${val['name']}");
|
||||||
|
print("Id: ${val['id']}");
|
||||||
|
selectedInsurer = val['id'];
|
||||||
|
// controllers['agentId']?.text = val['agent_code'];
|
||||||
|
// agentId = agent['id'];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget buildPremiumAmnt(BuildContext context) {
|
Widget buildPremiumAmnt(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|||||||
@ -159,7 +159,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
selectedEnquiryId = enquiryData['id'];
|
selectedEnquiryId = enquiryData['id'];
|
||||||
print('selectedEnquiryId- $selectedEnquiryId');
|
print('selectedEnquiryId- $selectedEnquiryId');
|
||||||
controllers["regNum"]?.text = enquiryData['reg_no'];
|
controllers["regNum"]?.text = enquiryData['reg_no'];
|
||||||
controllers["insurer"]?.text = enquiryData['insurer_name'];
|
// controllers["insurer"]?.text = enquiryData['insurer_name'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,9 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
originalData = getQuotationData;
|
originalData = getQuotationData;
|
||||||
filteredData = List.from(originalData);
|
filteredData = List.from(originalData);
|
||||||
|
|
||||||
blockKey = getQuotationData.any((item) => item['status'] == 'Accepted');
|
blockKey = getQuotationData.any(
|
||||||
|
(item) => item['status'] == 'Accepted',
|
||||||
|
);
|
||||||
print('blockKey- $blockKey');
|
print('blockKey- $blockKey');
|
||||||
// print('originalData - $getClaimPolicies');
|
// print('originalData - $getClaimPolicies');
|
||||||
});
|
});
|
||||||
@ -339,8 +341,8 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
SizedBox(height: 15),
|
||||||
registerNumber(context),
|
registerNumber(context),
|
||||||
SizedBox(height: 16),
|
// SizedBox(height: 16),
|
||||||
insurer(context),
|
// insurer(context),
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
|
|
||||||
buildDocRC(context, isMobile),
|
buildDocRC(context, isMobile),
|
||||||
@ -376,13 +378,13 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
registerNumber(context),
|
registerNumber(context),
|
||||||
Spacer(),
|
SizedBox(width: 10),
|
||||||
insurer(context),
|
// insurer(context),
|
||||||
Spacer(),
|
// Spacer(),
|
||||||
buildDocRC(context, isMobile),
|
buildDocRC(context, isMobile),
|
||||||
Spacer(),
|
SizedBox(width: 10),
|
||||||
buildDocIdProof(context, isMobile),
|
buildDocIdProof(context, isMobile),
|
||||||
Spacer(),
|
SizedBox(width: 10),
|
||||||
buildDocPrevPolicy(context, isMobile),
|
buildDocPrevPolicy(context, isMobile),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -392,7 +394,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
],
|
],
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
if(!blockKey)...[
|
if (!blockKey) ...[
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 10),
|
padding: EdgeInsets.only(right: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -457,7 +459,8 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 20),],
|
const SizedBox(height: 20),
|
||||||
|
],
|
||||||
|
|
||||||
//3RD SECTION (TABLE)
|
//3RD SECTION (TABLE)
|
||||||
Container(
|
Container(
|
||||||
@ -529,7 +532,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -570,7 +573,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -607,7 +610,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(context, path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user