From 184942e8919bf686ba14b5892f99f76335e3a0ba Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 4 Oct 2021 13:38:39 +0300 Subject: [PATCH] Covid Payment fixes --- .../medical/ActiveMedicationsService.dart | 1 - lib/pages/BookAppointment/BookSuccess.dart | 6 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 19 + .../covid-dirvethru-questions.dart | 4 +- .../covid-payment-details.dart | 5 +- .../covid-payment-summary.dart | 13 +- .../MyAppointments/AppointmentDetails.dart | 6 +- lib/pages/ToDoList/ToDo.dart | 8 +- lib/pages/ToDoList/payment_method_select.dart | 108 ++-- .../medical/labs/passport_update_page.dart | 2 +- .../appointment_services/GetDoctorsList.dart | 466 +++++------------- 11 files changed, 251 insertions(+), 387 deletions(-) diff --git a/lib/core/service/medical/ActiveMedicationsService.dart b/lib/core/service/medical/ActiveMedicationsService.dart index dc4a3641..0025df29 100644 --- a/lib/core/service/medical/ActiveMedicationsService.dart +++ b/lib/core/service/medical/ActiveMedicationsService.dart @@ -12,7 +12,6 @@ class ActiveMedicationsService extends BaseService{ Map body = Map(); body['isDentalAllowedBackend'] = false; body['PatientID'] = 1298851; - body['TokenID'] = "@dm!n"; await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, onSuccess: (response, statusCode) async { activePrescriptionReport.clear(); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 387bd41a..d9499eeb 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -480,7 +480,11 @@ class _BookSuccessState extends State { appo.clinicID = widget.patientShareResponse.clinicID; appo.appointmentNo = widget.patientShareResponse.appointmentNo; - Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { + Navigator.push(context, FadePage(page: PaymentMethod( + onSelectedMethod: (String metohd) { + setState(() {}); + } + ))).then((value) { if (value != null) { openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 274b16fe..d3accfe1 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -65,6 +67,8 @@ class _CovidTimeSlotsState extends State with TickerProviderStat ScrollController _scrollController; + ToDoCountProviderModel toDoProvider; + @override void initState() { final _selectedDay = DateTime.now(); @@ -117,6 +121,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, @@ -447,6 +452,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + getToDoCount(); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); } else { GifLoaderDialogUtils.hideDialog(context); @@ -478,6 +484,19 @@ class _CovidTimeSlotsState extends State with TickerProviderStat }); } + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { ConfirmDialog.closeAlertDialog(context); GifLoaderDialogUtils.showMyDialog(context); diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index 32341603..458d9ec2 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -71,7 +71,7 @@ class CovidDirveThruQuestionsState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Booking appointment for:", + TranslationBase.of(context).covidBookAppo, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16, @@ -130,7 +130,7 @@ class CovidDirveThruQuestionsState extends State { ), mHeight(12), Text( - "Please answer below questionnaire", + TranslationBase.of(context).covidQuestionnaire, style: TextStyle( fontSize: 16, letterSpacing: -0.64, diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index ceb0219c..29a269af 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; @@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class CovidPaymentDetails extends StatefulWidget { CovidPaymentInfoResponse covidPaymentInfoResponse; @@ -35,6 +37,7 @@ class _CovidPaymentDetailsState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, @@ -118,7 +121,7 @@ class _CovidPaymentDetailsState extends State { }, child: ListTile( title: Text( - widget.proceduresList[index].procedureName, + projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName, style: TextStyle( fontSize: 12.0, letterSpacing: -0.48, diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 99301e98..62eb6942 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -14,7 +13,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -26,7 +24,7 @@ import 'package:provider/provider.dart'; class CovidPaymentSummary extends StatefulWidget { PatientShareResponse patientShareResponse; - String selectedPaymentMethod; + String selectedPaymentMethod; MyInAppBrowser browser; AuthenticatedUser authenticatedUser; AppSharedPreferences sharedPref = AppSharedPreferences(); @@ -67,7 +65,6 @@ class _CovidPaymentSummaryState extends State { height: 12, ), Row( - children: [ Text( TranslationBase.of(context).totalBalance + ": ", @@ -105,11 +102,9 @@ class _CovidPaymentSummaryState extends State { InkWell( onTap: () { showDraggableDialog(context, PaymentMethod( - onSelectedMethod: (String metohd){ - widget.selectedPaymentMethod=metohd; - setState(() { - - }); + onSelectedMethod: (String metohd) { + widget.selectedPaymentMethod = metohd; + setState(() {}); }, )); }, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 3883432b..13b86071 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State with SingleTick "", //model.user.emailAddress, ), - isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, + isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, buttonTitle: TranslationBase.of(context).schedule, buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, @@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State with SingleTick onTap: (index) { setState(() { if (index == 1) { - if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { + if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { _tabController.index = _tabController.previousIndex; AppointmentDetails.showFooterButton = false; } else { @@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State with SingleTick }, tabs: [ Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment + widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment ? Tab( child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), ) diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index e7f56c61..b7a257aa 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -121,7 +121,8 @@ class _ToDoState extends State { DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + " " + - widget.appoList[index].startTime.substring(0, 5), overflow: TextOverflow.clip, + widget.appoList[index].startTime.substring(0, 5), + overflow: TextOverflow.clip, style: TextStyle(fontSize: 10.0)), ), !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(), @@ -743,7 +744,10 @@ class _ToDoState extends State { }); } - Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { + Navigator.push(context, FadePage(page: PaymentMethod( + onSelectedMethod: (String metohd) { + setState(() {}); + }))).then((value) { print(value); getPatientAppointmentHistory(); diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index 7b53d15e..fef55190 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -9,7 +9,9 @@ import 'package:flutter_svg/flutter_svg.dart'; class PaymentMethod extends StatefulWidget { Function onSelectedMethod; + PaymentMethod({this.onSelectedMethod}); + @override _PaymentMethodState createState() => _PaymentMethodState(); } @@ -56,13 +58,13 @@ class _PaymentMethodState extends State { children: [ Container( height: 60.0, - width:60, + width: 60, padding: EdgeInsets.all(7.0), child: Image.asset("assets/images/new-design/mada.png"), ), mWidth(12), Text( - "MADA", + "Mada", style: TextStyle( color: Colors.black, fontSize: 14, @@ -96,7 +98,8 @@ class _PaymentMethodState extends State { width: 60, child: Image.asset("assets/images/new-design/visa.png"), ), - mWidth(12),Text( + mWidth(12), + Text( "VISA", style: TextStyle( color: Colors.black, @@ -133,7 +136,7 @@ class _PaymentMethodState extends State { ), mWidth(12), Text( - "MASTER CARD", + "MasterCard", style: TextStyle( color: Colors.black, fontSize: 14, @@ -169,7 +172,7 @@ class _PaymentMethodState extends State { ), mWidth(12), Text( - "INSTALLMENT", + "Installments", style: TextStyle( color: Colors.black, fontSize: 14, @@ -183,39 +186,75 @@ class _PaymentMethodState extends State { ), Platform.isIOS ? Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("ApplePay"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(20.0), - child: SvgPicture.asset("assets/images/new-design/applepay.svg"), - ), - ), - ), - ), + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("ApplePay"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), - Expanded( - child: Container(), + child: Row( + children: [ + Container( + height: 60.0, + padding: EdgeInsets.all(7.0), + width: 60, + child: SvgPicture.asset("assets/images/new-design/applepay.svg"), + ), + mWidth(12), + Text( + "Apple Pay", + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ) + ], ), - ], + ), ), ) + // Container( + // margin: EdgeInsets.only(top: 25.0), + // child: Flex( + // direction: Axis.horizontal, + // children: [ + // Expanded( + // child: Container( + // child: InkWell( + // onTap: () { + // updateSelectedPaymentMethod("ApplePay"); + // }, + // child: Card( + // elevation: 3.0, + // margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + // color: Colors.white, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10), + // side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), + // ), + // child: Container( + // height: 120.0, + // padding: EdgeInsets.all(20.0), + // child: SvgPicture.asset("assets/images/new-design/applepay.svg"), + // ), + // ), + // ), + // ), + // ), + // Expanded( + // child: Container(), + // ), + // ], + // ), + // ) : Container(), SizedBox( height: 150.0, @@ -264,7 +303,6 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod(String selectedMethod) { setState(() { selectedPaymentMethod = selectedMethod; - }); } } diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index 767a950f..51efda3a 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -57,7 +57,7 @@ class _PassportUpdatePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Booking appointment for:", + TranslationBase.of(context).covidBookAppo, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index e7e19f4d..1c11e26b 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -15,7 +15,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; - class DoctorsListService extends BaseService { AppSharedPreferences sharedPref = AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); @@ -28,25 +27,20 @@ class DoctorsListService extends BaseService { String deviceToken; String tokenID; - Future getDoctorsList( - int clinicID, int projectID, bool isNearest, BuildContext context, - {doctorId, doctorName, isContinueDentalPlan = false}) async { + Future getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && - await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { lat = await this.sharedPref.getDouble(USER_LAT); long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -67,22 +61,19 @@ class DoctorsListService extends BaseService { "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - "SearchForVoiceCommand": - doctorId != null && doctorId.length > 0 ? true : false, + "SearchForVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, "isDentalAllowedBackend": isContinueDentalPlan, "IsGetNearAppointment": isNearest, - if (isNearest) - "SelectedDate": DateUtil.convertDateToString(DateTime.now()), + if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true }; dynamic localRes; - await baseAppClient.post(GET_DOCTORS_LIST_URL, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -97,19 +88,16 @@ class DoctorsListService extends BaseService { double long; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && - await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { lat = await this.sharedPref.getDouble(USER_LAT); long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -137,8 +125,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DOCTORS_LIST_URL, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -146,11 +133,9 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsProfile( - int docID, int clinicID, int projectID, context) async { + Future getDoctorsProfile(int docID, int clinicID, int projectID, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -173,8 +158,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DOCTOR_PROFILE, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTOR_PROFILE, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -184,8 +168,7 @@ class DoctorsListService extends BaseService { Future getDoctorsRating(int docID, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -206,8 +189,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DOCTOR_RATING_NOTES, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTOR_RATING_NOTES, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -215,20 +197,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorPrePostImages( - DoctorProfileList doctorProfile, context) async { + Future getDoctorPrePostImages(DoctorProfileList doctorProfile, context) async { Map request; - request = { - "PatientOutSA": authUser.outSA ?? 0, - "isDentalAllowedBackend": false, - "DoctorID": doctorProfile.doctorID, - "ClinicID": doctorProfile.clinicID, - "ProjectID": doctorProfile.projectID - }; + request = {"PatientOutSA": authUser.outSA ?? 0, "isDentalAllowedBackend": false, "DoctorID": doctorProfile.doctorID, "ClinicID": doctorProfile.clinicID, "ProjectID": doctorProfile.projectID}; var images = DoctorPrePostImages(); - await baseAppClient.post(GET_DOCTOR_PRE_POST_IMAGES, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTOR_PRE_POST_IMAGES, onSuccess: (response, statusCode) async { var list = response['DoctorPrePostImagesList']; if (list is List && list.length > 0) { list.forEach((j) { @@ -245,8 +219,7 @@ class DoctorsListService extends BaseService { Future getDoctorsRatingDetails(int docID, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -267,8 +240,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DOCTOR_RATING_DETAILS, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTOR_RATING_DETAILS, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -276,11 +248,9 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorFreeSlots( - int docID, int clinicID, int projectID, BuildContext context) async { + Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -303,8 +273,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -312,11 +281,9 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorScheduledFreeSlots(int docID, int clinicID, - int projectID, int serviceID, BuildContext context) async { + Future getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -340,8 +307,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -349,19 +315,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertAppointment(int docID, int clinicID, int projectID, - String selectedTime, String selectedDate, BuildContext context, - [String procedureID]) async { + Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, BuildContext context, [String procedureID]) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": false, @@ -389,15 +351,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -405,24 +365,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertLiveCareScheduleAppointment( - int docID, - int clinicID, - int projectID, - int serviceID, - String selectedTime, - String selectedDate, - BuildContext context) async { + Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": true, @@ -450,15 +401,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -466,18 +415,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientShare( - String appoID, int clinicID, int projectID, BuildContext context) async { + Future getPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -495,15 +441,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_SHARE, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async { localRes = response['OnlineCheckInAppointments'][0]; }, onFailure: (String error, int statusCode) { throw error; @@ -511,18 +455,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLiveCareAppointmentPatientShare( - String appoID, int clinicID, int projectID, BuildContext context) async { + Future getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -541,15 +482,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE, onSuccess: (response, statusCode) async { localRes = response['OnlineCheckInAppointments'][0]; }, onFailure: (String error, int statusCode) { throw error; @@ -557,18 +496,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientAppointmentHistory( - bool isActiveAppointment, BuildContext context) async { + Future getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -583,15 +519,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -599,13 +533,9 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - - Future getPatientAppointmentCurfewHistory( - bool isActiveAppointment) async { + Future getPatientAppointmentCurfewHistory(bool isActiveAppointment) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -620,15 +550,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": 1231755, - "TokenID": "@dm!n", "PatientTypeID": 1, "PatientType": 1 }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -636,18 +564,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future confirmAppointment(int appoNo, int clinicID, int projectID, - bool isLiveCare, BuildContext context) async { + Future confirmAppointment(int appoNo, int clinicID, int projectID, bool isLiveCare, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -666,15 +591,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(CONFIRM_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(CONFIRM_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -682,26 +605,22 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertVIDARequest(int appoNo, int clinicID, int projectID, - int serviceID, int docID, BuildContext context) async { + Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } deviceToken = await sharedPref.getString(PUSH_TOKEN); - if (await this.sharedPref.getDouble(USER_LAT) != null && - await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { lat = await this.sharedPref.getDouble(USER_LAT); long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -729,8 +648,7 @@ class DoctorsListService extends BaseService { dynamic localRes; - await baseAppClient.post(INSERT_VIDA_REQUEST, - onSuccess: (response, statusCode) async { + await baseAppClient.post(INSERT_VIDA_REQUEST, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -738,18 +656,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future cancelAppointment( - AppoitmentAllHistoryResultList appo, BuildContext context) async { + Future cancelAppointment(AppoitmentAllHistoryResultList appo, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -773,15 +688,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(CANCEL_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(CANCEL_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -789,18 +702,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future generateAppointmentQR( - PatientShareResponse patientShareResponse, BuildContext context) async { + Future generateAppointmentQR(PatientShareResponse patientShareResponse, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -818,15 +728,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GENERATE_QR_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GENERATE_QR_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -834,25 +742,15 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendAppointmentQREmail( - String to, - String appoDate, - String appoNo, - String docName, - String projName, - String QR, - String speciality, - BuildContext context) async { + Future sendAppointmentQREmail(String to, String appoDate, String appoNo, String docName, String projName, String QR, String speciality, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -873,15 +771,13 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(EMAIL_QR_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(EMAIL_QR_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -889,16 +785,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future checkPaymentStatus( - String transactionID, BuildContext context) async { + Future checkPaymentStatus(String transactionID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "ClientRequestID": transactionID, @@ -912,13 +805,11 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(CHECK_PAYMENT_STATUS, - onSuccess: (response, statusCode) async { + await baseAppClient.post(CHECK_PAYMENT_STATUS, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -926,19 +817,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future addAdvancedNumberRequest( - String advanceNumber, - String paymentReference, - dynamic appointmentID, - BuildContext context) async { + Future addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -954,13 +839,11 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(ADD_ADVANCE_NUMBER_REQUEST, - onSuccess: (response, statusCode) async { + await baseAppClient.post(ADD_ADVANCE_NUMBER_REQUEST, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -968,16 +851,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future addVIDARequest(String advanceNumber, String paymentReference, - dynamic apptData, BuildContext context) async { + Future addVIDARequest(String advanceNumber, String paymentReference, dynamic apptData, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -987,8 +867,7 @@ class DoctorsListService extends BaseService { "ServiceID": apptData.ServiceID, "ProjectID": apptData.ProjectID, "ClinicID": apptData.ClinicID, - "ClientRequestID": Utils.getAppointmentTransID( - apptData.ProjectID, apptData.ClinicID, apptData.AppointmentNo), + "ClientRequestID": Utils.getAppointmentTransID(apptData.ProjectID, apptData.ClinicID, apptData.AppointmentNo), "AppointmentDate": apptData.AppointmentDate, "DeviceType": Platform.isIOS ? "iOS" : "Android", "VersionID": req.VersionID, @@ -1001,7 +880,6 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; @@ -1017,8 +895,7 @@ class DoctorsListService extends BaseService { // request.DeviceType = this.getDeviceType(); // request.VoipToken = this.platform.is('ios') ? this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false) : ""; dynamic localRes; - await baseAppClient.post(ADD_VIDA_REQUEST, - onSuccess: (response, statusCode) async { + await baseAppClient.post(ADD_VIDA_REQUEST, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1029,12 +906,10 @@ class DoctorsListService extends BaseService { Future isAllowedToAskDoctor(int docID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForAskYourDoctor": true, @@ -1052,14 +927,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(IS_ALLOW_ASK_DOCTOR, - onSuccess: (response, statusCode) async { + await baseAppClient.post(IS_ALLOW_ASK_DOCTOR, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1070,12 +943,10 @@ class DoctorsListService extends BaseService { Future getCallRequestType(BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, @@ -1088,14 +959,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_CALL_REQUEST_TYPE, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_CALL_REQUEST_TYPE, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1103,16 +972,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, - String requestType, BuildContext context) async { + Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -1123,22 +989,14 @@ class DoctorsListService extends BaseService { "RequestTypeID": requestType, "PatientMobileNumber": authUser.mobileNumber, "IsMessageSent": false, - "RequestDate": - DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) - .split(" ")[0], - "RequestTime": - DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) - .split(" ")[1], + "RequestDate": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], + "RequestTime": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[1], "Remarks": "", "Status": 1, "CreatedBy": 102, - "CreatedOn": - DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) - .split(" ")[0], + "CreatedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], "EditedBy": 102, - "EditedOn": - DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()) - .split(" ")[0], + "EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], "VersionID": req.VersionID, "Channel": req.Channel, "LanguageID": languageID == 'ar' ? 1 : 2, @@ -1149,14 +1007,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(SEND_CALL_REQUEST, - onSuccess: (response, statusCode) async { + await baseAppClient.post(SEND_CALL_REQUEST, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1167,12 +1023,10 @@ class DoctorsListService extends BaseService { Future getPatientRadOrders(String appoNo, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, @@ -1186,14 +1040,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_ORDERS, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1201,16 +1053,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, - dynamic clinicID, BuildContext context) async { + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, @@ -1226,14 +1075,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1241,16 +1088,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientPrescriptionReports( - AppoitmentAllHistoryResultList appo, BuildContext context) async { + Future getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appo.appointmentNo, @@ -1268,14 +1112,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PRESCRIPTION_REPORT_ENH, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PRESCRIPTION_REPORT_ENH, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1283,16 +1125,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendPrescriptionEmail(String appoDate, String setupId, - dynamic prescriptionReportEnhList, BuildContext context) async { + Future sendPrescriptionEmail(String appoDate, String setupId, dynamic prescriptionReportEnhList, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentDate": appoDate, @@ -1313,14 +1152,12 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, - onSuccess: (response, statusCode) async { + await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1328,21 +1165,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future createAdvancePayment( - AppoitmentAllHistoryResultList appo, - String projectID, - double payedAmount, - String paymentReference, - String paymentMethodName, - BuildContext context) async { + Future createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "ProjectID": projectID, @@ -1350,11 +1179,7 @@ class DoctorsListService extends BaseService { "AppointmentNo": appo != null ? appo.appointmentNo.toString() : "0", "PaymentMethodName": paymentMethodName, "PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(), - "PaymentDate": payedAmount == 0 - ? "" - : "/Date(" + - DateTime.now().millisecondsSinceEpoch.toString() + - ")/", + "PaymentDate": payedAmount == 0 ? "" : "/Date(" + DateTime.now().millisecondsSinceEpoch.toString() + ")/", "PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference, "ProjectID": appo != null ? appo.projectID.toString() : projectID, "PatientID": authUser.patientID, @@ -1371,13 +1196,11 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(CREATE_ADVANCE_PAYMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(CREATE_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1385,24 +1208,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future HIS_createAdvancePayment( - AppoitmentAllHistoryResultList appo, - String projectID, - double payedAmount, - String paymentReference, - String paymentMethodName, - dynamic patientType, - String patientName, - dynamic patientID, - BuildContext context) async { + Future HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, + String patientName, dynamic patientID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -1427,13 +1240,11 @@ class DoctorsListService extends BaseService { "PatientOutSA": authUser.outSA, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "TokenID": "@dm!n", "PatientTypeID": patientType, "PatientType": patientType }; dynamic localRes; - await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, - onSuccess: (response, statusCode) async { + await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1441,16 +1252,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientHealthDataStats( - int medCategoryId, int medCategoryStsId, BuildContext context) async { + Future getPatientHealthDataStats(int medCategoryId, int medCategoryStsId, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "MedCategoryID": medCategoryId, @@ -1465,13 +1273,11 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, - "TokenID": "@dm!n", "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType }; dynamic localRes; - await baseAppClient.post(GET_PATIENT_HEALTH_STATS, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_PATIENT_HEALTH_STATS, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1479,8 +1285,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, - int projectId, BuildContext context) async { + Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { Map request; request = { @@ -1489,8 +1294,7 @@ class DoctorsListService extends BaseService { "ProjectID": projectId, }; dynamic localRes; - await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, - onSuccess: (response, statusCode) async { + await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -1505,13 +1309,11 @@ class DoctorsListService extends BaseService { "ProjectID": projectID, }; dynamic localRes; - await baseAppClient.post(HAS_DENTAL_PLAN, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + await baseAppClient.post(HAS_DENTAL_PLAN, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - }