This commit is contained in:
sanjeev.p 2026-04-18 17:36:06 +05:30
parent 3aad3c0538
commit 061b02a1c4
3 changed files with 47 additions and 47 deletions

View File

@ -928,27 +928,10 @@ class endosementState extends ConsumerState<Endorsement> {
// }
return MouseRegion(
cursor: SystemMouseCursors.click,
// onEnter: (_) {
// setState(() {
// hoveredRowId = id;
// });
// },
// onExit: (_) {
// setState(() {
// hoveredRowId = null;
// });
// },
child: GestureDetector(
onTap: () async {
setState(() {
selectedRow = item;
// isDrawerOpen = true;
});
await loadEndorsementNumbers(item['id']);
},
child: AnimatedContainer(
cursor: SystemMouseCursors.basic,
// Row-level tap gesture blocks SelectionArea text selection on web.
// Keep this container non-gesture so users can select/copy text.
child: AnimatedContainer(
duration: const Duration(milliseconds: 150),
padding: const EdgeInsets.symmetric(
vertical: 10, horizontal: 16),
@ -1184,7 +1167,6 @@ class endosementState extends ConsumerState<Endorsement> {
],
),
),
),
);
}

View File

@ -211,10 +211,17 @@ class _PayOutDetailsViewState extends ConsumerState<PayOutDetailsView> {
Color? color,
FontWeight? fontWeight,
}) {
final displayValue = (value == null ||
value.trim().isEmpty ||
value.toLowerCase() == 'undefined' ||
value.toLowerCase() == 'null')
? '-'
: value;
return Expanded(
flex: flex,
child: Text(
value ?? '-',
displayValue,
textAlign: align,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -336,7 +343,9 @@ class _PayOutDetailsViewState extends ConsumerState<PayOutDetailsView> {
height: MediaQuery.of(context).size.height * 0.7,
child: const Center(child: CircularProgressIndicator()),
)
: Container(
: SelectionArea(
child:
Container(
color: Colors.white,
padding: const EdgeInsets.all(8),
// margin: EdgeInsets.symmetric(
@ -570,6 +579,7 @@ class _PayOutDetailsViewState extends ConsumerState<PayOutDetailsView> {
],
),
),
),
);
}
}

View File

@ -182,6 +182,7 @@ class policylistState extends ConsumerState<policylist> {
// getStaffData = List<Map<String, dynamic>>.from(response['data']);
originalData = getStaffData;
filteredData = List.from(originalData);
_applySearchFilter(_searchStaffController.text);
// print('originalData - $getClaimPolicies');
});
} else {
@ -241,7 +242,6 @@ class policylistState extends ConsumerState<policylist> {
// getStaffList(managerId, userId, roleId);
// print("D61 => r : $roleId | mId: $id | uId: $userId");
_resetSearchField();
if (userId != null && managerId != null) {
print('filterDateRange 1s');
print('manager - $managerId - userID -$userId - roledId -$roleId');
@ -273,8 +273,19 @@ class policylistState extends ConsumerState<policylist> {
void filterData(String query) {
print("FilterDAta - $query");
_applySearchFilter(query);
}
final lowerQuery = query.toLowerCase();
void _applySearchFilter(String query) {
final lowerQuery = query.trim().toLowerCase();
if (lowerQuery.isEmpty) {
setState(() {
filteredData = List.from(getStaffData);
currentPage = 1;
});
return;
}
setState(() {
filteredData = getStaffData.where((item) {
@ -283,33 +294,30 @@ class policylistState extends ConsumerState<policylist> {
? 'Verified'
: 'Click to Verify';
return (item['agent_name'] ?? '-').toLowerCase().contains(lowerQuery) ||
(item['agent_code'] ?? '-').toLowerCase().contains(lowerQuery) ||
(item['reg_no'] ?? '-').toLowerCase().contains(lowerQuery) ||
(item['insurer_name'] ?? '-').toLowerCase().contains(lowerQuery) ||
(item['insurer_short_name'] ?? '-').toLowerCase().contains(
lowerQuery,
) ||
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
lowerQuery,
) ||
(item['insured_name'] ?? '-').toLowerCase().contains(lowerQuery) ||
(item['premium_amount'] ?? '-').toLowerCase().contains(
lowerQuery,
) ||
(item['payment_mode_value'] ?? '-').toLowerCase().contains(
lowerQuery,
) ||
(_formatDate(item['updated_on']) ?? '-').toLowerCase().contains(
lowerQuery,
) ||
(item['policy_number'] ?? '-').toLowerCase().contains(lowerQuery) ||
return _matchesQuery(item['agent_name'], lowerQuery) ||
_matchesQuery(item['agent_code'], lowerQuery) ||
_matchesQuery(item['reg_no'], lowerQuery) ||
_matchesQuery(item['insurer_name'], lowerQuery) ||
_matchesQuery(item['insurer_short_name'], lowerQuery) ||
_matchesQuery(item['assigned_to_name'], lowerQuery) ||
_matchesQuery(item['insured_name'], lowerQuery) ||
_matchesQuery(item['premium_amount'], lowerQuery) ||
_matchesQuery(item['payment_mode_value'], lowerQuery) ||
_matchesQuery(item['payment_mode'], lowerQuery) ||
_matchesQuery(_formatDate((item['updated_on'] ?? '').toString()), lowerQuery) ||
_matchesQuery(item['policy_number'], lowerQuery) ||
// NEW CONDITIONS for search
accuracyText.toLowerCase().contains(lowerQuery);
}).toList();
currentPage = 1;
});
}
bool _matchesQuery(dynamic value, String query) {
if (value == null) return false;
return value.toString().toLowerCase().contains(query);
}
final TextEditingController _searchStaffController = TextEditingController();
void _resetSearchField() {