File Download Info UI_Changes

This commit is contained in:
venbaittech 2025-10-29 16:07:13 +05:30
parent 626b09e3c9
commit e16fec2619
12 changed files with 256 additions and 134 deletions

File diff suppressed because one or more lines are too long

View File

@ -220,9 +220,9 @@ class ApiService {
if (contentType.contains('application/json')) { if (contentType.contains('application/json')) {
final jsonResponse = jsonDecode(response.body); final jsonResponse = jsonDecode(response.body);
if (jsonResponse['code'] == 404 || jsonResponse['code'] == 500) { if (jsonResponse['code'] == 404 || jsonResponse['code'] == 500) {
ToastHelper.showInfoToast(context, 'File Not Found'); ToastHelper.show('File Not Found', Colors.red);
} else { } else {
ToastHelper.showInfoToast(context, 'No File Found'); ToastHelper.show('No File Found', Colors.red);
} }
return; return;
} else { } else {
@ -272,9 +272,9 @@ class ApiService {
} else if (response.statusCode == 403) { } else if (response.statusCode == 403) {
await clearLocalStorageAndRedirect(); await clearLocalStorageAndRedirect();
} else if (response.statusCode == 500) { } else if (response.statusCode == 500) {
ToastHelper.showInfoToast(context, 'No File Not Found'); ToastHelper.show('No File Found', Colors.red);
} else { } else {
ToastHelper.showInfoToast(context, 'No File Not Found'); ToastHelper.show('No File Found', Colors.red);
throw Exception('Failed to download file'); throw Exception('Failed to download file');
} }
} }
@ -813,6 +813,8 @@ class ApiService {
query = 'manager_id=$id'; query = 'manager_id=$id';
} else if (role == 'staff') { } else if (role == 'staff') {
query = 'staff_id=$id'; query = 'staff_id=$id';
} else if (role == 'handler') {
query = 'handler_id=$id';
} else { } else {
query = 'agent_id=$id'; query = 'agent_id=$id';
} }
@ -859,13 +861,14 @@ class ApiService {
if (role == 'manager') { if (role == 'manager') {
url = Uri.parse('${Env.apiUrl}claim/ClaimList?manager_id=$id'); url = Uri.parse('${Env.apiUrl}claim/ClaimList?manager_id=$id');
} } else if (role == 'agent') {
// else if (role == 'staff') {
// url = Uri.parse('${Env.apiUrl}enquiry/enquiryList?staff_id=$id');
// }
else {
url = Uri.parse('${Env.apiUrl}claim/ClaimList?agent_id=$id'); url = Uri.parse('${Env.apiUrl}claim/ClaimList?agent_id=$id');
} else if (role == 'handler') {
url = Uri.parse('${Env.apiUrl}claim/ClaimList?handler_id=$id');
} else {
url = Uri.parse('${Env.apiUrl}claim/ClaimList?staff_id=$id');
} }
// final url = Uri.parse( // final url = Uri.parse(
// 'https://venbait.in/nhance/partner/dev/api/agent/agentList?manager_id=${managerId}', // 'https://venbait.in/nhance/partner/dev/api/agent/agentList?manager_id=${managerId}',
// ); // );
@ -907,12 +910,12 @@ class ApiService {
url = Uri.parse( url = Uri.parse(
'${Env.apiUrl}endorsement/endorsementList?manager_id=$id', '${Env.apiUrl}endorsement/endorsementList?manager_id=$id',
); );
} } else if (role == 'agent') {
// else if (role == 'staff') {
// url = Uri.parse('${Env.apiUrl}enquiry/enquiryList?staff_id=$id');
// }
else {
url = Uri.parse('${Env.apiUrl}endorsement/endorsementList?agent_id=$id'); url = Uri.parse('${Env.apiUrl}endorsement/endorsementList?agent_id=$id');
} else if (role == 'handler') {
url = Uri.parse('${Env.apiUrl}enquiry/enquiryList?handler_id=$id');
} else {
url = Uri.parse('${Env.apiUrl}endorsement/endorsementList?staff_id=$id');
} }
// final url = Uri.parse( // final url = Uri.parse(
// 'https://venbait.in/nhance/partner/dev/api/agent/agentList?manager_id=${managerId}', // 'https://venbait.in/nhance/partner/dev/api/agent/agentList?manager_id=${managerId}',

View File

@ -1,6 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
// import 'package:fluttertoast/fluttertoast.dart'; // import 'package:fluttertoast/fluttertoast.dart';
import 'package:toastification/toastification.dart'; import 'package:toastification/toastification.dart';
import 'package:universal_html/html.dart' as html;
class ToastHelper { class ToastHelper {
static void showSuccessToast(BuildContext context, String message) { static void showSuccessToast(BuildContext context, String message) {
@ -17,10 +20,7 @@ class ToastHelper {
direction: TextDirection.ltr, direction: TextDirection.ltr,
animationDuration: const Duration(milliseconds: 100), animationDuration: const Duration(milliseconds: 100),
animationBuilder: (context, animation, alignment, child) { animationBuilder: (context, animation, alignment, child) {
return FadeTransition( return FadeTransition(opacity: animation, child: child);
opacity: animation,
child: child,
);
}, },
icon: const Icon(Icons.check), icon: const Icon(Icons.check),
primaryColor: Colors.green, primaryColor: Colors.green,
@ -35,7 +35,7 @@ class ToastHelper {
blurRadius: 16, blurRadius: 16,
offset: Offset(0, 16), offset: Offset(0, 16),
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
showProgressBar: true, showProgressBar: true,
closeButtonShowType: CloseButtonShowType.onHover, closeButtonShowType: CloseButtonShowType.onHover,
@ -68,10 +68,7 @@ class ToastHelper {
direction: TextDirection.ltr, direction: TextDirection.ltr,
animationDuration: const Duration(milliseconds: 100), animationDuration: const Duration(milliseconds: 100),
animationBuilder: (context, animation, alignment, child) { animationBuilder: (context, animation, alignment, child) {
return FadeTransition( return FadeTransition(opacity: animation, child: child);
opacity: animation,
child: child,
);
}, },
icon: const Icon(Icons.warning), icon: const Icon(Icons.warning),
primaryColor: Colors.amberAccent, primaryColor: Colors.amberAccent,
@ -86,7 +83,7 @@ class ToastHelper {
blurRadius: 16, blurRadius: 16,
offset: Offset(0, 16), offset: Offset(0, 16),
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
showProgressBar: true, showProgressBar: true,
closeButtonShowType: CloseButtonShowType.onHover, closeButtonShowType: CloseButtonShowType.onHover,
@ -119,10 +116,7 @@ class ToastHelper {
direction: TextDirection.ltr, direction: TextDirection.ltr,
animationDuration: const Duration(milliseconds: 100), animationDuration: const Duration(milliseconds: 100),
animationBuilder: (context, animation, alignment, child) { animationBuilder: (context, animation, alignment, child) {
return FadeTransition( return FadeTransition(opacity: animation, child: child);
opacity: animation,
child: child,
);
}, },
icon: const Icon(Icons.error), icon: const Icon(Icons.error),
primaryColor: Colors.redAccent, primaryColor: Colors.redAccent,
@ -137,7 +131,7 @@ class ToastHelper {
blurRadius: 16, blurRadius: 16,
offset: Offset(0, 16), offset: Offset(0, 16),
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
showProgressBar: true, showProgressBar: true,
closeButtonShowType: CloseButtonShowType.onHover, closeButtonShowType: CloseButtonShowType.onHover,
@ -171,10 +165,7 @@ class ToastHelper {
direction: TextDirection.ltr, direction: TextDirection.ltr,
animationDuration: const Duration(milliseconds: 100), animationDuration: const Duration(milliseconds: 100),
animationBuilder: (context, animation, alignment, child) { animationBuilder: (context, animation, alignment, child) {
return FadeTransition( return FadeTransition(opacity: animation, child: child);
opacity: animation,
child: child,
);
}, },
icon: const Icon(Icons.info), icon: const Icon(Icons.info),
primaryColor: Colors.lightBlue, primaryColor: Colors.lightBlue,
@ -189,7 +180,7 @@ class ToastHelper {
blurRadius: 16, blurRadius: 16,
offset: Offset(0, 16), offset: Offset(0, 16),
spreadRadius: 0, spreadRadius: 0,
) ),
], ],
showProgressBar: true, showProgressBar: true,
closeButtonShowType: CloseButtonShowType.onHover, closeButtonShowType: CloseButtonShowType.onHover,
@ -209,15 +200,78 @@ class ToastHelper {
// _showToast(context, message, Colors.red); // _showToast(context, message, Colors.red);
} }
static void _showToast(BuildContext context, String message, Color color) { static void show(String message, Color backgroundColor) {
// Fluttertoast.showToast( if (kIsWeb) {
// msg: message, _showWebToast(message, backgroundColor);
// toastLength: Toast.LENGTH_SHORT, } else {
// gravity: ToastGravity.TOP, Fluttertoast.showToast(
// timeInSecForIosWeb: 5, msg: message,
// backgroundColor: color, toastLength: Toast.LENGTH_SHORT,
// textColor: Colors.white, gravity: ToastGravity.BOTTOM,
// fontSize: 16.0, backgroundColor: backgroundColor,
// ); textColor: Colors.white,
fontSize: 16.0,
);
}
} }
static void _showWebToast(String message, Color backgroundColor) {
// Create toast element
final toast = html.DivElement()
..style.position = 'fixed'
..style.top =
'20px' // Top position
..style.right =
'20px' // Left position
..style.backgroundColor = _colorToRgba(backgroundColor)
..style.color = 'white'
..style.padding = '12px 24px'
..style.borderRadius = '8px'
// ..style.borderColor = _colorToRgba(backgroundColor)
..style.boxShadow = '0 4px 6px rgba(0, 0, 0, 0.2)'
..style.zIndex = '9999'
..style.fontSize = '12px'
..style.fontFamily = "'Inter', sans-serif"
..style.fontWeight =
'800' // Bold
..style.minWidth = '200px'
..style.maxWidth = '400px'
..style.textAlign = 'left'
..style.transition = 'all 0.3s ease-in-out'
..style.opacity = '0'
..text = message;
// Add to body
html.document.body?.append(toast);
// Fade in animation
Future.delayed(Duration(milliseconds: 10), () {
toast.style.opacity = '1';
});
// Auto remove after 3 seconds
Future.delayed(Duration(milliseconds: 2700), () {
toast.style.opacity = '0';
});
Future.delayed(Duration(seconds: 3), () {
toast.remove();
});
}
static String _colorToRgba(Color color) {
return 'rgba(${color.red}, ${color.green}, ${color.blue}, ${color.opacity})';
}
// static void _showToast(BuildContext context, String message, Color color) {
// Fluttertoast.showToast(
// msg: message,
// toastLength: Toast.LENGTH_SHORT,
// gravity: ToastGravity.TOP,
// timeInSecForIosWeb: 5,
// backgroundColor: color,
// textColor: Colors.white,
// fontSize: 16.0,
// );
// }
} }

View File

@ -441,6 +441,7 @@ class PolicyTabState extends ConsumerState<PolicyTab> {
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; // 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
final path = final path =
'api/policy/downloadPolicyFile?policy_id=$selectedId&file_type=policy_pdf'; 'api/policy/downloadPolicyFile?policy_id=$selectedId&file_type=policy_pdf';
apiService.getPdfDownload(path, selectedId); apiService.getPdfDownload(path, selectedId);
}, },
child: Container( child: Container(

View File

@ -672,20 +672,20 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
children: [ children: [
Expanded(flex: 1, child: Text('S.No.', style: _headerStyle)), Expanded(flex: 1, child: Text('S.No.', style: _headerStyle)),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text('Received Date & Time', style: _headerStyle), child: Text('Received Date', style: _headerStyle),
), ),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text('Vehicle.No.', style: _headerStyle), child: Text('Vehicle.No.', style: _headerStyle),
), ),
Expanded(flex: 3, child: Text('Insurer', style: _headerStyle)), Expanded(flex: 3, child: Text('Insurer', style: _headerStyle)),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text('Updated Date', style: _headerStyle), child: Text('Updated Date', style: _headerStyle),
), ),
Expanded(flex: 2, child: Text('Status', style: _headerStyle)), Expanded(flex: 3, child: Text('Status', style: _headerStyle)),
Expanded(flex: 2, child: Text('Remarks', style: _headerStyle)), Expanded(flex: 2, child: Text('Remarks', style: _headerStyle)),
Expanded(flex: 1, child: Text('Action', style: _headerStyle)), Expanded(flex: 1, child: Text('Action', style: _headerStyle)),
], ],
@ -785,7 +785,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
children: [ children: [
Expanded(flex: 1, child: Text('$sno' ?? '-', style: _dataBold)), Expanded(flex: 1, child: Text('$sno' ?? '-', style: _dataBold)),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text( child: Text(
_formatDate(item['created_on']) ?? '-', _formatDate(item['created_on']) ?? '-',
style: _dataBold, style: _dataBold,
@ -793,36 +793,43 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
), ),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text(item['reg_no'] ?? '-', style: _dataBold), child: Text(item['reg_no'] ?? '-', style: _dataBold),
), ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(
item['insurer_name'] ?? '-', item['insurer_name'] ?? '-',
// (item['insurer_name'] ?? '').length > 10
// ? '${item['insurer_name'].substring(0, 10)}...'
// : item['insurer_name'] ?? '',
style: _dataBold, style: _dataBold,
softWrap: true, softWrap: true,
maxLines: 3, maxLines: 3,
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text( child: Text(
_formatDate(item['updated_on']) ?? '-', _formatDate(item['updated_on']) ?? '-',
style: _dataBold, style: _dataBold,
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 3,
child: Text(item['status'] ?? '-', style: _dataBold), child: Text(item['status'] ?? '-', style: _dataBold),
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
item['remarks'] ?? '-', // item['remarks'] ?? '-',
(item['remarks'] ?? '').length > 10
? '${item['remarks'].substring(0, 10)}...'
: item['remarks'] ?? '',
style: _dataBold, style: _dataBold,
softWrap: true, // softWrap: true,
maxLines: 3, overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
), ),

View File

@ -81,28 +81,53 @@ class StaffListState extends ConsumerState<StaffList> {
return sortedData.sublist(startIndex, endIndex); return sortedData.sublist(startIndex, endIndex);
} }
// void filterData(String query) {
// print("FilterDAta - $query");
// setState(() {
// filteredData = getStaffData.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['emp_id'] ?? item['agent_code'] ?? '-')
// .toLowerCase()
// .contains(query.toLowerCase()) ||
// isActiveStatus.contains(query.toLowerCase());
// }).toList();
// });
// }
void filterData(String query) { void filterData(String query) {
print("FilterDAta - $query");
setState(() { setState(() {
final q = query.toLowerCase();
if (q.isEmpty) {
filteredData = getStaffData;
return;
}
filteredData = getStaffData.where((item) { filteredData = getStaffData.where((item) {
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive"; final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
return (item['name'] ?? '-').toLowerCase().contains( return (item['name'] ?? '').toString().toLowerCase().contains(q) ||
query.toLowerCase(), (item['email'] ?? '').toString().toLowerCase().contains(q) ||
) || (item['mobile'] ?? '').toString().toLowerCase().contains(q) ||
(item['email'] ?? '-').toLowerCase().contains( (item['address'] ?? '').toString().toLowerCase().contains(q) ||
query.toLowerCase(), (item['emp_id'] ?? item['agent_code'] ?? '')
) || .toString()
(item['mobile'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(item['address'] ?? '-').toLowerCase().contains(
query.toLowerCase(),
) ||
(item['emp_id'] ?? item['agent_code'] ?? '-')
.toLowerCase() .toLowerCase()
.contains(query.toLowerCase()) || .contains(q) ||
isActiveStatus.contains(query.toLowerCase()); isActiveStatus.contains(q);
}).toList(); }).toList();
}); });
} }

View File

@ -150,25 +150,30 @@ class EnquiryHandlerState extends ConsumerState<EnquiryHandler> {
); );
} }
void refrshfilterDateRange() { Future<void> refrshfilterDateRange() async {
setState(() async { // setState(() async {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
// Clear any old data // Clear any old data
await prefs.remove('dashboardKeyProvider'); await prefs.remove('dashboardKeyProvider');
await prefs.remove('dashboardStatusProvider'); await prefs.remove('dashboardStatusProvider');
await prefs.remove('dashboardStaffIdProvider'); await prefs.remove('dashboardStaffIdProvider');
SelectedStatus = ''; SelectedStatus = '';
SelectedStaffId = null; SelectedStaffId = null;
controllers['startDate']!.clear(); controllers['startDate']!.clear();
controllers['endDate']!.clear(); controllers['endDate']!.clear();
controllers['startDate']?.text = ''; controllers['startDate']?.text = '';
controllers['endDate']?.text = ''; controllers['endDate']?.text = '';
// Reset the FormField validation // Reset the FormField validation
_formKey.currentState?.reset(); _formKey.currentState?.reset();
}); // });
getStaffList(managerId, roleId); getStaffList(
managerId,
roleId,
SelectedStatus: SelectedStatus ?? '',
SelectedStaffId: SelectedStaffId ?? '',
);
} }
Future<void> getStaffList( Future<void> getStaffList(
@ -898,43 +903,43 @@ class EnquiryHandlerState extends ConsumerState<EnquiryHandler> {
children: [ children: [
Expanded( Expanded(
flex: 2, flex: 2,
child: Text('Received Date', style: _headerStyle), child: Text('Received Date ', style: _headerStyle),
), ),
Expanded(flex: 2, child: Text('Partner', 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),
), ),
Expanded(flex: 3, child: Text('Insurer', style: _headerStyle)), Expanded(flex: 3, child: Text('Insurer ', style: _headerStyle)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text('Vehicle.No', style: _headerStyle), child: Text('Vehicle.No ', style: _headerStyle),
),
Expanded(
flex: 2,
// child: Padding(
// padding: EdgeInsets.only(left: 8.0),
child: Text('Insured Name', style: _headerStyle),
// ),
), ),
// Expanded(
// flex: 2,
// // child: Padding(
// // padding: EdgeInsets.only(left: 8.0),
// child: Text('Insured Name ', style: _headerStyle),
// // ),
// ),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text('Assigned Date', style: _headerStyle), child: Text('Assigned Date ', style: _headerStyle),
), ),
Expanded(flex: 2, child: Text('Premium', style: _headerStyle)), Expanded(flex: 2, child: Text('Premium ', style: _headerStyle)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text('Payment Mode', style: _headerStyle), child: Text('Payment Mode ', style: _headerStyle),
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text('Policy Number', style: _headerStyle), child: Text('Policy Number ', style: _headerStyle),
), ),
Expanded(flex: 2, child: Text('Status', style: _headerStyle)), Expanded(flex: 2, child: Text('Status ', style: _headerStyle)),
Expanded(flex: 1, child: Text('Action', style: _headerStyle)), Expanded(flex: 1, child: Text('Action', style: _headerStyle)),
], ],
), ),
@ -1059,19 +1064,26 @@ class EnquiryHandlerState extends ConsumerState<EnquiryHandler> {
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text(item['reg_no'] ?? '-', style: _dataBold), child: Column(
), mainAxisAlignment: MainAxisAlignment.start,
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
flex: 2, children: [
Text(item['reg_no'] ?? '-', style: _dataBold),
child: Text( Text(item['insured_name'] ?? '-', style: _dataBoldsmall),
item['insured_name'] ?? '-', ],
style: _dataBold,
softWrap: true,
maxLines: 3,
), ),
), ),
// Expanded(
// flex: 2,
//
// child: Text(
// item['insured_name'] ?? '-',
// style: _dataBold,
// softWrap: true,
// maxLines: 3,
// ),
// ),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
@ -1350,6 +1362,12 @@ class EnquiryHandlerState extends ConsumerState<EnquiryHandler> {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF000000), color: Color(0xFF000000),
); );
static final _dataBoldsmall = TextStyle(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Color(0xFF000000),
);
static final _dataSub = TextStyle( static final _dataSub = TextStyle(
fontSize: 10, fontSize: 10,

View File

@ -866,8 +866,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
child: const Row( child: const Row(
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 2,
child: Text('Received Date & Time', style: _headerStyle), child: Text('Received Date', style: _headerStyle),
), ),
Expanded(flex: 2, child: Text('Partner ', style: _headerStyle)), Expanded(flex: 2, child: Text('Partner ', style: _headerStyle)),
Expanded( Expanded(
@ -884,8 +884,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
child: Text('Insured Name', style: _headerStyle), child: Text('Insured Name', style: _headerStyle),
), ),
Expanded( Expanded(
flex: 3, flex: 2,
child: Text('Assigned Date & Time', style: _headerStyle), child: Text('Assigned Date', style: _headerStyle),
), ),
Expanded(flex: 3, child: Text('Status', style: _headerStyle)), Expanded(flex: 3, child: Text('Status', style: _headerStyle)),
], ],
@ -952,7 +952,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 2,
child: Text( child: Text(
_formatDate(item['created_on']) ?? '-', _formatDate(item['created_on']) ?? '-',
style: _dataBold, style: _dataBold,
@ -1018,7 +1018,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
position: RelativeRect.fromLTRB( position: RelativeRect.fromLTRB(
position.dx, position.dx,
position.dy + button.size.height, position.dy + button.size.height,
overlay.size.width - position.dx, overlay.size.width,
// overlay.size.width - position.dx,
0, 0,
), ),
items: [ items: [
@ -1067,7 +1068,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
), ),
Expanded( Expanded(
flex: 3, flex: 2,
child: Text( child: Text(
_formatDate(item['updated_on']) ?? '-', _formatDate(item['updated_on']) ?? '-',
style: _dataBold, style: _dataBold,
@ -1303,12 +1304,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
Widget buildDocRC(BuildContext context, bool isMobile, selectedEnquiryId) { Widget buildDocRC(BuildContext context, bool isMobile, selectedEnquiryId) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
// print("Upload $idget.id}{w");
final selectedId = selectedEnquiryId; final selectedId = selectedEnquiryId;
// final path = // final path =
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; // 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
final path = final path =
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc'; 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
apiService.getPdfDownload(path, selectedId); apiService.getPdfDownload(path, selectedId);
}, },
child: Container( child: Container(

View File

@ -1217,12 +1217,16 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
).format(date); ).format(date);
// auto set end date (1 year later - 1 day if needed) // auto set end date (1 year later - 1 day if needed)
// final endDate = DateTime(
// date.year + 1,
// date.month,
// date.day,
// ); // optional: subtract 1 day
final endDate = DateTime( final endDate = DateTime(
date.year + 1, date.year + 1,
date.month, date.month,
date.day, date.day,
); // optional: subtract 1 day ).subtract(const Duration(days: 1));
controllers['endDate']?.text = DateFormat( controllers['endDate']?.text = DateFormat(
'dd-MM-yyyy', 'dd-MM-yyyy',
).format(endDate); ).format(endDate);

View File

@ -664,13 +664,13 @@ class policylistState extends ConsumerState<policylist> {
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 4, flex: 2,
child: Text('Recieved Date/Time', style: _headerStyle), child: Text('Recieved Date', style: _headerStyle),
), ),
Expanded(flex: 3, child: Text('Partner', style: _headerStyle)), Expanded(flex: 2, child: Text('Partner', style: _headerStyle)),
Expanded( Expanded(
flex: 3, flex: 2,
child: Text('Assigned To', style: _headerStyle), child: Text('Assigned To', style: _headerStyle),
), ),
Expanded(flex: 4, child: Text('Insurer', style: _headerStyle)), Expanded(flex: 4, child: Text('Insurer', style: _headerStyle)),
@ -794,7 +794,7 @@ class policylistState extends ConsumerState<policylist> {
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 4, flex: 2,
child: Text( child: Text(
_formatDate(item['updated_on']) ?? '-', _formatDate(item['updated_on']) ?? '-',
style: _dataBold, style: _dataBold,
@ -804,14 +804,14 @@ class policylistState extends ConsumerState<policylist> {
), ),
Expanded( Expanded(
flex: 3, flex: 2,
child: Text( child: Text(
_formatDate(item['agent_name']) ?? '-', _formatDate(item['agent_name']) ?? '-',
style: _dataBold, style: _dataBold,
), ),
), ),
Expanded( Expanded(
flex: 3, flex: 2,
child: Text(item['assigned_to_name'] ?? '-', style: _dataBold), child: Text(item['assigned_to_name'] ?? '-', style: _dataBold),
), ),
Expanded( Expanded(

View File

@ -504,6 +504,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
fluttertoast:
dependency: "direct main"
description:
name: fluttertoast
sha256: "144ddd74d49c865eba47abe31cbc746c7b311c82d6c32e571fd73c4264b740e2"
url: "https://pub.dev"
source: hosted
version: "9.0.0"
frontend_server_client: frontend_server_client:
dependency: transitive dependency: transitive
description: description:

View File

@ -68,6 +68,7 @@ dependencies:
excel: ^4.0.6 excel: ^4.0.6
dropdown_search: ^6.0.2 dropdown_search: ^6.0.2
file_picker: ^10.3.3 file_picker: ^10.3.3
fluttertoast: ^9.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: