chart fixes
This commit is contained in:
parent
2488d0f72c
commit
0054bfeb30
File diff suppressed because one or more lines are too long
@ -1308,7 +1308,7 @@ class othersPendings extends StatelessWidget {
|
||||
flex: 2,
|
||||
child: Text(
|
||||
"Staff Name",
|
||||
textAlign: TextAlign.center,
|
||||
textAlign: TextAlign.left,
|
||||
style: _headerStyle,
|
||||
),
|
||||
),
|
||||
|
||||
@ -276,7 +276,7 @@ class _BussinessDashboardState extends ConsumerState<BussinessDashboard> {
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('Hide and Show Charts : ', style: _styleSmall1),
|
||||
|
||||
@ -495,13 +495,23 @@ class _PerformanceState extends State<Performance> {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
"Partner Name",
|
||||
textAlign: TextAlign.center,
|
||||
"S.NO",
|
||||
textAlign: TextAlign.left,
|
||||
style: _headerStyle,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
"Partner Name",
|
||||
textAlign: TextAlign.left,
|
||||
style: _headerStyle,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
"Partner Code",
|
||||
textAlign: TextAlign.center,
|
||||
@ -511,10 +521,11 @@ class _PerformanceState extends State<Performance> {
|
||||
|
||||
(widget.title == 'Performing Partner')
|
||||
? Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
widget.isPerfomingAgntPolicy
|
||||
? "Policy count"
|
||||
: "Premium count",
|
||||
? "Policy Count"
|
||||
: "Premium Count",
|
||||
|
||||
textAlign: TextAlign.center,
|
||||
style: _headerStyle,
|
||||
@ -551,13 +562,23 @@ class _PerformanceState extends State<Performance> {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
row['agent_name'] ?? "",
|
||||
textAlign: TextAlign.center,
|
||||
(index + 1).toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: _tableDataStyle,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
row['agent_name'] ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
style: _tableDataStyle,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
row['agent_code'] ?? "",
|
||||
textAlign: TextAlign.center,
|
||||
@ -567,6 +588,7 @@ class _PerformanceState extends State<Performance> {
|
||||
|
||||
(widget.title == 'Performing Partner')
|
||||
? Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
isPerfomingAgntPolicy
|
||||
? (row['policy_count']?.toString() ?? "0")
|
||||
|
||||
@ -128,6 +128,7 @@ class CreateProposal_QuickFormState
|
||||
dynamic managerId;
|
||||
|
||||
bool isSingleSave = false;
|
||||
bool _isResetting = false;
|
||||
|
||||
List<Map<String, dynamic>> quotationList = [];
|
||||
|
||||
@ -205,7 +206,7 @@ class CreateProposal_QuickFormState
|
||||
getInsuranceType();
|
||||
getPaymentMode();
|
||||
getInsurers();
|
||||
updateData();
|
||||
|
||||
getBroker();
|
||||
}
|
||||
|
||||
@ -253,7 +254,15 @@ class CreateProposal_QuickFormState
|
||||
|
||||
void reset() {
|
||||
print('RESET');
|
||||
|
||||
_isResetting = true;
|
||||
print('_isResetting : $_isResetting');
|
||||
|
||||
controllers['regNo']!.clear();
|
||||
_formKey.currentState?.reset();
|
||||
|
||||
fieldErrors.clear();
|
||||
|
||||
// Clear all TextEditingControllers
|
||||
for (var controller in controllers.values) {
|
||||
controller.clear();
|
||||
@ -282,6 +291,9 @@ class CreateProposal_QuickFormState
|
||||
|
||||
// Trigger UI update
|
||||
setState(() {});
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
_isResetting = false; // ✅ safe to enable again
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> getQuickQuotationList(int managerId) async {
|
||||
@ -384,7 +396,7 @@ class CreateProposal_QuickFormState
|
||||
}
|
||||
}
|
||||
|
||||
void updateData() {}
|
||||
void refresh() {}
|
||||
|
||||
Future<void> getInsurers() async {
|
||||
print('Insurers called');
|
||||
@ -1350,19 +1362,26 @@ class CreateProposal_QuickFormState
|
||||
FilteringTextInputFormatter.allow(RegExp(r'[A-Za-z0-9- ]')),
|
||||
],
|
||||
onChanged: (val) async {
|
||||
if (_isResetting) {
|
||||
print("Skipping API because _isResetting = true");
|
||||
return;
|
||||
}
|
||||
print('Vehicle - $val');
|
||||
final res = await apiService.CheckDuplicate(context, val);
|
||||
print('Vehicle res- $res');
|
||||
|
||||
if (res["message"] != null && res["message"] != "") {
|
||||
ToastHelper.showErrorToast(context, res['message']);
|
||||
setState(() {
|
||||
fieldErrors['regNo'] = res['message']; // store API message
|
||||
}); // 🔥 store backend message
|
||||
} else {
|
||||
setState(() {
|
||||
fieldErrors['regNo'] = res['message']; // store API message
|
||||
});
|
||||
if (val != null) {
|
||||
final res = await apiService.CheckDuplicate(context, val);
|
||||
print('Vehicle res- $res');
|
||||
|
||||
if (res["message"] != null && res["message"] != "") {
|
||||
ToastHelper.showErrorToast(context, res['message']);
|
||||
setState(() {
|
||||
fieldErrors['regNo'] = res['message']; // store API message
|
||||
}); // 🔥 store backend message
|
||||
} else {
|
||||
setState(() {
|
||||
fieldErrors['regNo'] = res['message']; // store API message
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
validator: (value) {
|
||||
|
||||
@ -140,6 +140,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
String? selectedId;
|
||||
|
||||
int selectedIndex = 0;
|
||||
int autoRefreshIndex = 0;
|
||||
|
||||
final List<String> enquiryTabs = ["In Progress", "Completed"];
|
||||
|
||||
@ -379,6 +380,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
SelectedStatus: SelectedStatus ?? '',
|
||||
SelectedStaffId: SelectedStaffId ?? '',
|
||||
);
|
||||
autoRefreshIndex = selectedIndex;
|
||||
print('autoRefreshIndex - $autoRefreshIndex');
|
||||
_searchStaffController.clear();
|
||||
print('refrshfilterDateRange 2');
|
||||
}
|
||||
@ -609,7 +612,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
|
||||
final yesterday = today.subtract(Duration(days: 1));
|
||||
|
||||
fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15)));
|
||||
fromDt = dateFormat.format(yesterday.subtract(Duration(days: 5)));
|
||||
toDt = dateFormat.format(yesterday);
|
||||
|
||||
print('PrevPending FROM TO - $fromDt - $toDt');
|
||||
@ -632,15 +635,38 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
print("ENQ LIST PAGE");
|
||||
|
||||
final today = DateTime.now();
|
||||
fromDt = dateFormat.format(today.subtract(Duration(days: 15)));
|
||||
fromDt = dateFormat.format(today.subtract(Duration(days: 5)));
|
||||
// fromDt = dateFormat.format(today);
|
||||
toDt = dateFormat.format(today);
|
||||
|
||||
print('Enq FROM TO - $fromDt - $toDt');
|
||||
} else {
|
||||
print('Enq 1- $fromDt - $toDt');
|
||||
fromDt = fromDateVal;
|
||||
toDt = toDateVal;
|
||||
}
|
||||
print('Enq 2- $fromDt - $toDt');
|
||||
String finalStatus = SelectedStatus;
|
||||
print('finalStatus1 - $finalStatus');
|
||||
|
||||
// if ((finalStatus != '') &&
|
||||
// (SelectedStatus != 'Completed') &&
|
||||
// (autoRefreshIndex == 0)) {
|
||||
// finalStatus = 'OtherThenCompleted';
|
||||
// print('finalSt1 - $finalStatus');
|
||||
// } else if (SelectedStatus == 'Completed' || autoRefreshIndex == 1) {
|
||||
// finalStatus = 'Completed';
|
||||
// print('finalSt2 - $finalStatus');
|
||||
// } else if (SelectedStatus == 'PrevPending') {
|
||||
// finalStatus = '';
|
||||
// print('finalSt3 - $finalStatus');
|
||||
// } else {
|
||||
// finalStatus = 'OtherThenCompleted';
|
||||
// print('finalSt4 - $finalStatus');
|
||||
// // finalStatus = SelectedStatus; // keep original
|
||||
// }
|
||||
// print('finalStatus2 - $finalStatus');
|
||||
// print('DAJJshA79SelectedStatus - $SelectedStatus');
|
||||
|
||||
try {
|
||||
final response = await apiService.fetchEnquiryList(
|
||||
@ -649,6 +675,9 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
role,
|
||||
fromDate: fromDt,
|
||||
toDate: toDt,
|
||||
// selectedStatus: (finalStatus != '' && finalStatus != 'PrevPending')
|
||||
// ? finalStatus
|
||||
// : '',
|
||||
selectedStatus:
|
||||
(SelectedStatus != '' && SelectedStatus != 'PrevPending')
|
||||
? SelectedStatus
|
||||
@ -665,10 +694,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
print('ToDate : $toDate');
|
||||
|
||||
setState(() {
|
||||
if (SelectedStatus == 'Completed') {
|
||||
if (SelectedStatus == 'Completed' || autoRefreshIndex == 1) {
|
||||
selectedIndex = 1;
|
||||
SelectedStatus = 'Completed';
|
||||
} else {
|
||||
selectedIndex = 0;
|
||||
SelectedStatus = 'OtherThenCompleted';
|
||||
}
|
||||
controllers['startDate']?.text = fromDate;
|
||||
controllers['endDate']?.text = toDate;
|
||||
@ -3548,61 +3579,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
return grouped;
|
||||
}
|
||||
|
||||
// Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
|
||||
// final grouped = <String, List<Map<String, dynamic>>>{};
|
||||
//
|
||||
// // Initialize all status groups
|
||||
// // grouped['Awaiting Proposal'] = [];
|
||||
// // grouped['Proposal Created'] = [];
|
||||
// // grouped['Proposal Accepted'] = [];
|
||||
// // grouped['Proposal Rejected'] = [];
|
||||
// // grouped['Policy Created'] = [];
|
||||
// // grouped['Awaiting Payment'] = [];
|
||||
//
|
||||
// // Initialize only the groups you need
|
||||
// // grouped['Awaiting Proposal'] = [];
|
||||
// // grouped['Proposal Created'] = [];
|
||||
// // grouped['Policy Created'] = [];
|
||||
//
|
||||
// grouped['To be assigned'] = [];
|
||||
// grouped['Assigned'] = [];
|
||||
// grouped['In progress'] = [];
|
||||
//
|
||||
// // Group the filtered/paginated data by status
|
||||
// // for (var item in _paginatedData) {
|
||||
// // final status = item['status']?.toString() ?? 'Unknown';
|
||||
// // if (grouped.containsKey(status)) {
|
||||
// // grouped[status]!.add(item);
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// for (var item in filteredData) {
|
||||
// // final status = item['status']?.toString() ?? 'Unknown';
|
||||
// final status = item['enquiry_status']?.toString() ?? 'Unknown';
|
||||
//
|
||||
// // Map actual status to grouped status
|
||||
// final groupKey = statusGroupMap[status];
|
||||
//
|
||||
// if (groupKey != null) {
|
||||
// grouped[groupKey]!.add(item);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // for (var item in _paginatedData) {
|
||||
// // // final status = item['status']?.toString() ?? 'Unknown';
|
||||
// // final status = item['enquiry_status']?.toString() ?? 'Unknown';
|
||||
// //
|
||||
// // // Map actual status to grouped status
|
||||
// // final groupKey = statusGroupMap[status];
|
||||
// //
|
||||
// // if (groupKey != null) {
|
||||
// // grouped[groupKey]!.add(item);
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// return grouped;
|
||||
// }
|
||||
|
||||
Map<String, dynamic> _getStatusConfig(String status) {
|
||||
switch (status) {
|
||||
case 'Awaiting Proposal':
|
||||
@ -3947,8 +3923,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
int.tryParse(id.toString()) != null &&
|
||||
int.parse(id.toString()) > 1000000000000;
|
||||
|
||||
print('idPrimary - $idPrimary');
|
||||
print('isNewRow - $isNewRow');
|
||||
// print('idPrimary - $idPrimary');
|
||||
// print('isNewRow - $isNewRow');
|
||||
final editing = isEditingRow[id] ?? false;
|
||||
final controllers = rowControllers[id];
|
||||
|
||||
@ -5277,6 +5253,16 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedIndex = index;
|
||||
|
||||
if (selectedIndex == '1') {
|
||||
getStaffList(
|
||||
managerId,
|
||||
roleId,
|
||||
SelectedStatus: 'Completed',
|
||||
);
|
||||
} else {
|
||||
getStaffList(managerId, roleId);
|
||||
}
|
||||
});
|
||||
},
|
||||
child: AnimatedContainer(
|
||||
|
||||
@ -37,6 +37,8 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
Map<String, String?> fieldErrors = {};
|
||||
|
||||
bool _isResetting = false;
|
||||
|
||||
Map<String, TextEditingController> controllers = {};
|
||||
List<String> tabHeader = [
|
||||
'startDate',
|
||||
@ -180,6 +182,15 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
||||
}
|
||||
|
||||
void resetFormFields() {
|
||||
_isResetting = true;
|
||||
print('_isResetting : $_isResetting');
|
||||
;
|
||||
|
||||
controllers['regNo']!.clear();
|
||||
_formKey.currentState?.reset();
|
||||
|
||||
fieldErrors.clear();
|
||||
|
||||
// 1. Reset all text controllers
|
||||
controllers.forEach((key, controller) {
|
||||
controller.clear();
|
||||
@ -196,6 +207,10 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
||||
_formKey.currentState?.reset();
|
||||
|
||||
setState(() {});
|
||||
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
_isResetting = false; // ✅ safe to enable again
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> getVehicleType() async {
|
||||
@ -812,6 +827,10 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
||||
],
|
||||
// validator: (value) => Validators.requiredField(value, "regNo"),
|
||||
onChanged: (val) async {
|
||||
if (_isResetting) {
|
||||
print("Skipping API because _isResetting = true");
|
||||
return;
|
||||
}
|
||||
print('Vehicle - $val');
|
||||
final res = await apiService.CheckDuplicate(context, val);
|
||||
print('Vehicle res- $res');
|
||||
|
||||
@ -724,44 +724,6 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _readonlyField(String label, String value) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: GoogleFonts.inter(fontSize: 13, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 60, vertical: 14),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
),
|
||||
child: Text(value, style: GoogleFonts.inter(fontSize: 14)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _downloadButton(String label) {
|
||||
return ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF425B5B),
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||
),
|
||||
onPressed: () {
|
||||
// TODO: file download logic
|
||||
},
|
||||
icon: const Icon(Icons.download, size: 18),
|
||||
label: Text(label, style: GoogleFonts.inter(fontSize: 13)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildDocRC(BuildContext context, bool isMobile) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
@ -90,13 +90,33 @@ class policylistState extends ConsumerState<policylist> {
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
});
|
||||
dynamic fromDt;
|
||||
dynamic toDt;
|
||||
final dateFormat = DateFormat('dd-MM-yyyy');
|
||||
final today = DateTime.now();
|
||||
final fromDateVal = controllers['startDate']?.text ?? '';
|
||||
final toDateVal = controllers['endDate']?.text ?? '';
|
||||
|
||||
if (fromDateVal == '' && toDateVal == '') {
|
||||
print("ENQ LIST PAGE");
|
||||
|
||||
final today = DateTime.now();
|
||||
fromDt = dateFormat.format(today.subtract(Duration(days: 15)));
|
||||
// fromDt = dateFormat.format(today);
|
||||
toDt = dateFormat.format(today);
|
||||
|
||||
print('Enq FROM TO - $fromDt - $toDt');
|
||||
} else {
|
||||
fromDt = fromDateVal;
|
||||
toDt = toDateVal;
|
||||
}
|
||||
|
||||
try {
|
||||
final response = await apiService.fetchPolicyDataOnlyList(
|
||||
managerId,
|
||||
role,
|
||||
fromDate: controllers['startDate']?.text ?? '',
|
||||
toDate: controllers['endDate']?.text ?? '',
|
||||
fromDate: fromDt,
|
||||
toDate: toDt,
|
||||
selectedStaffId: SelectedStaffId ?? '',
|
||||
);
|
||||
|
||||
@ -211,6 +231,9 @@ class policylistState extends ConsumerState<policylist> {
|
||||
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||
query.toLowerCase(),
|
||||
) ||
|
||||
(item['insurer_short_name'] ?? '-').toLowerCase().contains(
|
||||
query.toLowerCase(),
|
||||
) ||
|
||||
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
|
||||
query.toLowerCase(),
|
||||
) ||
|
||||
@ -220,7 +243,7 @@ class policylistState extends ConsumerState<policylist> {
|
||||
(item['premium_amount'] ?? '-').toLowerCase().contains(
|
||||
query.toLowerCase(),
|
||||
) ||
|
||||
(item['payment_mode'] ?? '-').toLowerCase().contains(
|
||||
(item['payment_mode_value'] ?? '-').toLowerCase().contains(
|
||||
query.toLowerCase(),
|
||||
) ||
|
||||
(_formatDate(item['updated_on']) ?? '-').toLowerCase().contains(
|
||||
@ -247,125 +270,6 @@ class policylistState extends ConsumerState<policylist> {
|
||||
}
|
||||
}
|
||||
|
||||
List<Widget> _buildPopupMenuActions(
|
||||
BuildContext context,
|
||||
dynamic data,
|
||||
id,
|
||||
regNum,
|
||||
) {
|
||||
return [
|
||||
// if (roleId == 'manager') ...[
|
||||
// Material(
|
||||
// color: Colors.transparent,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.pop(context);
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (ctx) => AssignStaffDialog(
|
||||
// enquiryPrimaryId: id,
|
||||
// regNum: regNum,
|
||||
// userId: userId,
|
||||
// onSubmit: (value) {
|
||||
// debugPrint("New assignY: $value");
|
||||
// refresh();
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// hoverColor: Color(0xFFE3F1F0),
|
||||
// splashColor: Color(0xFFE3F1F0),
|
||||
// borderRadius: BorderRadius.circular(6),
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
// child: Row(
|
||||
// // mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// Image.asset(
|
||||
// "assets/miscellaneous/image_3.png",
|
||||
// // height: 45,
|
||||
// // width: 15,
|
||||
// ),
|
||||
//
|
||||
// SizedBox(width: 10),
|
||||
// Text('Assign Staff'),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
ref.read(quotationStaffIdProvider.notifier).state = id;
|
||||
context.go(AppRoutes.quotation);
|
||||
},
|
||||
hoverColor: Color(0xFFE3F1F0),
|
||||
splashColor: Color(0xFFE3F1F0),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
child: Row(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Tooltip(
|
||||
message: "Close",
|
||||
child: Image.asset(
|
||||
"assets/miscellaneous/image_1.png",
|
||||
height: 15,
|
||||
width: 15,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
((data['status'] == 'Policy Created') ||
|
||||
(data['status'] == 'Quotation Accepted'))
|
||||
? const Text('View Quotation')
|
||||
: const Text('Create Quotation'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
if (data['status'] == 'Quotation Accepted' ||
|
||||
data['status'] == 'Policy Created')
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
ref.read(quotationStaffIdProvider.notifier).state = id;
|
||||
context.go(AppRoutes.policy);
|
||||
},
|
||||
hoverColor: Color(0xFFE3F1F0),
|
||||
splashColor: Color(0xFFE3F1F0),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
child: Row(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/miscellaneous/image_2.png",
|
||||
height: 15,
|
||||
width: 15,
|
||||
),
|
||||
|
||||
const SizedBox(width: 10),
|
||||
data['status'] == 'Policy Created'
|
||||
? Text('View Policy')
|
||||
: Text('Create Policy'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MainLayout(
|
||||
@ -388,24 +292,6 @@ class policylistState extends ConsumerState<policylist> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
// Tooltip(
|
||||
// message: 'Back',
|
||||
// child: IconButton(
|
||||
// icon: const Icon(
|
||||
// Icons.arrow_left_sharp,
|
||||
// size: 18,
|
||||
// color: Color(0xFF425B5B),
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// context.go(AppRoutes.dashboard);
|
||||
// },
|
||||
// splashRadius: 18,
|
||||
// hoverColor: Colors.black12,
|
||||
// padding: const EdgeInsets.all(4),
|
||||
// constraints: const BoxConstraints(),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(width: 5), // spacing between icon and text
|
||||
Text(
|
||||
"Policy",
|
||||
style: GoogleFonts.poppins(
|
||||
@ -536,42 +422,6 @@ class policylistState extends ConsumerState<policylist> {
|
||||
},
|
||||
),
|
||||
|
||||
// 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(),
|
||||
],
|
||||
ResponsiveLayout.isMobile(context)
|
||||
@ -612,53 +462,14 @@ class policylistState extends ConsumerState<policylist> {
|
||||
// "updated_on",
|
||||
"assigned_to_name",
|
||||
"agent_name",
|
||||
"insurer_name",
|
||||
"insurer_short_name",
|
||||
"reg_no",
|
||||
"insured_name",
|
||||
"premium_amount",
|
||||
"payment_mode",
|
||||
"payment_mode_value",
|
||||
"policy_number",
|
||||
],
|
||||
),
|
||||
|
||||
// SizedBox(width: 10),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// // print('Export');
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.all(8.0),
|
||||
// decoration: BoxDecoration(
|
||||
// color: Color(0xFF425B5B),
|
||||
// borderRadius: BorderRadius.circular(8.0),
|
||||
// ),
|
||||
// child: Row(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// Icon(Icons.add, color: Colors.white),
|
||||
//
|
||||
// if (!ResponsiveLayout.isMobile(context)) ...[
|
||||
// SizedBox(width: 10),
|
||||
//
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// // context.go(AppRoutes.agent / create);
|
||||
// context.go('/staff/create');
|
||||
// },
|
||||
// child: Text(
|
||||
// 'Create New Staff',
|
||||
// style: GoogleFonts.inter(
|
||||
// color: Colors.white,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// fontSize: 14,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -682,20 +493,20 @@ class policylistState extends ConsumerState<policylist> {
|
||||
child: Text('Assigned To', style: _headerStyle),
|
||||
),
|
||||
|
||||
Expanded(flex: 2, child: Text('Partner', style: _headerStyle)),
|
||||
Expanded(flex: 4, child: Text('Insurer', style: _headerStyle)),
|
||||
Expanded(flex: 3, child: Text('Partner', style: _headerStyle)),
|
||||
Expanded(flex: 2, child: Text('Insurer', style: _headerStyle)),
|
||||
|
||||
Expanded(
|
||||
flex: 3,
|
||||
flex: 2,
|
||||
child: Text('Vehicle.No.', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text('Insured Name', style: _headerStyle),
|
||||
),
|
||||
Expanded(flex: 3, child: Text('Premium', style: _headerStyle)),
|
||||
Expanded(flex: 2, child: Text('Premium', style: _headerStyle)),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
flex: 2,
|
||||
child: Text('Payment Mode', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
@ -703,7 +514,7 @@ class policylistState extends ConsumerState<policylist> {
|
||||
child: Text('Policy Number', style: _headerStyle),
|
||||
),
|
||||
|
||||
Expanded(flex: 3, child: Text('Action', style: _headerStyle)),
|
||||
Expanded(flex: 2, child: Text('Action', style: _headerStyle)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -820,21 +631,21 @@ class policylistState extends ConsumerState<policylist> {
|
||||
child: Text(item['assigned_to_name'] ?? '-', style: _dataBold),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
flex: 3,
|
||||
child: Text(item['agent_name'] ?? '-', style: _dataBold),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
flex: 4,
|
||||
flex: 2,
|
||||
child: Text(
|
||||
item['insurer_name'] ?? '-',
|
||||
item['insurer_short_name'] ?? '-',
|
||||
style: _dataBold,
|
||||
softWrap: true,
|
||||
maxLines: 3,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
flex: 2,
|
||||
child: Text(item['reg_no'] ?? '-', style: _dataBold),
|
||||
),
|
||||
Expanded(
|
||||
@ -847,7 +658,7 @@ class policylistState extends ConsumerState<policylist> {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
flex: 2,
|
||||
child: Text(
|
||||
item['premium_amount'] ?? '-',
|
||||
style: _dataBold,
|
||||
@ -856,9 +667,9 @@ class policylistState extends ConsumerState<policylist> {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
flex: 2,
|
||||
child: Text(
|
||||
item['payment_mode'] ?? '-',
|
||||
item['payment_mode_value'] ?? '-',
|
||||
style: _dataBold,
|
||||
softWrap: true,
|
||||
maxLines: 3,
|
||||
@ -874,7 +685,7 @@ class policylistState extends ConsumerState<policylist> {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
flex: 2,
|
||||
child: Row(
|
||||
children: [
|
||||
Tooltip(
|
||||
|
||||
@ -54,7 +54,7 @@ class _CustomBarChartState extends State<CustomBarChart> {
|
||||
barRods: [
|
||||
BarChartRodData(toY: value1, color: Colors.cyan.shade300, width: 6),
|
||||
// BarChartRodData(toY: 2, color: Colors.orange.shade300, width: 6),
|
||||
BarChartRodData(toY: value2, color: widget.shadowColor, width: 6),
|
||||
BarChartRodData(toY: value2, color: Colors.orange.shade300, width: 6),
|
||||
],
|
||||
showingTooltipIndicators: touchedGroupIndex == x ? [0] : [],
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user