From b9d913e6a51af479e7633b70684b3c6e11680ff4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 17 Aug 2020 16:30:15 +0300 Subject: [PATCH] Merge fixes & updates --- lib/core/service/client/base_app_client.dart | 36 ++++++++----- lib/pages/BookAppointment/BookSuccess.dart | 2 + lib/pages/ToDoList/ToDo.dart | 1 + .../appointment_services/GetDoctorsList.dart | 14 +++--- lib/widgets/in_app_browser/InAppBrowser.dart | 50 +++---------------- 5 files changed, 40 insertions(+), 63 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index ec75bb5b..a72d15a7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -59,24 +59,34 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (isAllowAny) { + if (parsed['Response_Message'] != null) { onSuccess(parsed, statusCode); - } else if (!parsed['IsAuthenticated']) { - if (parsed['isSMSSent'] == true) { + } else { + if (isAllowAny) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 1) { + } else if (!parsed['IsAuthenticated']) { + if (parsed['isSMSSent'] == true) { + onSuccess(parsed, statusCode); + } else if (parsed['MessageStatus'] == 1) { + onSuccess(parsed, statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logout(); + } + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); - logout(); + if (parsed['SameClinicApptList'] != null) { + onSuccess(parsed, statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } } - } else if (parsed['MessageStatus'] == 1 || - parsed['SMSLoginRequired'] == true) { - onSuccess(parsed, statusCode); - } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); } } } else { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index cdad398f..163c42e2 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -109,11 +109,13 @@ class _BookSuccessState extends State { style: _getTextStyling()), ), Container( + width: MediaQuery.of(context).size.width * 0.65, margin: EdgeInsets.only(top: 5.0, bottom: 3.0), child: Text( widget.docObject.doctorTitle + " " + widget.docObject.name, + overflow: TextOverflow.ellipsis, style: _getTextStyling()), ), ], diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index a7e06342..24b7aa74 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index ff2e5f61..05205de2 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -42,14 +42,14 @@ class DoctorsListService extends BaseService { "PatientOutSA": 0, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, - "SessionID": null, + "SessionID": "YckwoXhUmWBsnHKEKig", "ClinicID": clinicID, "ProjectID": projectID, "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": true, - "PatientID": authUser.patientID, - "gender": authUser.gender, - "age": authUser.age, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "gender": authUser.gender != null ? authUser.gender : 0, + "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, "Latitude": 0, "Longitude": 0, @@ -95,9 +95,9 @@ class DoctorsListService extends BaseService { "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": false, "DoctorName": docName, - "PatientID": authUser.patientID, - "gender": authUser.gender, - "age": authUser.age, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "gender": authUser.gender != null ? authUser.gender : 0, + "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, "Latitude": 0, "Longitude": 0, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 46c32ab6..6722971d 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -8,18 +8,17 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class MyInAppBrowser extends InAppBrowser { -// static String SERVICE_URL = -// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // ignore: non_constant_identifier_names - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT -// static String PREAUTH_SERVICE_URL = -// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT +// static String SERVICE_URL = +// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + +// static String PREAUTH_SERVICE_URL = +// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static List successURLS = [ 'success', @@ -50,41 +49,6 @@ class MyInAppBrowser extends InAppBrowser { @override Future onLoadStart(String url) async { onLoadStartCallback(url); - // print("\n\nStarted $url\n\n"); - -// if (successURLS.length != 0) { -// successURLS.forEach((element) { -// if (url.contains(element)) { -// try { -// if (browser.isOpened()) browser.close(); -// isPaymentDone = true; -// Utils.hideProgressDialog(); -// return; -// } on MissingPluginException catch (exception) { -// Utils.hideProgressDialog(); -// } catch (error) { -// Utils.hideProgressDialog(); -// } -// } -// }); -// } -// -// if (errorURLS.length != 0) { -// errorURLS.forEach((element) { -// if (url.contains(element)) { -// try { -// if (browser.isOpened()) browser.close(); -// isPaymentDone = false; -// Utils.hideProgressDialog(); -// return; -// } on MissingPluginException catch (exception) { -// Utils.hideProgressDialog(); -// } catch (error) { -// Utils.hideProgressDialog(); -// } -// } -// }); -// } } @override