UI_CHANGES
This commit is contained in:
parent
35ab0f994b
commit
4821c5f058
@ -154,7 +154,11 @@ class ApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getPdfDownload(BuildContext context,String path, String id) async {
|
Future<void> getPdfDownload(
|
||||||
|
BuildContext context,
|
||||||
|
String path,
|
||||||
|
String id,
|
||||||
|
) async {
|
||||||
print('getPdfDownload 1');
|
print('getPdfDownload 1');
|
||||||
print('getPdfDownload 1 - $path');
|
print('getPdfDownload 1 - $path');
|
||||||
|
|
||||||
@ -176,16 +180,17 @@ class ApiService {
|
|||||||
final response = await _makeGethttpRequest(url, headers);
|
final response = await _makeGethttpRequest(url, headers);
|
||||||
print('getPdfDownload 3');
|
print('getPdfDownload 3');
|
||||||
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final contentType = response.headers['content-type'] ?? '';
|
final contentType = response.headers['content-type'] ?? '';
|
||||||
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.showInfoToast(context, 'File Not Found');
|
||||||
else { ToastHelper.showInfoToast(context, 'No File Found'); }
|
} else {
|
||||||
|
ToastHelper.showInfoToast(context, 'No File Found');
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}else{
|
} else {
|
||||||
final blob = html.Blob([response.bodyBytes]);
|
final blob = html.Blob([response.bodyBytes]);
|
||||||
final blobUrl = html.Url.createObjectUrlFromBlob(blob);
|
final blobUrl = html.Url.createObjectUrlFromBlob(blob);
|
||||||
print('getPdfDownload $blobUrl');
|
print('getPdfDownload $blobUrl');
|
||||||
@ -256,7 +261,7 @@ class ApiService {
|
|||||||
} else if (apiUrl != null) {
|
} else if (apiUrl != null) {
|
||||||
print("Download from API: $apiUrl");
|
print("Download from API: $apiUrl");
|
||||||
print("Download from API: $apiId!");
|
print("Download from API: $apiId!");
|
||||||
await getPdfDownload(context,apiUrl, apiId!);
|
await getPdfDownload(context, apiUrl, apiId!);
|
||||||
} else {
|
} else {
|
||||||
print("⚠️ No file available to download");
|
print("⚠️ No file available to download");
|
||||||
}
|
}
|
||||||
@ -470,7 +475,7 @@ class ApiService {
|
|||||||
|
|
||||||
// ----------------------------------- ENQUIRY -------------------------------------------------
|
// ----------------------------------- ENQUIRY -------------------------------------------------
|
||||||
|
|
||||||
Future<Map<String, dynamic>> fetchEnquiryList(int id, role) async {
|
Future<Map<String, dynamic>> fetchEnquiryList1(int id, role) async {
|
||||||
// print(_token);
|
// print(_token);
|
||||||
if (_token == null) {
|
if (_token == null) {
|
||||||
await _initializeToken();
|
await _initializeToken();
|
||||||
@ -479,11 +484,17 @@ class ApiService {
|
|||||||
final url;
|
final url;
|
||||||
|
|
||||||
if (role == 'manager') {
|
if (role == 'manager') {
|
||||||
url = Uri.parse('${Env.apiUrl}enquiry/enquiryList?manager_id=$id');
|
url = Uri.parse(
|
||||||
|
'${Env.apiUrl}enquiry/enquiryList?manager_id=$id&from_date=&to_date=',
|
||||||
|
);
|
||||||
} else if (role == 'staff') {
|
} else if (role == 'staff') {
|
||||||
url = Uri.parse('${Env.apiUrl}enquiry/enquiryList?staff_id=$id');
|
url = Uri.parse(
|
||||||
|
'${Env.apiUrl}enquiry/enquiryList?staff_id=$id&from_date=&to_date=',
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
url = Uri.parse('${Env.apiUrl}enquiry/enquiryList?agent_id=$id');
|
url = Uri.parse(
|
||||||
|
'${Env.apiUrl}enquiry/enquiryList?agent_id=$id&from_date=&to_date=',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// 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}',
|
||||||
@ -496,6 +507,39 @@ class ApiService {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<Map<String, dynamic>> fetchEnquiryList(
|
||||||
|
int id,
|
||||||
|
String role, {
|
||||||
|
String? fromDate,
|
||||||
|
String? toDate,
|
||||||
|
}) async {
|
||||||
|
if (_token == null) {
|
||||||
|
await _initializeToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
final String query;
|
||||||
|
|
||||||
|
if (role == 'manager') {
|
||||||
|
query = 'manager_id=$id';
|
||||||
|
} else if (role == 'staff') {
|
||||||
|
query = 'staff_id=$id';
|
||||||
|
} else {
|
||||||
|
query = 'agent_id=$id';
|
||||||
|
}
|
||||||
|
|
||||||
|
final url = Uri.parse(
|
||||||
|
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}',
|
||||||
|
);
|
||||||
|
|
||||||
|
final headers = {
|
||||||
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
|
'App-Signature': 'nhance-partner-2025-signature-35468846JRhH551HK',
|
||||||
|
};
|
||||||
|
|
||||||
|
final response = await _makeGetRequest(url, headers);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> findSingleEnquiryData(id) async {
|
Future<Map<String, dynamic>> findSingleEnquiryData(id) async {
|
||||||
// print(_token);
|
// print(_token);
|
||||||
if (_token == null) {
|
if (_token == null) {
|
||||||
|
|||||||
@ -326,24 +326,24 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
final dataSet = dataDetails();
|
final dataSet = dataDetails();
|
||||||
|
|
||||||
// check RC file
|
// check RC file
|
||||||
if ((docUploadedRCFile == null ||
|
// if ((docUploadedRCFile == null ||
|
||||||
(docUploadedRCFile?.bytes == null &&
|
// (docUploadedRCFile?.bytes == null &&
|
||||||
docUploadedRCFile?.path == null)) &&
|
// docUploadedRCFile?.path == null)) &&
|
||||||
(rcFileUrlFromApi == null || rcFileUrlFromApi!.isEmpty)) {
|
// (rcFileUrlFromApi == null || rcFileUrlFromApi!.isEmpty)) {
|
||||||
setState(() => isSaving = false); // reset button
|
// setState(() => isSaving = false); // reset button
|
||||||
ToastHelper.showErrorToast(context, "Please upload RC Document");
|
// ToastHelper.showErrorToast(context, "Please upload RC Document");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// check ID proof
|
// // check ID proof
|
||||||
if ((docUploadedIDProof == null ||
|
// if ((docUploadedIDProof == null ||
|
||||||
(docUploadedIDProof?.bytes == null &&
|
// (docUploadedIDProof?.bytes == null &&
|
||||||
docUploadedIDProof?.path == null)) &&
|
// docUploadedIDProof?.path == null)) &&
|
||||||
(idProofFileUrlFromApi == null || idProofFileUrlFromApi!.isEmpty)) {
|
// (idProofFileUrlFromApi == null || idProofFileUrlFromApi!.isEmpty)) {
|
||||||
setState(() => isSaving = false); // reset button
|
// setState(() => isSaving = false); // reset button
|
||||||
ToastHelper.showErrorToast(context, "Please upload ID Proof");
|
// ToastHelper.showErrorToast(context, "Please upload ID Proof");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await createUserData(dataSet); // API call
|
await createUserData(dataSet); // API call
|
||||||
@ -358,7 +358,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
child: const Text('OK'),
|
child: const Text('OK'),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -1032,7 +1032,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
|
|
||||||
Widget buildUploadRCDocument(BuildContext context) {
|
Widget buildUploadRCDocument(BuildContext context) {
|
||||||
return buildResponsiveUploadField(
|
return buildResponsiveUploadField(
|
||||||
label: "Upload RC Document *",
|
label: "Upload RC Document ",
|
||||||
hintText: selectedRCFile,
|
hintText: selectedRCFile,
|
||||||
onFileSelected: (fileName, file) {
|
onFileSelected: (fileName, file) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -1063,7 +1063,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
|
|
||||||
Widget buildUploadIDDocument(BuildContext context) {
|
Widget buildUploadIDDocument(BuildContext context) {
|
||||||
return buildResponsiveUploadField(
|
return buildResponsiveUploadField(
|
||||||
label: "Upload ID Proof *",
|
label: "Upload ID Proof",
|
||||||
hintText: selectedIdProof,
|
hintText: selectedIdProof,
|
||||||
onFileSelected: (fileName, file) {
|
onFileSelected: (fileName, file) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@ -29,6 +29,9 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
int currentPage = 1;
|
int currentPage = 1;
|
||||||
int itemsPerPage = 10;
|
int itemsPerPage = 10;
|
||||||
late ApiService apiService;
|
late ApiService apiService;
|
||||||
|
dynamic roleId;
|
||||||
|
dynamic userId;
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
// List<Map<String, dynamic>> dataVal = [];
|
// List<Map<String, dynamic>> dataVal = [];
|
||||||
List<Map<String, dynamic>> getStaffData = [];
|
List<Map<String, dynamic>> getStaffData = [];
|
||||||
@ -50,8 +53,8 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
|
|
||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
roleId = ref.read(userRoleProvider);
|
||||||
final userId = ref.read(userIdProvider);
|
userId = ref.read(userIdProvider);
|
||||||
|
|
||||||
print("A56 => r : $roleId | mId: $id | uId: $userId ");
|
print("A56 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
|
|
||||||
@ -60,40 +63,120 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
// Agent - venba2026@gmail.com - T E S T A - 5 evarkku 8th id is manager
|
// Agent - venba2026@gmail.com - T E S T A - 5 evarkku 8th id is manager
|
||||||
// so here i used userId
|
// so here i used userId
|
||||||
|
|
||||||
if (userId != null) { getStaffList(userId, roleId); }
|
if (userId != null) {
|
||||||
|
getStaffList(userId, roleId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void filterDateRange() {}
|
void filterDateRange() {
|
||||||
void refrshfilterDateRange() {}
|
print("filterDateRange");
|
||||||
|
// if (!_formKey.currentState!.validate()) return;
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
// final fromDate = controllers['startDate']?.text ?? '';
|
||||||
|
// final toDate = controllers['endDate']?.text ?? '';
|
||||||
|
print("filterDateRange1");
|
||||||
|
// Call with selected dates
|
||||||
|
getStaffList(userId, roleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void refrshfilterDateRange() {
|
||||||
|
setState(() {
|
||||||
|
controllers['startDate']!.clear();
|
||||||
|
controllers['endDate']!.clear();
|
||||||
|
|
||||||
|
controllers['startDate']?.text = '';
|
||||||
|
controllers['endDate']?.text = '';
|
||||||
|
});
|
||||||
|
getStaffList(userId, roleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future<void> getStaffList(int managerId, role) async {
|
||||||
|
// print('A72 => Fns called => $managerId | $role');
|
||||||
|
// setState(() {
|
||||||
|
// isLoading = true;
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// final response = await apiService.fetchEnquiryList(managerId, role);
|
||||||
|
//
|
||||||
|
// if (response['status'] == 'success') {
|
||||||
|
// final data = response['data'];
|
||||||
|
// final fromDate = response['from_date'] ?? '';
|
||||||
|
// final toDate = response['to_date'] ?? '';
|
||||||
|
// print('FromDAte : $fromDate');
|
||||||
|
// print('ToDAte : $toDate');
|
||||||
|
//
|
||||||
|
// print('A82 => getStaffListData => ${response['data']}');
|
||||||
|
// setState(() {
|
||||||
|
// controllers['startDate']?.text = fromDate;
|
||||||
|
// controllers['endDate']?.text = toDate;
|
||||||
|
// if (data is List) {
|
||||||
|
// // Already a list of maps
|
||||||
|
// getStaffData = List<Map<String, dynamic>>.from(data);
|
||||||
|
// } else if (data is Map) {
|
||||||
|
// // Single object, wrap in a list
|
||||||
|
// getStaffData = [Map<String, dynamic>.from(data)];
|
||||||
|
// } else {
|
||||||
|
// getStaffData = [];
|
||||||
|
// }
|
||||||
|
// // getStaffData = List<Map<String, dynamic>>.from(response['data']);
|
||||||
|
// originalData = getStaffData;
|
||||||
|
// filteredData = List.from(originalData);
|
||||||
|
// // print('originalData - $getClaimPolicies');
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// getStaffData = [];
|
||||||
|
// originalData = [];
|
||||||
|
// }
|
||||||
|
// } catch (e) {
|
||||||
|
// print('Exception occurred: $e');
|
||||||
|
// } finally {
|
||||||
|
// setState(() {
|
||||||
|
// isLoading = false;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
Future<void> getStaffList(
|
||||||
|
int managerId,
|
||||||
|
role, {
|
||||||
|
String fromDate = '',
|
||||||
|
String toDate = '',
|
||||||
|
}) async {
|
||||||
print('A72 => Fns called => $managerId | $role');
|
print('A72 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final response = await apiService.fetchEnquiryList(managerId, role);
|
final response = await apiService.fetchEnquiryList(
|
||||||
|
managerId,
|
||||||
|
role,
|
||||||
|
fromDate: controllers['startDate']?.text ?? '',
|
||||||
|
toDate: controllers['endDate']?.text ?? '',
|
||||||
|
);
|
||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('A82 => getStaffListData => ${response['data']}');
|
final fromDate = response['from_date'] ?? '';
|
||||||
|
final toDate = response['to_date'] ?? '';
|
||||||
|
|
||||||
|
print('FromDate : $fromDate');
|
||||||
|
print('ToDate : $toDate');
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
|
controllers['startDate']?.text = fromDate;
|
||||||
|
controllers['endDate']?.text = toDate;
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
// Already a list of maps
|
|
||||||
getStaffData = List<Map<String, dynamic>>.from(data);
|
getStaffData = List<Map<String, dynamic>>.from(data);
|
||||||
} else if (data is Map) {
|
} else if (data is Map) {
|
||||||
// Single object, wrap in a list
|
|
||||||
getStaffData = [Map<String, dynamic>.from(data)];
|
getStaffData = [Map<String, dynamic>.from(data)];
|
||||||
} else {
|
} else {
|
||||||
getStaffData = [];
|
getStaffData = [];
|
||||||
}
|
}
|
||||||
// getStaffData = List<Map<String, dynamic>>.from(response['data']);
|
|
||||||
originalData = getStaffData;
|
originalData = getStaffData;
|
||||||
filteredData = List.from(originalData);
|
filteredData = List.from(originalData);
|
||||||
// print('originalData - $getClaimPolicies');
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
getStaffData = [];
|
getStaffData = [];
|
||||||
@ -180,7 +263,9 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
(item['status'] ?? '-').toLowerCase().contains(
|
(item['status'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['remarks'] ?? '-').toLowerCase().contains(query.toLowerCase());
|
(item['remarks'] ?? '-').toLowerCase().contains(
|
||||||
|
query.toLowerCase(),
|
||||||
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -274,6 +359,50 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
padding: EdgeInsets.all(8.0),
|
padding: EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
if (ResponsiveLayout.isMobile(context)) ...[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
color: Color(0xffD9EBE8),
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
buildStartDate(context),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
buildEndDate(context),
|
||||||
|
// SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: filterDateRange,
|
||||||
|
child: Icon(
|
||||||
|
Icons.filter_list_outlined,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: refrshfilterDateRange,
|
||||||
|
child: Icon(Icons.refresh, size: 18),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
// height: 40,
|
// height: 40,
|
||||||
// color: Colors.pink,
|
// color: Colors.pink,
|
||||||
@ -281,26 +410,29 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// buildStartDate(context),
|
if (!ResponsiveLayout.isMobile(context)) ...[
|
||||||
// SizedBox(width: 10),
|
buildStartDate(context),
|
||||||
// buildEndDate(context),
|
SizedBox(width: 10),
|
||||||
// SizedBox(width: 10),
|
buildEndDate(context),
|
||||||
//
|
SizedBox(width: 10),
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
Padding(
|
||||||
// child: GestureDetector(
|
padding: const EdgeInsets.all(8.0),
|
||||||
// onTap: filterDateRange,
|
child: GestureDetector(
|
||||||
// child: Icon(Icons.filter_list_outlined),
|
onTap: filterDateRange,
|
||||||
// ),
|
child: Icon(Icons.filter_list_outlined),
|
||||||
// ),
|
),
|
||||||
//
|
),
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
Padding(
|
||||||
// child: GestureDetector(
|
padding: const EdgeInsets.all(8.0),
|
||||||
// onTap: refrshfilterDateRange,
|
child: GestureDetector(
|
||||||
// child: Icon(Icons.refresh),
|
onTap: refrshfilterDateRange,
|
||||||
// ),
|
child: Icon(Icons.refresh),
|
||||||
// ),
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
],
|
||||||
ThemedSearchField(
|
ThemedSearchField(
|
||||||
hintText: 'Search',
|
hintText: 'Search',
|
||||||
backgroundColor: Color(0xFFF6F8F8),
|
backgroundColor: Color(0xFFF6F8F8),
|
||||||
@ -311,8 +443,6 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
: MediaQuery.of(context).size.width * 0.2,
|
: MediaQuery.of(context).size.width * 0.2,
|
||||||
),
|
),
|
||||||
|
|
||||||
Spacer(),
|
|
||||||
|
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
|
|
||||||
ExportBtn(
|
ExportBtn(
|
||||||
@ -411,17 +541,11 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text('Created Date', style: _headerStyle),
|
||||||
'Created Date',
|
|
||||||
style: _headerStyle,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text('Updated Date', style: _headerStyle),
|
||||||
'Updated Date',
|
|
||||||
style: _headerStyle,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@ -795,7 +919,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
txtwidth: ResponsiveLayout.isMobile(context)
|
txtwidth: ResponsiveLayout.isMobile(context)
|
||||||
? null
|
? null
|
||||||
: MediaQuery.of(context).size.width * 0.16,
|
: MediaQuery.of(context).size.width * 0.16,
|
||||||
txtheight: 50,
|
// txtheight: 50,
|
||||||
// backgroundColor: const Color(0xFFECECEC),
|
// backgroundColor: const Color(0xFFECECEC),
|
||||||
// validator: (value) => Validators.requiredField(value, "date"),
|
// validator: (value) => Validators.requiredField(value, "date"),
|
||||||
controller: controllers['startDate']!,
|
controller: controllers['startDate']!,
|
||||||
@ -823,7 +947,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
txtwidth: ResponsiveLayout.isMobile(context)
|
txtwidth: ResponsiveLayout.isMobile(context)
|
||||||
? null
|
? null
|
||||||
: MediaQuery.of(context).size.width * 0.16,
|
: MediaQuery.of(context).size.width * 0.16,
|
||||||
txtheight: 50,
|
// txtheight: 50,
|
||||||
// backgroundColor: const Color(0xFFECECEC),
|
// backgroundColor: const Color(0xFFECECEC),
|
||||||
// validator: (value) => Validators.requiredField(value, "date"),
|
// validator: (value) => Validators.requiredField(value, "date"),
|
||||||
controller: controllers['endDate']!,
|
controller: controllers['endDate']!,
|
||||||
|
|||||||
@ -45,8 +45,9 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
final userId = ref.read(userIdProvider);
|
final userId = ref.read(userIdProvider);
|
||||||
print("G47 => r : $roleId | mId: $id | uId: $userId ");
|
print("G47 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
if (userId != null) { getStaffList(userId, roleId); }
|
if (userId != null) {
|
||||||
|
getStaffList(userId, roleId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +249,7 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
"policy_end_date",
|
"policy_end_date",
|
||||||
"claim_number",
|
"claim_number",
|
||||||
"claim_type_value",
|
"claim_type_value",
|
||||||
|
'claim_status_value',
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -336,10 +338,10 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text('Claim No.', style: _headerStyle),
|
child: Text('Claim No.', style: _headerStyle),
|
||||||
),
|
),
|
||||||
// Expanded(
|
Expanded(
|
||||||
// flex: 1,
|
flex: 2,
|
||||||
// child: Text('Action', style: _headerStyle),
|
child: Text('Status', style: _headerStyle),
|
||||||
// ),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -470,6 +472,13 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
style: _dataBold,
|
style: _dataBold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
item['claim_status_value'] ?? '-', // fallback
|
||||||
|
style: _dataBold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// flex: 1,
|
// flex: 1,
|
||||||
@ -528,6 +537,7 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
item['reg_no'] != null ? _formatDate(item['reg_no']) : '-',
|
item['reg_no'] != null ? _formatDate(item['reg_no']) : '-',
|
||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
|
|
||||||
// PopupMenuButton<int>(
|
// PopupMenuButton<int>(
|
||||||
// color: Colors.white,
|
// color: Colors.white,
|
||||||
// padding: EdgeInsets.zero,
|
// padding: EdgeInsets.zero,
|
||||||
@ -627,6 +637,27 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
|
||||||
|
// Created On + Remarks
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
//date and time
|
||||||
|
Text("Status", style: _cardheaderStyle),
|
||||||
|
Text(
|
||||||
|
item['claim_status_value'] ?? '-',
|
||||||
|
style: _cardBodyStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -156,8 +156,9 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
) ||
|
) ||
|
||||||
(item['policy_number'] ?? '-').toLowerCase().contains(
|
(item['policy_number'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
)
|
||||||
(item['status'] ?? '-').toLowerCase().contains(query.toLowerCase());
|
// ||
|
||||||
|
// (item['status'] ?? '-').toLowerCase().contains(query.toLowerCase());
|
||||||
;
|
;
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
@ -378,7 +379,6 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
"payment_mode",
|
"payment_mode",
|
||||||
"updated_on",
|
"updated_on",
|
||||||
"policy_number",
|
"policy_number",
|
||||||
"status",
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -473,10 +473,6 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
child: Text('Policy Number', style: _headerStyle),
|
child: Text('Policy Number', style: _headerStyle),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
|
||||||
child: Text('Status', style: _headerStyle),
|
|
||||||
),
|
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// flex: 1,
|
// flex: 1,
|
||||||
// child: Text('Action', style: _headerStyle),
|
// child: Text('Action', style: _headerStyle),
|
||||||
@ -637,50 +633,6 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
|
||||||
child: Text(item['status'] ?? '-', style: _dataBold),
|
|
||||||
),
|
|
||||||
|
|
||||||
// Expanded(
|
|
||||||
// flex: 1,
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// PopupMenuButton<int>(
|
|
||||||
// color: Colors.white,
|
|
||||||
// padding: EdgeInsets.zero,
|
|
||||||
// offset: Offset(0, 30),
|
|
||||||
// icon: Icon(
|
|
||||||
// Icons.more_vert,
|
|
||||||
// color: Color(0xFF475569),
|
|
||||||
// size: 14,
|
|
||||||
// ),
|
|
||||||
// itemBuilder: (context) => [
|
|
||||||
// CustomPopupMenuEntry(
|
|
||||||
// child: Container(
|
|
||||||
// padding: EdgeInsets.symmetric(
|
|
||||||
// horizontal: 8,
|
|
||||||
// vertical: 8,
|
|
||||||
// ),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: _buildPopupMenuActions(
|
|
||||||
// context,
|
|
||||||
// item,
|
|
||||||
// item['id'],
|
|
||||||
// item['reg_no'],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -741,16 +693,16 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
// const SizedBox(width: 5),
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
Text("Status", style: _cardheaderStyle),
|
// Text("Status", style: _cardheaderStyle),
|
||||||
Text(item['status'] ?? '-', style: _cardBodyStyle),
|
// Text(item['status'] ?? '-', style: _cardBodyStyle),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
|
|||||||
@ -268,12 +268,14 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
|
|||||||
DrawerLabel("User"),
|
DrawerLabel("User"),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
if (roleId != 'staff') ...[
|
||||||
Builder(
|
Builder(
|
||||||
builder: (itemContext) {
|
builder: (itemContext) {
|
||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
// onEnter: (_) => _showPopup(itemContext),
|
// onEnter: (_) => _showPopup(itemContext),
|
||||||
onEnter: (_) {
|
onEnter: (_) {
|
||||||
final renderBox = itemContext.findRenderObject() as RenderBox;
|
final renderBox =
|
||||||
|
itemContext.findRenderObject() as RenderBox;
|
||||||
final offset = renderBox.localToGlobal(Offset.zero);
|
final offset = renderBox.localToGlobal(Offset.zero);
|
||||||
final size = renderBox.size;
|
final size = renderBox.size;
|
||||||
final key = "Reports";
|
final key = "Reports";
|
||||||
@ -292,6 +294,7 @@ class DrawerMenuState extends ConsumerState<DrawerMenu> {
|
|||||||
),
|
),
|
||||||
DrawerLabel("Reports"),
|
DrawerLabel("Reports"),
|
||||||
],
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user