FIX_bug
This commit is contained in:
parent
3aad3c0538
commit
061b02a1c4
@ -928,26 +928,9 @@ class endosementState extends ConsumerState<Endorsement> {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.basic,
|
||||||
// onEnter: (_) {
|
// Row-level tap gesture blocks SelectionArea text selection on web.
|
||||||
// setState(() {
|
// Keep this container non-gesture so users can select/copy text.
|
||||||
// hoveredRowId = id;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// onExit: (_) {
|
|
||||||
// setState(() {
|
|
||||||
// hoveredRowId = null;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
setState(() {
|
|
||||||
selectedRow = item;
|
|
||||||
// isDrawerOpen = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
await loadEndorsementNumbers(item['id']);
|
|
||||||
},
|
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@ -1184,7 +1167,6 @@ class endosementState extends ConsumerState<Endorsement> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -211,10 +211,17 @@ class _PayOutDetailsViewState extends ConsumerState<PayOutDetailsView> {
|
|||||||
Color? color,
|
Color? color,
|
||||||
FontWeight? fontWeight,
|
FontWeight? fontWeight,
|
||||||
}) {
|
}) {
|
||||||
|
final displayValue = (value == null ||
|
||||||
|
value.trim().isEmpty ||
|
||||||
|
value.toLowerCase() == 'undefined' ||
|
||||||
|
value.toLowerCase() == 'null')
|
||||||
|
? '-'
|
||||||
|
: value;
|
||||||
|
|
||||||
return Expanded(
|
return Expanded(
|
||||||
flex: flex,
|
flex: flex,
|
||||||
child: Text(
|
child: Text(
|
||||||
value ?? '-',
|
displayValue,
|
||||||
textAlign: align,
|
textAlign: align,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -336,7 +343,9 @@ class _PayOutDetailsViewState extends ConsumerState<PayOutDetailsView> {
|
|||||||
height: MediaQuery.of(context).size.height * 0.7,
|
height: MediaQuery.of(context).size.height * 0.7,
|
||||||
child: const Center(child: CircularProgressIndicator()),
|
child: const Center(child: CircularProgressIndicator()),
|
||||||
)
|
)
|
||||||
: Container(
|
: SelectionArea(
|
||||||
|
child:
|
||||||
|
Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
// margin: EdgeInsets.symmetric(
|
// margin: EdgeInsets.symmetric(
|
||||||
@ -570,6 +579,7 @@ class _PayOutDetailsViewState extends ConsumerState<PayOutDetailsView> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,6 +182,7 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
// getStaffData = List<Map<String, dynamic>>.from(response['data']);
|
// getStaffData = List<Map<String, dynamic>>.from(response['data']);
|
||||||
originalData = getStaffData;
|
originalData = getStaffData;
|
||||||
filteredData = List.from(originalData);
|
filteredData = List.from(originalData);
|
||||||
|
_applySearchFilter(_searchStaffController.text);
|
||||||
// print('originalData - $getClaimPolicies');
|
// print('originalData - $getClaimPolicies');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -241,7 +242,6 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
// getStaffList(managerId, userId, roleId);
|
// getStaffList(managerId, userId, roleId);
|
||||||
|
|
||||||
// print("D61 => r : $roleId | mId: $id | uId: $userId");
|
// print("D61 => r : $roleId | mId: $id | uId: $userId");
|
||||||
_resetSearchField();
|
|
||||||
if (userId != null && managerId != null) {
|
if (userId != null && managerId != null) {
|
||||||
print('filterDateRange 1s');
|
print('filterDateRange 1s');
|
||||||
print('manager - $managerId - userID -$userId - roledId -$roleId');
|
print('manager - $managerId - userID -$userId - roledId -$roleId');
|
||||||
@ -273,8 +273,19 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
|
|
||||||
void filterData(String query) {
|
void filterData(String query) {
|
||||||
print("FilterDAta - $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(() {
|
setState(() {
|
||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
@ -283,33 +294,30 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
? 'Verified'
|
? 'Verified'
|
||||||
: 'Click to Verify';
|
: 'Click to Verify';
|
||||||
|
|
||||||
return (item['agent_name'] ?? '-').toLowerCase().contains(lowerQuery) ||
|
return _matchesQuery(item['agent_name'], lowerQuery) ||
|
||||||
(item['agent_code'] ?? '-').toLowerCase().contains(lowerQuery) ||
|
_matchesQuery(item['agent_code'], lowerQuery) ||
|
||||||
(item['reg_no'] ?? '-').toLowerCase().contains(lowerQuery) ||
|
_matchesQuery(item['reg_no'], lowerQuery) ||
|
||||||
(item['insurer_name'] ?? '-').toLowerCase().contains(lowerQuery) ||
|
_matchesQuery(item['insurer_name'], lowerQuery) ||
|
||||||
(item['insurer_short_name'] ?? '-').toLowerCase().contains(
|
_matchesQuery(item['insurer_short_name'], lowerQuery) ||
|
||||||
lowerQuery,
|
_matchesQuery(item['assigned_to_name'], lowerQuery) ||
|
||||||
) ||
|
_matchesQuery(item['insured_name'], lowerQuery) ||
|
||||||
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
|
_matchesQuery(item['premium_amount'], lowerQuery) ||
|
||||||
lowerQuery,
|
_matchesQuery(item['payment_mode_value'], lowerQuery) ||
|
||||||
) ||
|
_matchesQuery(item['payment_mode'], lowerQuery) ||
|
||||||
(item['insured_name'] ?? '-').toLowerCase().contains(lowerQuery) ||
|
_matchesQuery(_formatDate((item['updated_on'] ?? '').toString()), lowerQuery) ||
|
||||||
(item['premium_amount'] ?? '-').toLowerCase().contains(
|
_matchesQuery(item['policy_number'], lowerQuery) ||
|
||||||
lowerQuery,
|
|
||||||
) ||
|
|
||||||
(item['payment_mode_value'] ?? '-').toLowerCase().contains(
|
|
||||||
lowerQuery,
|
|
||||||
) ||
|
|
||||||
(_formatDate(item['updated_on']) ?? '-').toLowerCase().contains(
|
|
||||||
lowerQuery,
|
|
||||||
) ||
|
|
||||||
(item['policy_number'] ?? '-').toLowerCase().contains(lowerQuery) ||
|
|
||||||
// ⭐ NEW CONDITIONS for search
|
// ⭐ NEW CONDITIONS for search
|
||||||
accuracyText.toLowerCase().contains(lowerQuery);
|
accuracyText.toLowerCase().contains(lowerQuery);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
currentPage = 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _matchesQuery(dynamic value, String query) {
|
||||||
|
if (value == null) return false;
|
||||||
|
return value.toString().toLowerCase().contains(query);
|
||||||
|
}
|
||||||
|
|
||||||
final TextEditingController _searchStaffController = TextEditingController();
|
final TextEditingController _searchStaffController = TextEditingController();
|
||||||
|
|
||||||
void _resetSearchField() {
|
void _resetSearchField() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user