search fixes

main_production_upgrade_ios
WaseemAbbasi22 1 day ago
parent 01a35adebc
commit aab2a557c8

@ -3,13 +3,13 @@ class URLs {
static const String appReleaseBuildNumber = "36"; static const String appReleaseBuildNumber = "36";
static const host1 = "https://atomsm.hmg.com"; // production url // static const host1 = "https://atomsm.hmg.com"; // production url
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url // static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
// static const host1 = "https://atomsmuat.hmg.com"; // local UAT url static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
// static final String _baseUrl = "$_host/mobile"; // host local UAT static final String _baseUrl = "$_host/mobile"; // host local UAT
// static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis // static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM // static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM
// static final String _baseUrl = "$_host/v4/mobile"; // v4 for Demo module // static final String _baseUrl = "$_host/v4/mobile"; // v4 for Demo module
// static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation // static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation
// static final String _baseUrl = "$_host/v6/mobile"; // for asset delivery module // static final String _baseUrl = "$_host/v6/mobile"; // for asset delivery module

@ -173,7 +173,8 @@ class AllRequestsProvider extends ChangeNotifier {
// loan module // loan module
if (context.settingProvider.isUserFlowMedical && !context.userProvider.isNurse) { if (context.settingProvider.isUserFlowMedical && !context.userProvider.isNurse) {
list = [16]; // list = [16];
list.add(16);
} }
return list; return list;

@ -28,13 +28,51 @@ class SearchAllRequestsModel {
this.isArchived = false, this.isArchived = false,
}); });
void resetSearchValues() { //older function
// void resetSearchValues() {
// requestNumber?.controller?.text = "";
// assetName?.controller?.text = "";
// assetNo?.controller?.text = "";
// manufacture?.controller?.text = "";
// sn?.controller?.text = "";
// model?.controller?.text = "";
// isArchived = false;
// }
void resetSearchValuesAndController({String? except}) {
final field = except?.toLowerCase();
debugPrint("selected tag is $field");
if (field != 'requestnumber') {
requestNumber?.controller?.text = ""; requestNumber?.controller?.text = "";
requestNumber?.value = null;
}
if (field != 'assetname') {
assetName?.controller?.text = ""; assetName?.controller?.text = "";
assetName?.value = null;
}
if (field != 'assetno') {
assetNo?.controller?.text = ""; assetNo?.controller?.text = "";
assetNo?.value = null;
}
if (field != 'manufacture') {
manufacture?.controller?.text = ""; manufacture?.controller?.text = "";
manufacture?.value = null;
}
if (field != 'sn') {
sn?.controller?.text = ""; sn?.controller?.text = "";
sn?.value = null;
}
if (field != 'model') {
model?.controller?.text = ""; model?.controller?.text = "";
model?.value = null;
}
isArchived = false; isArchived = false;
} }
} }

@ -79,7 +79,8 @@ class _AllRequestsSearchPageState extends State<AllRequestsSearchPage> {
style: AppTextStyles.bodyText2.copyWith(color: const Color(0xFF4A8DB7)), style: AppTextStyles.bodyText2.copyWith(color: const Color(0xFF4A8DB7)),
).paddingAll(8).onPress(() { ).paddingAll(8).onPress(() {
setState(() { setState(() {
search!.resetSearchValues(); // search!.resetSearchValues();
search?.resetSearchValuesAndController(except: null);
}); });
}), }),
], ],
@ -103,7 +104,9 @@ class _AllRequestsSearchPageState extends State<AllRequestsSearchPage> {
onSelect: (value) { onSelect: (value) {
if (search!.searchBySelectedValue != value) { if (search!.searchBySelectedValue != value) {
search!.searchBySelectedValue = value; search!.searchBySelectedValue = value;
search!.resetSearchValues(); // search!.resetSearchValues();
search?.resetSearchValuesAndController(except: value.label);
setState(() {}); setState(() {});
} }
}, },

Loading…
Cancel
Save