Feedback Status fixes

merge-requests/447/head
haroon amjad 4 years ago
parent 59dac89118
commit 1858be18b7

@ -83,9 +83,24 @@ class FeedbackService extends BaseService {
Future searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async {
hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = idNumber;
if (type == 1) {
body['IdentificationNo'] = 0;
body['PatientID'] = num.tryParse(idNumber);
body['ItemID'] = 0;
} else if (type == 2) {
body['IdentificationNo'] = idNumber;
body['PatientID'] = 0;
body['ItemID'] = 0;
} else {
body['IdentificationNo'] = 0;
body['PatientID'] = 0;
body['ItemID'] = idNumber;
}
body['PatientOutSA'] = countryCode.contains("966") ? 0 : 1;
body['MobileNo'] = countryCode + Utils.getPhoneNumberWithoutZero(phoneNumber);
body['Searching_type'] = "$type";
body['Searching_type'] = type;
if (BASE_URL.contains('uat')) {
body['ForDemo'] = true;
}

@ -33,7 +33,11 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<FeedbackViewModel>(
onModelReady: (model) => model.getCOC(),
allowAny: true,
onModelReady: (model) {
model.cOCItemList.clear();
if (projectViewModel.isLogin) model.getCOC();
},
builder: (_, model, widget) => AppScaffold(
baseViewModel: model,
isShowDecPage: false,
@ -160,6 +164,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
countryCode = value;
});
}),
if (model.cOCItemList.length > 0) listData(model.cOCItemList, projectViewModel.isArabic, false),
],
),
),
@ -178,9 +183,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: model.error);
});
} else {
listData(model.cOCItemList, projectViewModel.isArabic, false);
}
} else {}
});
},
disabledColor: Colors.grey,

Loading…
Cancel
Save