This commit is contained in:
sanjeev.p 2026-04-15 17:59:19 +05:30
parent 108dba5dae
commit eb9590b808
4 changed files with 31 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ class Env {
);
static const String apiUrl = String.fromEnvironment(
'API_URL',
//defaultValue: 'https://partner.nhanceindia.in/partner_api/api/', /* Live build (enable index.html line 18) */
// defaultValue: 'https://partner.nhanceindia.in/partner_api/api/', /* Live build (enable index.html line 18) */
defaultValue: 'https://venbait.in/nhance/partner/dev/api/', /* Test build (enable index.html line 19) */
// defaultValue: 'http://localhost/nhance_partner_be/', /* localhost build (enable index.html line 19) */
);

View File

@ -241,6 +241,7 @@ 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');
@ -256,12 +257,14 @@ class policylistState extends ConsumerState<policylist> {
SelectedPartnerId = null;
selectedPartnerAgentCode = '';
selectedStaffAgentCode = '';
_searchStaffController.clear();
controllers['startDate']!.clear();
controllers['endDate']!.clear();
SelectedStatus = (roleId == 'Accounts') ? 'Not Verified' : 'All'; //
SelectedInsurer = '';
controllers['startDate']?.text = '';
controllers['endDate']?.text = '';
filteredData = List.from(getStaffData);
// Reset the FormField validation
_formKey.currentState?.reset();
});
@ -309,6 +312,17 @@ class policylistState extends ConsumerState<policylist> {
final TextEditingController _searchStaffController = TextEditingController();
void _resetSearchField() {
if (_searchStaffController.text.isEmpty) {
return;
}
setState(() {
_searchStaffController.clear();
filteredData = List.from(getStaffData);
currentPage = 1;
});
}
String _formatDate(String rawDate) {
try {
final dateTime = DateTime.parse(rawDate);
@ -478,7 +492,10 @@ class policylistState extends ConsumerState<policylist> {
id: userId,
onFilterStaff: (val) {
print('Selected Filterd STAFF Id - $val');
SelectedStaffId = val;
setState(() {
SelectedStaffId = val;
});
_resetSearchField();
},
onStaffAgentCodeChanged: (code) {
setState(() {
@ -490,6 +507,7 @@ class policylistState extends ConsumerState<policylist> {
setState(() {
SelectedPartnerId = id;
});
_resetSearchField();
},
onPartnerAgentCodeChanged: (code) {
setState(() {
@ -505,11 +523,13 @@ class policylistState extends ConsumerState<policylist> {
setState(() {
SelectedStatus = val; // update parent
});
_resetSearchField();
},
onInsurerChanged: (val) {
setState(() {
SelectedInsurer = val; // update parent
});
_resetSearchField();
},
formKey: _formKey,
isMobile: ResponsiveLayout.isMobile(context),
@ -539,7 +559,10 @@ class policylistState extends ConsumerState<policylist> {
id: userId,
onFilterStaff: (val) {
print('Selected Filterd STAFF Id - $val');
SelectedStaffId = val;
setState(() {
SelectedStaffId = val;
});
_resetSearchField();
},
onStaffAgentCodeChanged: (code) {
setState(() {
@ -551,6 +574,7 @@ class policylistState extends ConsumerState<policylist> {
setState(() {
SelectedPartnerId = id;
});
_resetSearchField();
},
onPartnerAgentCodeChanged: (code) {
setState(() {
@ -566,11 +590,13 @@ class policylistState extends ConsumerState<policylist> {
setState(() {
SelectedStatus = val; // update parent
});
_resetSearchField();
},
onInsurerChanged: (val) {
setState(() {
SelectedInsurer = val; // update parent
});
_resetSearchField();
},
formKey: _formKey,
isMobile: ResponsiveLayout.isMobile(context),

View File

@ -484,6 +484,7 @@ class _CompactDateRangeDialogState extends State<_CompactDateRangeDialog> {
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
icon: const Icon(Icons.close, size: 22),