DASHBOARD HOVER

This commit is contained in:
venbaittech 2025-10-10 12:13:03 +05:30
parent c6d2928341
commit 9528ec2d67
13 changed files with 446 additions and 473 deletions

File diff suppressed because one or more lines are too long

View File

@ -347,7 +347,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
try {
await createUserData(dataSet); // API call
ToastHelper.showInfoToast(context, "Enquiry saved successfully");
// ToastHelper.showInfoToast(context, "Enquiry saved successfully");
} catch (e) {
showDialog(
context: context,

View File

@ -373,7 +373,9 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
size: ResponsiveLayout.isMobile(context) ? 25 : 25,
color: const Color(0xFF425B5B),
),
onPressed: () { context.go(AppRoutes.dashboard); },
onPressed: () {
context.go(AppRoutes.dashboard);
},
splashRadius: 18,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
@ -464,7 +466,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
),
),
],
if (ResponsiveLayout.isMobile(context)) SizedBox(height: 5),
Container(
// height: 40,
// color: Colors.pink,
@ -488,44 +490,9 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
},
),
// Form(
// key: _formKey,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// buildStartDate(context),
// SizedBox(width: 10),
// buildEndDate(context),
// SizedBox(width: 10),
//
// Padding(
// padding: const EdgeInsets.symmetric(
// vertical: 8.0,
// ),
// child: GestureDetector(
// // onTap: filterDateRange,
// onTap: () {
// if (_formKey.currentState!.validate()) {
// filterDateRange(); // only runs if valid
// }
// },
// child: Icon(Icons.filter_alt_outlined),
// ),
// ),
//
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: GestureDetector(
// onTap: refrshfilterDateRange,
// child: Icon(Icons.refresh),
// ),
// ),
// ],
// ),
// ),
Spacer(),
],
ThemedSearchField(
hintText: 'Search',
backgroundColor: Color(0xFFF6F8F8),
@ -535,8 +502,9 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
? MediaQuery.of(context).size.width * 0.6
: MediaQuery.of(context).size.width * 0.2,
),
SizedBox(width: 10),
ResponsiveLayout.isMobile(context)
? Spacer()
: SizedBox(width: 10),
ExportBtn(
sheetName: "Enquiry",
@ -781,27 +749,27 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
child: Row(
children: [
// GestureDetector(
// onTap: () {
// Navigator.pop(context);
// print('EDITStaff - ${item['id']}');
// // dynamic id = data['id'];
// // context.go('/tabEnquiry/$id');
// setState(() {
// final id = item['id'].toString();
// ref.read(enquiryIdProvider.notifier).state = id;
// });
// // update provider
//
// context.go(AppRoutes.tabEnquiry);
// },
// onTap: () {
// handleEdit(item);
// },
// child: Image.asset(
// "assets/miscellaneous/Edit.png",
// height: 15,
// width: 15,
// ),
// onTap: () {
// Navigator.pop(context);
// print('EDITStaff - ${item['id']}');
// // dynamic id = data['id'];
// // context.go('/tabEnquiry/$id');
// setState(() {
// final id = item['id'].toString();
// ref.read(enquiryIdProvider.notifier).state = id;
// });
// // update provider
//
// context.go(AppRoutes.tabEnquiry);
// },
// onTap: () {
// handleEdit(item);
// },
// child: Image.asset(
// "assets/miscellaneous/Edit.png",
// height: 15,
// width: 15,
// ),
// ),
Tooltip(
message: 'Edit',
@ -819,7 +787,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
padding: const EdgeInsets.all(8),
constraints: const BoxConstraints(),
),
)
),
],
),
),
@ -894,7 +862,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
padding: const EdgeInsets.all(8),
constraints: const BoxConstraints(),
),
)
),
// GestureDetector(
// // onTap: () {
// // Navigator.pop(context);

View File

@ -235,17 +235,17 @@ class AgentState extends ConsumerState<Agent> {
if (response.statusCode == 200 || response.statusCode == 201) {
// dispose();
print("Agent submitted successfully!");
print("Partner submitted successfully!");
print("Response: ${response.body}");
isUpdating
? ToastHelper.showSuccessToast(
context,
'Agent Updated Successfully',
'Partner Updated Successfully',
)
: ToastHelper.showSuccessToast(
context,
'Agent Created Successfully',
'Partner Created Successfully',
);
context.go(AppRoutes.agentLst);
} else {
@ -258,7 +258,7 @@ class AgentState extends ConsumerState<Agent> {
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Agent User Creation Failed"),
title: Text("Partner User Creation Failed"),
content: Text(
msg,
// "There was a problem in creating user. Please try again.",
@ -324,7 +324,7 @@ class AgentState extends ConsumerState<Agent> {
// managerId = ref.watch(managerIdProvider);
// userId = ref.watch(userProvider);
return MainLayout(
title: "Agent",
title: "Partner",
body: Container(
// color: Colors.yellow.shade50,
width: MediaQuery.of(context).size.width,
@ -347,8 +347,14 @@ class AgentState extends ConsumerState<Agent> {
Tooltip(
message: 'Back',
child: IconButton(
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
onPressed: () { context.go(AppRoutes.agentLst); },
icon: const Icon(
Icons.arrow_left_sharp,
size: 25,
color: Color(0xFF425B5B),
),
onPressed: () {
context.go(AppRoutes.agentLst);
},
splashRadius: 18,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
@ -357,7 +363,7 @@ class AgentState extends ConsumerState<Agent> {
),
const SizedBox(width: 5), // spacing between icon and text
Text(
"Agent",
"Partner",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
@ -510,7 +516,7 @@ class AgentState extends ConsumerState<Agent> {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Agent Id *", style: _textStyle),
Text("Partner Id *", style: _textStyle),
SizedBox(width: 10),
ThemedFormField(
controller: controllers['code']!,

View File

@ -206,7 +206,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
Future<void> handleSave() async {
if (agentId == null) {
ToastHelper.showErrorToast(context, 'Select Agent Name');
ToastHelper.showErrorToast(context, 'Select Partner Name');
} else {
if (!_formKey.currentState!.validate()) return;
print("Handl1");
@ -316,7 +316,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
if (response.statusCode == 200 || response.statusCode == 201) {
// dispose();
print("Agent submitted successfully!");
print("Partner submitted successfully!");
print("📨 Response: ${response.body}");
@ -347,7 +347,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Agent Creation Failed"),
title: Text("Partner Creation Failed"),
content: Text(
"There was a problem in creating user. Please try again.",
),
@ -392,7 +392,11 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
Tooltip(
message: 'Refresh',
child: IconButton(
icon: const Icon(Icons.refresh, size: 20, color: Color(0xFF425B5B)),
icon: const Icon(
Icons.refresh,
size: 20,
color: Color(0xFF425B5B),
),
onPressed: () {
refresh();
},
@ -405,7 +409,11 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
Tooltip(
message: 'Close',
child: IconButton(
icon: const Icon(Icons.close, size: 20, color: Color(0xFF425B5B)),
icon: const Icon(
Icons.close,
size: 20,
color: Color(0xFF425B5B),
),
onPressed: () {
Navigator.pop(context);
},
@ -425,7 +433,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Agent Name', style: _labelStyle),
Text('Partner Name', style: _labelStyle),
SizedBox(height: 5),
Container(
@ -449,7 +457,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
item['id'] == selectedItem['id'], // compare by id
decoratorProps: DropDownDecoratorProps(
decoration: AppInputDecorations.dropdownDecoration(
label: "Select Agent",
label: "Select Partner",
),
),
@ -477,7 +485,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
onChanged: (agent) {
if (agent != null) {
print("Selected Agent Name: ${agent['name']}");
print("Selected Partner Name: ${agent['name']}");
print("Agent Code: ${agent['agent_code']}");
print("Agent Id: ${agent['id']}");
getAgentIncenctiveFileList(agent['id']);
@ -494,7 +502,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Agent ID', style: _labelStyle),
Text('Partner ID', style: _labelStyle),
SizedBox(height: 5),
ThemedFormField(
controller: controllers['agentId']!,
@ -677,7 +685,11 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
final selectedId = file['id'];
final path =
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
apiService.getPdfDownload(context,path, selectedId);
apiService.getPdfDownload(
context,
path,
selectedId,
);
},
onDelete: () async {
print("Delete ${file['id']}");

View File

@ -83,11 +83,21 @@ class AgentListState extends ConsumerState<AgentList> {
setState(() {
filteredData = getAgentData.where((item) {
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
return (item['name'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
(item['email'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
(item['mobile'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
(item['address'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
(item['agent_code'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
return (item['name'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(item['email'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(item['mobile'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(item['address'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(item['agent_code'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(isActiveStatus.contains(query.toLowerCase()));
}).toList();
});
@ -155,7 +165,7 @@ class AgentListState extends ConsumerState<AgentList> {
Widget build(BuildContext context) {
managerId = ref.watch(managerIdProvider);
return MainLayout(
title: "Agent",
title: "Partner",
body: Container(
// color: Colors.yellow.shade50,
width: MediaQuery.of(context).size.width,
@ -178,8 +188,14 @@ class AgentListState extends ConsumerState<AgentList> {
Tooltip(
message: 'Back',
child: IconButton(
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
onPressed: () { context.go(AppRoutes.dashboard); },
icon: const Icon(
Icons.arrow_left_sharp,
size: 25,
color: Color(0xFF425B5B),
),
onPressed: () {
context.go(AppRoutes.dashboard);
},
splashRadius: 18,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
@ -188,7 +204,7 @@ class AgentListState extends ConsumerState<AgentList> {
),
const SizedBox(width: 5), // spacing between icon and text
Text(
"Agent",
"Partner",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
@ -290,7 +306,7 @@ class AgentListState extends ConsumerState<AgentList> {
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Create New Agent',
'Create New Partner',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
@ -327,7 +343,7 @@ class AgentListState extends ConsumerState<AgentList> {
),
Expanded(
flex: 2,
child: Text('Agent Name', style: _headerStyle),
child: Text('Partner Name', style: _headerStyle),
),
Expanded(
flex: 3,

View File

@ -9,6 +9,7 @@ import '../../../core/routing/routes.dart';
import '../../../core/services/api_service.dart';
import '../../layouts/main_layout.dart';
import '../../providers/manager_provider.dart';
import '../../providers/quotation_staff_proivder.dart';
import '../../providers/userRoleProvider.dart';
import '../staff/assignStaff.dart';
@ -96,8 +97,13 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
}
void refresh() {
print("REFRESH-");
getStaffList(prefid, prefroleId);
final prefid = ref.read(userIdProvider);
final prefroleId = ref.read(userRoleProvider);
if (prefid != null) {
print("REFRESH- calling getStaffList with $prefid, $prefroleId");
getStaffList(prefid, prefroleId);
}
}
Future<void> handleEdit(String id) async {
@ -108,7 +114,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
// context.go('/tabEnquiry/$id');
final prefs = await SharedPreferences.getInstance();
// Remove old value (if any)
await prefs.remove('enqAgentDataId');
@ -118,13 +123,27 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
// await prefs.setString('enqAgentDataId', id.toString());
await prefs.setString('enqAgentDataId', id);
ref.read(enquiryIdProvider.notifier).state = id;
// });
// update provider
context.go(AppRoutes.tabEnquiry);
}
Future<void> handleStaffEdit(String id, String? flag) async {
// Navigator.pop(context);
print('EDITStaff');
print('EDITStaff - $id');
final prefs = await SharedPreferences.getInstance();
await prefs.remove('enqStaffDataId');
// Save the new id
await prefs.setString('enqStaffDataId', id.toString());
ref.read(quotationStaffIdProvider.notifier).state = id;
if (flag == "Policies") {
context.go(AppRoutes.policy);
} else {
context.go(AppRoutes.quotation);
}
}
Future<void> getStaffList(int managerId, role) async {
print('B89 => Fns called => $managerId | $role');
setState(() {
@ -405,10 +424,18 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
parts[0],
);
date = DateFormat(
'dd/MM/yyyy',
'dd-MM-yyyy',
).format(parsedDate); // 19/09/2025
}
time = parts.length > 1 ? parts[1] : "";
// time = parts.length > 1 ? parts[1] : "";
// Format the time part (HH:mm)
if (parts.length >= 2) {
final timeParts = parts[1].split(":");
time =
"${timeParts[0]}:${timeParts[1]}"; // 05:45
} else {
time = "";
}
}
return Card(
@ -440,13 +467,10 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'$date ${time}',
date,
style: GoogleFonts.inter(fontSize: 12),
),
// Text(
// (time ?? "").toString().split(" ").last,
// style: GoogleFonts.inter(fontSize: 12),
// ),
Text(time, style: _tableDataTimeStyle),
],
),
),
@ -526,6 +550,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
row,
); // parent method is called
},
onStaffEdit: (row, flag) {
handleStaffEdit(row, flag);
},
)
: (role == 'manager')
? othersPendings(
@ -544,6 +571,10 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
row,
); // parent method is called
},
onStaffEdit: (row, flag) {
handleStaffEdit(row, flag);
},
),
),
const SizedBox(width: 16),
@ -559,6 +590,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
row,
); // parent method is called
},
onStaffEdit: (row, flag) {
handleStaffEdit(row, flag);
},
)
: (role == 'manager')
? awaitingApproval(
@ -577,6 +611,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
row,
); // parent method is called
},
onStaffEdit: (row, flag) {
handleStaffEdit(row, flag);
},
),
),
const SizedBox(width: 16),
@ -593,6 +630,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
row,
); // parent method is called
},
onStaffEdit: (row, flag) {
handleStaffEdit(row, flag);
},
)
: (role == 'manager')
? othersPendings(
@ -612,6 +652,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
row,
); // parent method is called
},
onStaffEdit: (row, flag) {
handleStaffEdit(row, flag);
},
),
),
],
@ -653,115 +696,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
),
),
),
// Expanded(
// child:
//
// SingleChildScrollView(
// scrollDirection: Axis.vertical,
// child: Column(
// children: [
// if (role != 'staff')
// Row(
// children: [
// Expanded(
// child: StatCard(
// title: "Policies Issued",
// today: policiesIssuedToday ?? '',
// month: policiesIssuedMonth ?? '',
// year: policiesIssuedYear ?? '',
// imagePath:
// "assets/dashboard/Policy issue icon.png",
// ),
// ),
// SizedBox(width: 16),
// Expanded(
// child: StatCard(
// title: "Premium Value",
// today: premiumValueToday ?? '',
// month: premiumValueMonth ?? '',
// year: premiumValueYear ?? '',
// imagePath: "assets/dashboard/Premium value.png",
// ),
// ),
// SizedBox(width: 16),
// Expanded(
// child: StatCard(
// title: "Earnings",
// today: earningsToday ?? '',
// month: earningsMonth ?? '',
// year: earningsYear ?? '',
// imagePath: "assets/dashboard/Earnings.png",
// ),
// ),
// ],
// ),
// if (role == 'manager')
// Expanded(
// child: Row(
// children: [
// Expanded(
// child: Performance(
// title: "Performing Agents",
// data: agentsPerformanceList,
// ),
// ),
// SizedBox(width: 16),
// Expanded(
// child: Performance(
// title: "Non-Performing Agents",
// data: nonAgentsPerformanceList,
// ),
// ),
// ],
// ),
// ),
// const SizedBox(height: 10),
// Expanded(
// child: Row(
// children: [
// Expanded(
// child: (role == 'agent')
// ? agentPendings(
// title:
// "Enquiries Pending (${policiesPendingList.length})",
// data: policiesPendingList,
// )
// : othersPendings(
// title:
// "Quotations Pending (${quotationsPendingList.length})",
// data: quotationsPendingList,
// stringFlag: "Quotation",
// ),
// ),
// const SizedBox(width: 16),
// Expanded(
// child: (role == 'agent')
// ? agentPendings(
// title:
// "Quotations Pending (${quotationsPendingList.length})",
// data: quotationsPendingList,
// )
// : othersPendings(
// title:
// "Policies Pending (${policiesPendingList.length})",
// data: policiesPendingList,
// stringFlag: "Policies",
// ),
// // child:
// // quotationsPendingList.isEmpty ? Center(child: Text("Loading quotations...")) :
// // agentPendings(
// // title: "Quotations Pending (${quotationsPendingList.length})",
// // data: quotationsPendingList,
// // ),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// ),
);
}
@ -965,12 +899,15 @@ class agentPendings extends StatelessWidget {
// final Function(Map<String, dynamic>)? onEdit;
final Function(String)? onEdit;
// final Function(String)? onStaffEdit;
final Function(String, String?)? onStaffEdit;
agentPendings({
Key? key,
required this.title,
required this.data,
this.stringFlag,
required this.onStaffEdit,
required this.role,
required this.onEdit,
}) : super(key: key);
@ -1001,14 +938,14 @@ class agentPendings extends StatelessWidget {
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"S.No",
textAlign: TextAlign.center,
style: _headerStyle,
),
),
// Expanded(
// flex: 1,
// child: Text(
// "S.No",
// textAlign: TextAlign.center,
// style: _headerStyle,
// ),
// ),
Expanded(
flex: 1,
child: Text(
@ -1056,10 +993,17 @@ class agentPendings extends StatelessWidget {
if (parts.isNotEmpty) {
DateTime parsedDate = DateTime.parse(parts[0]);
date = DateFormat(
'dd/MM/yyyy',
'dd-MM-yyyy',
).format(parsedDate); // 19/09/2025
}
time = parts.length > 1 ? parts[1] : "";
// time = parts.length > 1 ? parts[1] : "";
// Format the time part (HH:mm)
if (parts.length >= 2) {
final timeParts = parts[1].split(":");
time = "${timeParts[0]}:${timeParts[1]}"; // 05:45
} else {
time = "";
}
}
return InkWell(
@ -1068,10 +1012,16 @@ class agentPendings extends StatelessWidget {
borderRadius: BorderRadius.circular(2),
onTap: (role == 'manager')
? null
: () {
print("Clicked ID role : $role - ${row['id']}");
: (role == 'agent')
? () {
print("Clicked Agent role : $role - ${row['id']}");
onEdit!(row['id'].toString());
// onEdit!(row['id']);
}
: () {
print("Clicked Staff role : $role - ${row['id']}");
print("Clicked Staff stringFlag : $stringFlag");
onStaffEdit!(row['id'].toString(), stringFlag);
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 5),
@ -1085,14 +1035,14 @@ class agentPendings extends StatelessWidget {
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
(index + 1).toString(),
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
// Expanded(
// flex: 1,
// child: Text(
// (index + 1).toString(),
// textAlign: TextAlign.center,
// style: _tableDataStyle,
// ),
// ),
// Date & Time
Expanded(
flex: 1,
@ -1100,7 +1050,7 @@ class agentPendings extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(date, style: _tableDataStyle),
Text(time, style: _tableDataStyle),
Text(time, style: _tableDataTimeStyle),
],
),
),
@ -1177,14 +1127,14 @@ class othersPendings extends StatelessWidget {
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"S.No",
textAlign: TextAlign.center,
style: _headerStyle,
),
),
// Expanded(
// flex: 1,
// child: Text(
// "S.No",
// textAlign: TextAlign.center,
// style: _headerStyle,
// ),
// ),
Expanded(
flex: 2,
child: Text(
@ -1232,67 +1182,59 @@ class othersPendings extends StatelessWidget {
? '0'
: row['total_premium_value'];
return InkWell(
focusColor: Color(0xFF3E5B56),
highlightColor: Color(0xFF3E5B56),
borderRadius: BorderRadius.circular(2),
onTap: () {
print("Clicked ID: ${row['id']}");
},
child: 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'] ?? "",
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,
),
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
Expanded(
flex: 2,
child: Text(
issuedCount,
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
),
Expanded(
flex: 2,
child: Text(
issuedCount,
// row['total_approval_pending'] ?? "",
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(),
],
),
),
// stringFlag == "Policies"
// ? Expanded(
// flex: 2,
// child: Text(
// formatToCroresLakhsAndThousands(permiumValue),
// textAlign: TextAlign.center,
// style: GoogleFonts.inter(
// fontSize: 14,
// fontWeight: FontWeight.w500,
// ),
// ),
// )
// : const SizedBox.shrink(),
],
),
);
},
@ -1343,14 +1285,14 @@ class awaitingApproval extends StatelessWidget {
),
child: Row(
children: [
Expanded(
flex: 1,
child: Text(
"S.No",
textAlign: TextAlign.center,
style: _headerStyle,
),
),
// Expanded(
// flex: 1,
// child: Text(
// "S.No",
// textAlign: TextAlign.center,
// style: _headerStyle,
// ),
// ),
Expanded(
flex: 2,
child: Text(
@ -1398,67 +1340,59 @@ class awaitingApproval extends StatelessWidget {
? '0'
: row['total_premium_value'];
return InkWell(
focusColor: Color(0xFF3E5B56),
highlightColor: Color(0xFF3E5B56),
borderRadius: BorderRadius.circular(2),
onTap: () {
print("Clicked ID: ${row['id']}");
},
child: 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'] ?? "",
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,
),
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
Expanded(
flex: 2,
child: Text(
// issuedCount,
(row['total_approval_pending'] ?? 0).toString(),
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(),
],
),
),
// stringFlag == "Policies"
// ? Expanded(
// flex: 2,
// child: Text(
// formatToCroresLakhsAndThousands(permiumValue),
// textAlign: TextAlign.center,
// style: GoogleFonts.inter(
// fontSize: 14,
// fontWeight: FontWeight.w500,
// ),
// ),
// )
// : const SizedBox.shrink(),
],
),
);
},
@ -1502,13 +1436,13 @@ class Performance extends StatelessWidget {
),
child: Row(
children: [
Expanded(
child: Text(
"S.No",
textAlign: TextAlign.center,
style: _headerStyle,
),
),
// Expanded(
// child: Text(
// "S.No",
// textAlign: TextAlign.center,
// style: _headerStyle,
// ),
// ),
Expanded(
child: Text(
"Agent Name",
@ -1555,14 +1489,13 @@ class Performance extends StatelessWidget {
),
child: Row(
children: [
Expanded(
child: Text(
(index + 1).toString(), // convert int to string
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
// Expanded(
// child: Text(
// (index + 1).toString(), // convert int to string
// textAlign: TextAlign.center,
// style: _tableDataStyle,
// ),
// ),
Expanded(
child: Text(
row['agent_name'] ?? "",
@ -1648,13 +1581,13 @@ class UnassignedEnq extends StatelessWidget {
),
child: Row(
children: [
Expanded(
child: Text(
"S.No",
textAlign: TextAlign.center,
style: _headerStyle,
),
),
// Expanded(
// child: Text(
// "S.No",
// textAlign: TextAlign.center,
// style: _headerStyle,
// ),
// ),
Expanded(
child: Text(
"Registration number",
@ -1689,10 +1622,17 @@ class UnassignedEnq extends StatelessWidget {
if (parts.isNotEmpty) {
DateTime parsedDate = DateTime.parse(parts[0]);
date = DateFormat(
'dd/MM/yyyy',
'dd-MM-yyyy',
).format(parsedDate); // 19/09/2025
}
time = parts.length > 1 ? parts[1] : "";
// time = parts.length > 1 ? parts[1] : "";
// Format the time part (HH:mm)
if (parts.length >= 2) {
final timeParts = parts[1].split(":");
time = "${timeParts[0]}:${timeParts[1]}"; // 05:45
} else {
time = "";
}
}
return InkWell(
@ -1736,14 +1676,6 @@ class UnassignedEnq extends StatelessWidget {
),
child: Row(
children: [
Expanded(
child: Text(
(index + 1).toString(), // convert int to string
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
Expanded(
child: Text(
row['reg_no'] ?? "",
@ -1751,14 +1683,22 @@ class UnassignedEnq extends StatelessWidget {
style: _tableDataStyle,
),
),
Expanded(
child: Text(
"$date $time",
'', // convert int to string
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(date, style: _tableDataStyle),
Text(time, style: _tableDataTimeStyle),
],
),
),
],
),
),
@ -1790,6 +1730,10 @@ final _tableDataStyle = GoogleFonts.inter(
fontSize: 14,
fontWeight: FontWeight.w500,
);
final _tableDataTimeStyle = GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.w400,
);
final topHeaderStyle = GoogleFonts.inter(
fontSize: 12,

View File

@ -708,7 +708,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
child: Text('Updated Date', style: _headerStyle),
),
Expanded(flex: 2, child: Text('Reg.No', style: _headerStyle)),
Expanded(flex: 2, child: Text('Agents', style: _headerStyle)),
Expanded(flex: 2, child: Text('Partner', style: _headerStyle)),
Expanded(
flex: 2,
child: Text('Assigned To', style: _headerStyle),
@ -1032,7 +1032,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("Agent", style: _cardheaderStyle),
const Text("Partner", style: _cardheaderStyle),
Text(item['agent_name'] ?? '-', style: _cardBodyStyle),
],
),

View File

@ -118,7 +118,8 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
"issued_date": controllers["issueDate"]?.text,
"start_date": controllers["startDate"]?.text,
"end_date": controllers["endDate"]?.text,
"premium_amount": controllers["policyPremiumAmount"]?.text,
"premium_amount": controllers["premium_amount"]?.text,
// "premium_amount": controllers["policyPremiumAmount"]?.text,
"policy_number": controllers["policyNumber"]?.text,
"payment_mode": controllers["policyPaymentMode"]?.text,
"manager_id": managerId,
@ -540,8 +541,14 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
Tooltip(
message: 'Back',
child: IconButton(
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
onPressed: () { context.go(AppRoutes.enquiryForStaff); },
icon: const Icon(
Icons.arrow_left_sharp,
size: 25,
color: Color(0xFF425B5B),
),
onPressed: () {
context.go(AppRoutes.enquiryForStaff);
},
splashRadius: 18,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
@ -1004,7 +1011,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Register Number*', style: _textStyle),
Text('Registration Number*', style: _textStyle),
SizedBox(height: 10),
ThemedFormField(
controller: controllers['regNum']!,
@ -1110,12 +1117,13 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Premium Amount *', style: _textStyle),
Text('Premium Amount ', style: _textStyle),
SizedBox(height: 10),
ThemedFormField(
controller: controllers['policyPremiumAmount']!,
validator: (value) =>
Validators.requiredField(value, "policyPremiumAmount"),
controller: controllers['premium_amount']!,
readOnly: true,
// validator: (value) =>
// Validators.requiredField(value, "policyPremiumAmount"),
txtwidth: ResponsiveLayout.isMobile(context)
? null
: MediaQuery.of(context).size.width * 0.26,

View File

@ -382,8 +382,14 @@ class policylistState extends ConsumerState<policylist> {
Tooltip(
message: 'Back',
child: IconButton(
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
onPressed: () { context.go(AppRoutes.dashboard); },
icon: const Icon(
Icons.arrow_left_sharp,
size: 25,
color: Color(0xFF425B5B),
),
onPressed: () {
context.go(AppRoutes.dashboard);
},
splashRadius: 18,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
@ -623,7 +629,7 @@ class policylistState extends ConsumerState<policylist> {
children: [
Expanded(flex: 4, child: Text('Date', style: _headerStyle)),
Expanded(flex: 3, child: Text('Reg.No', style: _headerStyle)),
Expanded(flex: 3, child: Text('Agents', style: _headerStyle)),
Expanded(flex: 3, child: Text('Partner', style: _headerStyle)),
Expanded(
flex: 3,
child: Text('Assigned To', style: _headerStyle),
@ -893,7 +899,7 @@ class policylistState extends ConsumerState<policylist> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Agent", style: _cardheaderStyle),
Text("Partner", style: _cardheaderStyle),
Text(item['agent_name'] ?? '-', style: _cardBodyStyle),
],
),

View File

@ -476,8 +476,8 @@ class createQuotatDialogState extends State<createQuotatDialog> {
SizedBox(height: 10),
Container(
decoration: BoxDecoration(
// color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
color: Colors.white,
// borderRadius: BorderRadius.circular(10.0),
),
width: ResponsiveLayout.isMobile(context)
? null

View File

@ -168,7 +168,10 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
}
void refresh() {
_loadData(enqQuotation);
print("refresh--");
if (enqQuotation != null) {
_loadData(enqQuotation);
}
}
Future<void> getQuotationList(enqQuotation) async {
@ -248,6 +251,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
print(value);
if (value == 'Success') {
print('Success');
refresh();
}
@ -297,8 +301,14 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
Tooltip(
message: 'Back',
child: IconButton(
icon: const Icon(Icons.arrow_left_sharp,size: 20,color: Color(0xFF425B5B)),
onPressed: () { context.go(AppRoutes.enquiryForStaff); },
icon: const Icon(
Icons.arrow_left_sharp,
size: 20,
color: Color(0xFF425B5B),
),
onPressed: () {
context.go(AppRoutes.enquiryForStaff);
},
splashRadius: 9,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
@ -424,6 +434,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
print(value);
if (value == 'Success') {
print('Success');
refresh();
}
@ -642,7 +653,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Register Number', style: _textStyle),
Text('Registration Number', style: _textStyle),
SizedBox(height: 10),
ThemedFormField(
controller: controllers['regNum']!,
@ -843,24 +854,24 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
// ),
// )
? Tooltip(
message: 'Edit',
child: IconButton(
icon: Image.asset(
"assets/miscellaneous/Edit.png",
height: 15,
width: 15,
),
onPressed: () {
final id = item['id'];
print('RAV - $id');
handleEdit(id, item);
},
splashRadius: 20,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(8),
constraints: const BoxConstraints(),
message: 'Edit',
child: IconButton(
icon: Image.asset(
"assets/miscellaneous/Edit.png",
height: 15,
width: 15,
),
)
onPressed: () {
final id = item['id'];
print('RAV - $id');
handleEdit(id, item);
},
splashRadius: 20,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(8),
constraints: const BoxConstraints(),
),
)
: Image.asset(
"assets/miscellaneous/Edit_muted.png",
height: 15,
@ -928,24 +939,24 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
// ),
// )
? Tooltip(
message: 'Edit',
child: IconButton(
icon: Image.asset(
"assets/miscellaneous/Edit.png",
height: 15,
width: 15,
message: 'Edit',
child: IconButton(
icon: Image.asset(
"assets/miscellaneous/Edit.png",
height: 15,
width: 15,
),
onPressed: () {
final id = item['id'];
print('RAV - $id');
handleEdit(id, item);
},
splashRadius: 28,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(8),
constraints: const BoxConstraints(),
),
onPressed: () {
final id = item['id'];
print('RAV - $id');
handleEdit(id, item);
},
splashRadius: 28,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(8),
constraints: const BoxConstraints(),
),
)
)
: Image.asset(
"assets/miscellaneous/Edit_muted.png",
height: 15,

View File

@ -41,7 +41,7 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
children: [
if (key == 'User') ...[
_buildPopupItem(
label: "Agent",
label: "Partner",
onTap: () => context.go(AppRoutes.agentLst),
),
const SizedBox(height: 5),
@ -134,24 +134,26 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
),
// User (Manager Only)
if (roleId == 'manager') _buildHoverMenu(
context: context,
icon: Icon(Icons.person_add_alt, size: 30),
label: "User",
popupKey: 'User',
),
if (roleId == 'manager')
_buildHoverMenu(
context: context,
icon: Icon(Icons.person_add_alt, size: 30),
label: "User",
popupKey: 'User',
),
// Reports (Not Staff)
if (roleId != 'staff') _buildHoverMenu(
context: context,
icon: Image.asset(
"assets/drawer/drawerImg2.png",
height: 25,
width: 25,
if (roleId != 'staff')
_buildHoverMenu(
context: context,
icon: Image.asset(
"assets/drawer/drawerImg2.png",
height: 25,
width: 25,
),
label: "Reports",
popupKey: 'Reports',
),
label: "Reports",
popupKey: 'Reports',
),
],
),
);