DASHBOARD HOVER
This commit is contained in:
parent
c6d2928341
commit
9528ec2d67
File diff suppressed because one or more lines are too long
@ -347,7 +347,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await createUserData(dataSet); // API call
|
await createUserData(dataSet); // API call
|
||||||
ToastHelper.showInfoToast(context, "Enquiry saved successfully");
|
// ToastHelper.showInfoToast(context, "Enquiry saved successfully");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@ -373,7 +373,9 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
size: ResponsiveLayout.isMobile(context) ? 25 : 25,
|
size: ResponsiveLayout.isMobile(context) ? 25 : 25,
|
||||||
color: const Color(0xFF425B5B),
|
color: const Color(0xFF425B5B),
|
||||||
),
|
),
|
||||||
onPressed: () { context.go(AppRoutes.dashboard); },
|
onPressed: () {
|
||||||
|
context.go(AppRoutes.dashboard);
|
||||||
|
},
|
||||||
splashRadius: 18,
|
splashRadius: 18,
|
||||||
hoverColor: Colors.black12,
|
hoverColor: Colors.black12,
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
@ -464,7 +466,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
if (ResponsiveLayout.isMobile(context)) SizedBox(height: 5),
|
||||||
Container(
|
Container(
|
||||||
// height: 40,
|
// height: 40,
|
||||||
// color: Colors.pink,
|
// 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(),
|
Spacer(),
|
||||||
],
|
],
|
||||||
|
|
||||||
ThemedSearchField(
|
ThemedSearchField(
|
||||||
hintText: 'Search',
|
hintText: 'Search',
|
||||||
backgroundColor: Color(0xFFF6F8F8),
|
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.6
|
||||||
: MediaQuery.of(context).size.width * 0.2,
|
: MediaQuery.of(context).size.width * 0.2,
|
||||||
),
|
),
|
||||||
|
ResponsiveLayout.isMobile(context)
|
||||||
SizedBox(width: 10),
|
? Spacer()
|
||||||
|
: SizedBox(width: 10),
|
||||||
|
|
||||||
ExportBtn(
|
ExportBtn(
|
||||||
sheetName: "Enquiry",
|
sheetName: "Enquiry",
|
||||||
@ -819,7 +787,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
constraints: const BoxConstraints(),
|
constraints: const BoxConstraints(),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -894,7 +862,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
constraints: const BoxConstraints(),
|
constraints: const BoxConstraints(),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
// GestureDetector(
|
// GestureDetector(
|
||||||
// // onTap: () {
|
// // onTap: () {
|
||||||
// // Navigator.pop(context);
|
// // Navigator.pop(context);
|
||||||
|
|||||||
@ -235,17 +235,17 @@ class AgentState extends ConsumerState<Agent> {
|
|||||||
|
|
||||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||||
// dispose();
|
// dispose();
|
||||||
print("✅ Agent submitted successfully!");
|
print("✅ Partner submitted successfully!");
|
||||||
|
|
||||||
print("Response: ${response.body}");
|
print("Response: ${response.body}");
|
||||||
isUpdating
|
isUpdating
|
||||||
? ToastHelper.showSuccessToast(
|
? ToastHelper.showSuccessToast(
|
||||||
context,
|
context,
|
||||||
'Agent Updated Successfully',
|
'Partner Updated Successfully',
|
||||||
)
|
)
|
||||||
: ToastHelper.showSuccessToast(
|
: ToastHelper.showSuccessToast(
|
||||||
context,
|
context,
|
||||||
'Agent Created Successfully',
|
'Partner Created Successfully',
|
||||||
);
|
);
|
||||||
context.go(AppRoutes.agentLst);
|
context.go(AppRoutes.agentLst);
|
||||||
} else {
|
} else {
|
||||||
@ -258,7 +258,7 @@ class AgentState extends ConsumerState<Agent> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text("Agent User Creation Failed"),
|
title: Text("Partner User Creation Failed"),
|
||||||
content: Text(
|
content: Text(
|
||||||
msg,
|
msg,
|
||||||
// "There was a problem in creating user. Please try again.",
|
// "There was a problem in creating user. Please try again.",
|
||||||
@ -324,7 +324,7 @@ class AgentState extends ConsumerState<Agent> {
|
|||||||
// managerId = ref.watch(managerIdProvider);
|
// managerId = ref.watch(managerIdProvider);
|
||||||
// userId = ref.watch(userProvider);
|
// userId = ref.watch(userProvider);
|
||||||
return MainLayout(
|
return MainLayout(
|
||||||
title: "Agent",
|
title: "Partner",
|
||||||
body: Container(
|
body: Container(
|
||||||
// color: Colors.yellow.shade50,
|
// color: Colors.yellow.shade50,
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
@ -347,8 +347,14 @@ class AgentState extends ConsumerState<Agent> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Back',
|
message: 'Back',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
onPressed: () { context.go(AppRoutes.agentLst); },
|
Icons.arrow_left_sharp,
|
||||||
|
size: 25,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
context.go(AppRoutes.agentLst);
|
||||||
|
},
|
||||||
splashRadius: 18,
|
splashRadius: 18,
|
||||||
hoverColor: Colors.black12,
|
hoverColor: Colors.black12,
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
@ -357,7 +363,7 @@ class AgentState extends ConsumerState<Agent> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5), // spacing between icon and text
|
const SizedBox(width: 5), // spacing between icon and text
|
||||||
Text(
|
Text(
|
||||||
"Agent",
|
"Partner",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
@ -510,7 +516,7 @@ class AgentState extends ConsumerState<Agent> {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text("Agent Id *", style: _textStyle),
|
Text("Partner Id *", style: _textStyle),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
ThemedFormField(
|
ThemedFormField(
|
||||||
controller: controllers['code']!,
|
controller: controllers['code']!,
|
||||||
|
|||||||
@ -206,7 +206,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
|
|
||||||
Future<void> handleSave() async {
|
Future<void> handleSave() async {
|
||||||
if (agentId == null) {
|
if (agentId == null) {
|
||||||
ToastHelper.showErrorToast(context, 'Select Agent Name');
|
ToastHelper.showErrorToast(context, 'Select Partner Name');
|
||||||
} else {
|
} else {
|
||||||
if (!_formKey.currentState!.validate()) return;
|
if (!_formKey.currentState!.validate()) return;
|
||||||
print("Handl1");
|
print("Handl1");
|
||||||
@ -316,7 +316,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
|
|
||||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||||
// dispose();
|
// dispose();
|
||||||
print("✅ Agent submitted successfully!");
|
print("✅ Partner submitted successfully!");
|
||||||
|
|
||||||
print("📨 Response: ${response.body}");
|
print("📨 Response: ${response.body}");
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text("Agent Creation Failed"),
|
title: Text("Partner Creation Failed"),
|
||||||
content: Text(
|
content: Text(
|
||||||
"There was a problem in creating user. Please try again.",
|
"There was a problem in creating user. Please try again.",
|
||||||
),
|
),
|
||||||
@ -392,7 +392,11 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Refresh',
|
message: 'Refresh',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.refresh, size: 20, color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
|
Icons.refresh,
|
||||||
|
size: 20,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
refresh();
|
refresh();
|
||||||
},
|
},
|
||||||
@ -405,7 +409,11 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Close',
|
message: 'Close',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.close, size: 20, color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
|
Icons.close,
|
||||||
|
size: 20,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
@ -425,7 +433,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Agent Name', style: _labelStyle),
|
Text('Partner Name', style: _labelStyle),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
@ -449,7 +457,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
item['id'] == selectedItem['id'], // ✅ compare by id
|
item['id'] == selectedItem['id'], // ✅ compare by id
|
||||||
decoratorProps: DropDownDecoratorProps(
|
decoratorProps: DropDownDecoratorProps(
|
||||||
decoration: AppInputDecorations.dropdownDecoration(
|
decoration: AppInputDecorations.dropdownDecoration(
|
||||||
label: "Select Agent",
|
label: "Select Partner",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -477,7 +485,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
|
|
||||||
onChanged: (agent) {
|
onChanged: (agent) {
|
||||||
if (agent != null) {
|
if (agent != null) {
|
||||||
print("Selected Agent Name: ${agent['name']}");
|
print("Selected Partner Name: ${agent['name']}");
|
||||||
print("Agent Code: ${agent['agent_code']}");
|
print("Agent Code: ${agent['agent_code']}");
|
||||||
print("Agent Id: ${agent['id']}");
|
print("Agent Id: ${agent['id']}");
|
||||||
getAgentIncenctiveFileList(agent['id']);
|
getAgentIncenctiveFileList(agent['id']);
|
||||||
@ -494,7 +502,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Agent ID', style: _labelStyle),
|
Text('Partner ID', style: _labelStyle),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
ThemedFormField(
|
ThemedFormField(
|
||||||
controller: controllers['agentId']!,
|
controller: controllers['agentId']!,
|
||||||
@ -677,7 +685,11 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
final selectedId = file['id'];
|
final selectedId = file['id'];
|
||||||
final path =
|
final path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
apiService.getPdfDownload(context,path, selectedId);
|
apiService.getPdfDownload(
|
||||||
|
context,
|
||||||
|
path,
|
||||||
|
selectedId,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
onDelete: () async {
|
onDelete: () async {
|
||||||
print("Delete ${file['id']}");
|
print("Delete ${file['id']}");
|
||||||
|
|||||||
@ -83,11 +83,21 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
filteredData = getAgentData.where((item) {
|
filteredData = getAgentData.where((item) {
|
||||||
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
return (item['name'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
return (item['name'] ?? '-').toLowerCase().contains(
|
||||||
(item['email'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
query.toLowerCase(),
|
||||||
(item['mobile'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
) ||
|
||||||
(item['address'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
(item['email'] ?? '-').toLowerCase().contains(
|
||||||
(item['agent_code'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
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()));
|
(isActiveStatus.contains(query.toLowerCase()));
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
@ -155,7 +165,7 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
managerId = ref.watch(managerIdProvider);
|
managerId = ref.watch(managerIdProvider);
|
||||||
return MainLayout(
|
return MainLayout(
|
||||||
title: "Agent",
|
title: "Partner",
|
||||||
body: Container(
|
body: Container(
|
||||||
// color: Colors.yellow.shade50,
|
// color: Colors.yellow.shade50,
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
@ -178,8 +188,14 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Back',
|
message: 'Back',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
onPressed: () { context.go(AppRoutes.dashboard); },
|
Icons.arrow_left_sharp,
|
||||||
|
size: 25,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
context.go(AppRoutes.dashboard);
|
||||||
|
},
|
||||||
splashRadius: 18,
|
splashRadius: 18,
|
||||||
hoverColor: Colors.black12,
|
hoverColor: Colors.black12,
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
@ -188,7 +204,7 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 5), // spacing between icon and text
|
const SizedBox(width: 5), // spacing between icon and text
|
||||||
Text(
|
Text(
|
||||||
"Agent",
|
"Partner",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
@ -290,7 +306,7 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Create New Agent',
|
'Create New Partner',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
@ -327,7 +343,7 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text('Agent Name', style: _headerStyle),
|
child: Text('Partner Name', style: _headerStyle),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import '../../../core/routing/routes.dart';
|
|||||||
import '../../../core/services/api_service.dart';
|
import '../../../core/services/api_service.dart';
|
||||||
import '../../layouts/main_layout.dart';
|
import '../../layouts/main_layout.dart';
|
||||||
import '../../providers/manager_provider.dart';
|
import '../../providers/manager_provider.dart';
|
||||||
|
import '../../providers/quotation_staff_proivder.dart';
|
||||||
import '../../providers/userRoleProvider.dart';
|
import '../../providers/userRoleProvider.dart';
|
||||||
import '../staff/assignStaff.dart';
|
import '../staff/assignStaff.dart';
|
||||||
|
|
||||||
@ -96,9 +97,14 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void refresh() {
|
void refresh() {
|
||||||
print("REFRESH-");
|
final prefid = ref.read(userIdProvider);
|
||||||
|
final prefroleId = ref.read(userRoleProvider);
|
||||||
|
|
||||||
|
if (prefid != null) {
|
||||||
|
print("REFRESH- calling getStaffList with $prefid, $prefroleId");
|
||||||
getStaffList(prefid, prefroleId);
|
getStaffList(prefid, prefroleId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> handleEdit(String id) async {
|
Future<void> handleEdit(String id) async {
|
||||||
// Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
@ -108,7 +114,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
// context.go('/tabEnquiry/$id');
|
// context.go('/tabEnquiry/$id');
|
||||||
|
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
// ✅ Remove old value (if any)
|
// ✅ Remove old value (if any)
|
||||||
await prefs.remove('enqAgentDataId');
|
await prefs.remove('enqAgentDataId');
|
||||||
|
|
||||||
@ -118,13 +123,27 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
// await prefs.setString('enqAgentDataId', id.toString());
|
// await prefs.setString('enqAgentDataId', id.toString());
|
||||||
await prefs.setString('enqAgentDataId', id);
|
await prefs.setString('enqAgentDataId', id);
|
||||||
ref.read(enquiryIdProvider.notifier).state = id;
|
ref.read(enquiryIdProvider.notifier).state = id;
|
||||||
|
|
||||||
// });
|
|
||||||
// update provider
|
|
||||||
|
|
||||||
context.go(AppRoutes.tabEnquiry);
|
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 {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('B89 => Fns called => $managerId | $role');
|
print('B89 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -405,10 +424,18 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
parts[0],
|
parts[0],
|
||||||
);
|
);
|
||||||
date = DateFormat(
|
date = DateFormat(
|
||||||
'dd/MM/yyyy',
|
'dd-MM-yyyy',
|
||||||
).format(parsedDate); // 19/09/2025
|
).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(
|
return Card(
|
||||||
@ -440,13 +467,10 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'$date ${time}',
|
date,
|
||||||
style: GoogleFonts.inter(fontSize: 12),
|
style: GoogleFonts.inter(fontSize: 12),
|
||||||
),
|
),
|
||||||
// Text(
|
Text(time, style: _tableDataTimeStyle),
|
||||||
// (time ?? "").toString().split(" ").last,
|
|
||||||
// style: GoogleFonts.inter(fontSize: 12),
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -526,6 +550,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
row,
|
row,
|
||||||
); // parent method is called
|
); // parent method is called
|
||||||
},
|
},
|
||||||
|
onStaffEdit: (row, flag) {
|
||||||
|
handleStaffEdit(row, flag);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
: (role == 'manager')
|
: (role == 'manager')
|
||||||
? othersPendings(
|
? othersPendings(
|
||||||
@ -544,6 +571,10 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
row,
|
row,
|
||||||
); // parent method is called
|
); // parent method is called
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onStaffEdit: (row, flag) {
|
||||||
|
handleStaffEdit(row, flag);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
@ -559,6 +590,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
row,
|
row,
|
||||||
); // parent method is called
|
); // parent method is called
|
||||||
},
|
},
|
||||||
|
onStaffEdit: (row, flag) {
|
||||||
|
handleStaffEdit(row, flag);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
: (role == 'manager')
|
: (role == 'manager')
|
||||||
? awaitingApproval(
|
? awaitingApproval(
|
||||||
@ -577,6 +611,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
row,
|
row,
|
||||||
); // parent method is called
|
); // parent method is called
|
||||||
},
|
},
|
||||||
|
onStaffEdit: (row, flag) {
|
||||||
|
handleStaffEdit(row, flag);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
@ -593,6 +630,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
row,
|
row,
|
||||||
); // parent method is called
|
); // parent method is called
|
||||||
},
|
},
|
||||||
|
onStaffEdit: (row, flag) {
|
||||||
|
handleStaffEdit(row, flag);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
: (role == 'manager')
|
: (role == 'manager')
|
||||||
? othersPendings(
|
? othersPendings(
|
||||||
@ -612,6 +652,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
row,
|
row,
|
||||||
); // parent method is called
|
); // 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(Map<String, dynamic>)? onEdit;
|
||||||
final Function(String)? onEdit;
|
final Function(String)? onEdit;
|
||||||
|
// final Function(String)? onStaffEdit;
|
||||||
|
final Function(String, String?)? onStaffEdit;
|
||||||
|
|
||||||
agentPendings({
|
agentPendings({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.data,
|
required this.data,
|
||||||
this.stringFlag,
|
this.stringFlag,
|
||||||
|
required this.onStaffEdit,
|
||||||
required this.role,
|
required this.role,
|
||||||
required this.onEdit,
|
required this.onEdit,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -1001,14 +938,14 @@ class agentPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text(
|
// child: Text(
|
||||||
"S.No",
|
// "S.No",
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
// style: _headerStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1056,10 +993,17 @@ class agentPendings extends StatelessWidget {
|
|||||||
if (parts.isNotEmpty) {
|
if (parts.isNotEmpty) {
|
||||||
DateTime parsedDate = DateTime.parse(parts[0]);
|
DateTime parsedDate = DateTime.parse(parts[0]);
|
||||||
date = DateFormat(
|
date = DateFormat(
|
||||||
'dd/MM/yyyy',
|
'dd-MM-yyyy',
|
||||||
).format(parsedDate); // 19/09/2025
|
).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(
|
return InkWell(
|
||||||
@ -1068,10 +1012,16 @@ class agentPendings extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
onTap: (role == 'manager')
|
onTap: (role == 'manager')
|
||||||
? null
|
? null
|
||||||
: () {
|
: (role == 'agent')
|
||||||
print("Clicked ID role : $role - ${row['id']}");
|
? () {
|
||||||
|
print("Clicked Agent role : $role - ${row['id']}");
|
||||||
onEdit!(row['id'].toString());
|
onEdit!(row['id'].toString());
|
||||||
// onEdit!(row['id']);
|
// onEdit!(row['id']);
|
||||||
|
}
|
||||||
|
: () {
|
||||||
|
print("Clicked Staff role : $role - ${row['id']}");
|
||||||
|
print("Clicked Staff stringFlag : $stringFlag");
|
||||||
|
onStaffEdit!(row['id'].toString(), stringFlag);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 5),
|
margin: const EdgeInsets.symmetric(vertical: 5),
|
||||||
@ -1085,14 +1035,14 @@ class agentPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text(
|
// child: Text(
|
||||||
(index + 1).toString(),
|
// (index + 1).toString(),
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
// style: _tableDataStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
// Date & Time
|
// Date & Time
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@ -1100,7 +1050,7 @@ class agentPendings extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(date, style: _tableDataStyle),
|
Text(date, style: _tableDataStyle),
|
||||||
Text(time, style: _tableDataStyle),
|
Text(time, style: _tableDataTimeStyle),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1177,14 +1127,14 @@ class othersPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text(
|
// child: Text(
|
||||||
"S.No",
|
// "S.No",
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
// style: _headerStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1232,14 +1182,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
? '0'
|
? '0'
|
||||||
: row['total_premium_value'];
|
: row['total_premium_value'];
|
||||||
|
|
||||||
return InkWell(
|
return Container(
|
||||||
focusColor: Color(0xFF3E5B56),
|
|
||||||
highlightColor: Color(0xFF3E5B56),
|
|
||||||
borderRadius: BorderRadius.circular(2),
|
|
||||||
onTap: () {
|
|
||||||
print("Clicked ID: ${row['id']}");
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 5),
|
margin: const EdgeInsets.symmetric(vertical: 5),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 5,
|
vertical: 5,
|
||||||
@ -1251,14 +1194,14 @@ class othersPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text(
|
// child: Text(
|
||||||
(index + 1).toString(),
|
// (index + 1).toString(),
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
// style: _tableDataStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1293,7 +1236,6 @@ class othersPendings extends StatelessWidget {
|
|||||||
// : const SizedBox.shrink(),
|
// : const SizedBox.shrink(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -1343,14 +1285,14 @@ class awaitingApproval extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text(
|
// child: Text(
|
||||||
"S.No",
|
// "S.No",
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
// style: _headerStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1398,14 +1340,7 @@ class awaitingApproval extends StatelessWidget {
|
|||||||
? '0'
|
? '0'
|
||||||
: row['total_premium_value'];
|
: row['total_premium_value'];
|
||||||
|
|
||||||
return InkWell(
|
return Container(
|
||||||
focusColor: Color(0xFF3E5B56),
|
|
||||||
highlightColor: Color(0xFF3E5B56),
|
|
||||||
borderRadius: BorderRadius.circular(2),
|
|
||||||
onTap: () {
|
|
||||||
print("Clicked ID: ${row['id']}");
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 5),
|
margin: const EdgeInsets.symmetric(vertical: 5),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 5,
|
vertical: 5,
|
||||||
@ -1417,14 +1352,14 @@ class awaitingApproval extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text(
|
// child: Text(
|
||||||
(index + 1).toString(),
|
// (index + 1).toString(),
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
// style: _tableDataStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1459,7 +1394,6 @@ class awaitingApproval extends StatelessWidget {
|
|||||||
// : const SizedBox.shrink(),
|
// : const SizedBox.shrink(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -1502,13 +1436,13 @@ class Performance extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: Text(
|
// child: Text(
|
||||||
"S.No",
|
// "S.No",
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
// style: _headerStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Agent Name",
|
"Agent Name",
|
||||||
@ -1555,14 +1489,13 @@ class Performance extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: Text(
|
// child: Text(
|
||||||
(index + 1).toString(), // convert int to string
|
// (index + 1).toString(), // convert int to string
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
// style: _tableDataStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
row['agent_name'] ?? "",
|
row['agent_name'] ?? "",
|
||||||
@ -1648,13 +1581,13 @@ class UnassignedEnq extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: Text(
|
// child: Text(
|
||||||
"S.No",
|
// "S.No",
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _headerStyle,
|
// style: _headerStyle,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Registration number",
|
"Registration number",
|
||||||
@ -1689,10 +1622,17 @@ class UnassignedEnq extends StatelessWidget {
|
|||||||
if (parts.isNotEmpty) {
|
if (parts.isNotEmpty) {
|
||||||
DateTime parsedDate = DateTime.parse(parts[0]);
|
DateTime parsedDate = DateTime.parse(parts[0]);
|
||||||
date = DateFormat(
|
date = DateFormat(
|
||||||
'dd/MM/yyyy',
|
'dd-MM-yyyy',
|
||||||
).format(parsedDate); // 19/09/2025
|
).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(
|
return InkWell(
|
||||||
@ -1736,14 +1676,6 @@ class UnassignedEnq extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
(index + 1).toString(), // convert int to string
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: _tableDataStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
row['reg_no'] ?? "",
|
row['reg_no'] ?? "",
|
||||||
@ -1751,14 +1683,22 @@ class UnassignedEnq extends StatelessWidget {
|
|||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"$date $time",
|
'', // convert int to string
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
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,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
);
|
);
|
||||||
|
final _tableDataTimeStyle = GoogleFonts.inter(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
);
|
||||||
|
|
||||||
final topHeaderStyle = GoogleFonts.inter(
|
final topHeaderStyle = GoogleFonts.inter(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|||||||
@ -708,7 +708,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
child: Text('Updated Date', style: _headerStyle),
|
child: Text('Updated Date', style: _headerStyle),
|
||||||
),
|
),
|
||||||
Expanded(flex: 2, child: Text('Reg.No', 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(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text('Assigned To', style: _headerStyle),
|
child: Text('Assigned To', style: _headerStyle),
|
||||||
@ -1032,7 +1032,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Text("Agent", style: _cardheaderStyle),
|
const Text("Partner", style: _cardheaderStyle),
|
||||||
Text(item['agent_name'] ?? '-', style: _cardBodyStyle),
|
Text(item['agent_name'] ?? '-', style: _cardBodyStyle),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -118,7 +118,8 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
"issued_date": controllers["issueDate"]?.text,
|
"issued_date": controllers["issueDate"]?.text,
|
||||||
"start_date": controllers["startDate"]?.text,
|
"start_date": controllers["startDate"]?.text,
|
||||||
"end_date": controllers["endDate"]?.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,
|
"policy_number": controllers["policyNumber"]?.text,
|
||||||
"payment_mode": controllers["policyPaymentMode"]?.text,
|
"payment_mode": controllers["policyPaymentMode"]?.text,
|
||||||
"manager_id": managerId,
|
"manager_id": managerId,
|
||||||
@ -540,8 +541,14 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Back',
|
message: 'Back',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
onPressed: () { context.go(AppRoutes.enquiryForStaff); },
|
Icons.arrow_left_sharp,
|
||||||
|
size: 25,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
context.go(AppRoutes.enquiryForStaff);
|
||||||
|
},
|
||||||
splashRadius: 18,
|
splashRadius: 18,
|
||||||
hoverColor: Colors.black12,
|
hoverColor: Colors.black12,
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
@ -1004,7 +1011,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Register Number*', style: _textStyle),
|
Text('Registration Number*', style: _textStyle),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
ThemedFormField(
|
ThemedFormField(
|
||||||
controller: controllers['regNum']!,
|
controller: controllers['regNum']!,
|
||||||
@ -1110,12 +1117,13 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Premium Amount *', style: _textStyle),
|
Text('Premium Amount ', style: _textStyle),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
ThemedFormField(
|
ThemedFormField(
|
||||||
controller: controllers['policyPremiumAmount']!,
|
controller: controllers['premium_amount']!,
|
||||||
validator: (value) =>
|
readOnly: true,
|
||||||
Validators.requiredField(value, "policyPremiumAmount"),
|
// validator: (value) =>
|
||||||
|
// Validators.requiredField(value, "policyPremiumAmount"),
|
||||||
txtwidth: ResponsiveLayout.isMobile(context)
|
txtwidth: ResponsiveLayout.isMobile(context)
|
||||||
? null
|
? null
|
||||||
: MediaQuery.of(context).size.width * 0.26,
|
: MediaQuery.of(context).size.width * 0.26,
|
||||||
|
|||||||
@ -382,8 +382,14 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Back',
|
message: 'Back',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_left_sharp,size: 25,color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
onPressed: () { context.go(AppRoutes.dashboard); },
|
Icons.arrow_left_sharp,
|
||||||
|
size: 25,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
context.go(AppRoutes.dashboard);
|
||||||
|
},
|
||||||
splashRadius: 18,
|
splashRadius: 18,
|
||||||
hoverColor: Colors.black12,
|
hoverColor: Colors.black12,
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
@ -623,7 +629,7 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(flex: 4, child: Text('Date', style: _headerStyle)),
|
Expanded(flex: 4, child: Text('Date', style: _headerStyle)),
|
||||||
Expanded(flex: 3, child: Text('Reg.No', 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(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
child: Text('Assigned To', style: _headerStyle),
|
child: Text('Assigned To', style: _headerStyle),
|
||||||
@ -893,7 +899,7 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text("Agent", style: _cardheaderStyle),
|
Text("Partner", style: _cardheaderStyle),
|
||||||
Text(item['agent_name'] ?? '-', style: _cardBodyStyle),
|
Text(item['agent_name'] ?? '-', style: _cardBodyStyle),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -476,8 +476,8 @@ class createQuotatDialogState extends State<createQuotatDialog> {
|
|||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
// borderRadius: BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
width: ResponsiveLayout.isMobile(context)
|
width: ResponsiveLayout.isMobile(context)
|
||||||
? null
|
? null
|
||||||
|
|||||||
@ -168,8 +168,11 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void refresh() {
|
void refresh() {
|
||||||
|
print("refresh--");
|
||||||
|
if (enqQuotation != null) {
|
||||||
_loadData(enqQuotation);
|
_loadData(enqQuotation);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> getQuotationList(enqQuotation) async {
|
Future<void> getQuotationList(enqQuotation) async {
|
||||||
print('getClaimList called enqQuotation- $enqQuotation');
|
print('getClaimList called enqQuotation- $enqQuotation');
|
||||||
@ -248,6 +251,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
|
|
||||||
print(value);
|
print(value);
|
||||||
if (value == 'Success') {
|
if (value == 'Success') {
|
||||||
|
print('Success');
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,8 +301,14 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
Tooltip(
|
Tooltip(
|
||||||
message: 'Back',
|
message: 'Back',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_left_sharp,size: 20,color: Color(0xFF425B5B)),
|
icon: const Icon(
|
||||||
onPressed: () { context.go(AppRoutes.enquiryForStaff); },
|
Icons.arrow_left_sharp,
|
||||||
|
size: 20,
|
||||||
|
color: Color(0xFF425B5B),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
context.go(AppRoutes.enquiryForStaff);
|
||||||
|
},
|
||||||
splashRadius: 9,
|
splashRadius: 9,
|
||||||
hoverColor: Colors.black12,
|
hoverColor: Colors.black12,
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
@ -424,6 +434,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
|
|
||||||
print(value);
|
print(value);
|
||||||
if (value == 'Success') {
|
if (value == 'Success') {
|
||||||
|
print('Success');
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,7 +653,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Register Number', style: _textStyle),
|
Text('Registration Number', style: _textStyle),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
ThemedFormField(
|
ThemedFormField(
|
||||||
controller: controllers['regNum']!,
|
controller: controllers['regNum']!,
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
|
|||||||
children: [
|
children: [
|
||||||
if (key == 'User') ...[
|
if (key == 'User') ...[
|
||||||
_buildPopupItem(
|
_buildPopupItem(
|
||||||
label: "Agent",
|
label: "Partner",
|
||||||
onTap: () => context.go(AppRoutes.agentLst),
|
onTap: () => context.go(AppRoutes.agentLst),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
@ -134,7 +134,8 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// User (Manager Only)
|
// User (Manager Only)
|
||||||
if (roleId == 'manager') _buildHoverMenu(
|
if (roleId == 'manager')
|
||||||
|
_buildHoverMenu(
|
||||||
context: context,
|
context: context,
|
||||||
icon: Icon(Icons.person_add_alt, size: 30),
|
icon: Icon(Icons.person_add_alt, size: 30),
|
||||||
label: "User",
|
label: "User",
|
||||||
@ -142,7 +143,8 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Reports (Not Staff)
|
// Reports (Not Staff)
|
||||||
if (roleId != 'staff') _buildHoverMenu(
|
if (roleId != 'staff')
|
||||||
|
_buildHoverMenu(
|
||||||
context: context,
|
context: context,
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
"assets/drawer/drawerImg2.png",
|
"assets/drawer/drawerImg2.png",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user