From 28fde5c5001040d735281c4301d6eceea000be11 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 9 Aug 2020 19:41:06 +0300 Subject: [PATCH] My Appointments implemented, Appointment Details functionality updated, Logged In User details added in APIs & other updates --- assets/images/medical/my_appointment_icon.png | Bin 0 -> 1766 bytes assets/images/new-design/arrow.png | Bin 0 -> 2214 bytes .../images/new-design/noAppointmentIcon.png | Bin 0 -> 3274 bytes lib/config/config.dart | 8 +- lib/config/localized_values.dart | 16 + lib/pages/BookAppointment/BookConfirm.dart | 35 +- lib/pages/BookAppointment/BookSuccess.dart | 501 ++++++++++++++---- lib/pages/BookAppointment/QRCode.dart | 297 +++++++++++ lib/pages/BookAppointment/Search.dart | 3 +- .../components/DocAvailableAppointments.dart | 5 +- .../components/SearchByClinic.dart | 12 +- .../components/SearchByDoctor.dart | 10 +- .../BookAppointment/widgets/DoctorView.dart | 3 +- .../MyAppointments/AppointmentDetails.dart | 3 +- lib/pages/MyAppointments/MyAppointments.dart | 243 +++++++++ lib/pages/MyAppointments/VisitTicket.dart | 6 +- .../MyAppointments/models/ArrivedButtons.dart | 2 +- .../models/ArrivedButtonsAllowCheckIn.dart | 2 +- .../widgets/AppointmentActions.dart | 8 +- .../widgets/AppointmentCardView.dart | 144 +++++ lib/pages/ToDoList/ToDo.dart | 470 ++++++++-------- lib/pages/ToDoList/payment_method_select.dart | 1 - lib/pages/ToDoList/widgets/paymentDialog.dart | 14 +- lib/pages/medical/medical_profile_page.dart | 30 +- .../appointment_services/GetDoctorsList.dart | 357 ++++++++++--- .../authentication/auth_provider.dart | 17 +- .../clinic_services/get_clinic_service.dart | 6 +- lib/uitl/translations_delegate_base.dart | 26 +- lib/uitl/utils.dart | 34 ++ lib/widgets/in_app_browser/InAppBrowser.dart | 21 +- lib/widgets/others/app_scaffold_widget.dart | 2 + no-wait-queue.png | Bin 0 -> 3314 bytes pubspec.yaml | 3 + 33 files changed, 1795 insertions(+), 484 deletions(-) create mode 100644 assets/images/medical/my_appointment_icon.png create mode 100644 assets/images/new-design/arrow.png create mode 100644 assets/images/new-design/noAppointmentIcon.png create mode 100644 lib/pages/BookAppointment/QRCode.dart create mode 100644 lib/pages/MyAppointments/MyAppointments.dart create mode 100644 lib/pages/MyAppointments/widgets/AppointmentCardView.dart create mode 100644 no-wait-queue.png diff --git a/assets/images/medical/my_appointment_icon.png b/assets/images/medical/my_appointment_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f5e4c7d4d3368f21ebe925d9240438ee1c117010 GIT binary patch literal 1766 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 literal 0 HcmV?d00001 diff --git a/assets/images/new-design/noAppointmentIcon.png b/assets/images/new-design/noAppointmentIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..a52b5011607e08bc28d41572fe2e44ea4a922080 GIT binary patch literal 3274 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 literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 41c76242..1f47a03d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://uat.hmgwebservices.com/Services'; +const BASE_URL = 'https://hmgwebservices.com/Services'; const GET_PROJECT = '/Lists.svc/REST/GetProject'; @@ -55,6 +55,12 @@ const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment"; //URL to cancel appointment const CANCEL_APPOINTMENT = "/Doctors.svc/REST/CancelAppointment"; +//URL get appointment QR +const GENERATE_QR_APPOINTMENT = "/Doctors.svc/REST/GenerateQRAppointmentNo"; + +//URL send email appointment QR +const EMAIL_QR_APPOINTMENT = "/Notifications.svc/REST/sendEmailForOnLineCheckin"; + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d9425234..3611298d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -166,4 +166,20 @@ const Map> localizedValues = { "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, "patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"}, 'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'}, + 'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'}, + 'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'}, + 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, + 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, + 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, + 'scanQRHospital': {'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'}, + "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, + "close": {"en": "Close", "ar": "مغلق"}, + "booked": {"en": "Booked", "ar": "محجوز"}, + "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, + "arrived": {"en": "Arrived", "ar": "تم الحضور"}, + "payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"}, + "payNowBookSuccesstext1": {"en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"}, + "payNowBookSuccesstext2": {"en": "You can also Pay Later via online payment Or in Hospital", "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"}, + 'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'}, + }; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 5b4b9975..a31292fa 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -1,7 +1,10 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -28,6 +31,8 @@ class BookConfirm extends StatefulWidget { DoctorsListService service; PatientShareResponse patientShareResponse; + AuthenticatedUser authUser; + @override _BookConfirmState createState() => _BookConfirmState(); @@ -36,6 +41,8 @@ class BookConfirm extends StatefulWidget { class _BookConfirmState extends State { @override void initState() { + widget.authUser = new AuthenticatedUser(); + getPatientData(); widget.service = new DoctorsListService(); widget.patientShareResponse = new PatientShareResponse(); super.initState(); @@ -296,14 +303,14 @@ class _BookConfirmState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("TAMER FANASHEH", + Text(widget.authUser.firstName + " " + widget.authUser.lastName, style: TextStyle( fontSize: 14.0, color: Colors.grey[900], letterSpacing: 1.0)), Container( margin: EdgeInsets.only(top: 5.0), - child: Text("Gender: Male", + child: Text("Gender: " + widget.authUser.genderDescription, style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -311,7 +318,7 @@ class _BookConfirmState extends State { ), Container( margin: EdgeInsets.only(top: 5.0, bottom: 3.0), - child: Text("Age: 33", + child: Text("Age: " + widget.authUser.age.toString(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -356,10 +363,10 @@ class _BookConfirmState extends State { ); } - cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo) { + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { ConfirmDialog.closeAlertDialog(context); DoctorsListService service = new DoctorsListService(); - service.cancelAppointment(appo).then((res) { + service.cancelAppointment(appo, context).then((res) { if (res['MessageStatus'] == 1) { insertAppointment(context, docObject); } else { @@ -374,7 +381,7 @@ class _BookConfirmState extends State { AppoitmentAllHistoryResultList appo; widget.service .insertAppointment(docObject.doctorID, docObject.clinicID, - docObject.projectID, widget.selectedTime, widget.selectedDate) + docObject.projectID, widget.selectedTime, widget.selectedDate, context) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); @@ -399,7 +406,7 @@ class _BookConfirmState extends State { confirmMessage: res['ErrorEndUserMessage'], okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {cancelAppointment(docObject, appo)}, + okFunction: () => {cancelAppointment(docObject, appo, context)}, cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -411,7 +418,7 @@ class _BookConfirmState extends State { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { widget.service - .getPatientShare(appointmentNo, clinicID, projectID) + .getPatientShare(appointmentNo, clinicID, projectID, context) .then((res) { print(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res); @@ -461,6 +468,18 @@ class _BookConfirmState extends State { return docSpeciality; } + getPatientData() async { + AppSharedPreferences sharedPref = AppSharedPreferences(); + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await sharedPref.getObject(USER_PROFILE)); + setState(() { + print(data); + widget.authUser = data; + }); + } + } + Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { print(widget.appoDateFormatted); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 7025a90e..42d46956 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -1,8 +1,12 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'QRCode.dart'; + class BookSuccess extends StatefulWidget { PatientShareResponse patientShareResponse; DoctorList docObject; @@ -21,6 +25,12 @@ class BookSuccess extends StatefulWidget { } class _BookSuccessState extends State { + @override + void initState() { + // TODO: implement initState + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -140,125 +150,392 @@ class _BookSuccessState extends State { ], ), ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - margin: EdgeInsets.only(top: 30.0, bottom: 40.0), - alignment: Alignment.center, - child: Text(TranslationBase.of(context).confirmAppo, - style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + getNextActionWidget(), + ], + ), + ), + ); + } + + Widget getNextActionWidget() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return Container(); + break; + case 10: + return _getConfirmAppo(); + break; + case 15: + return _getPaymentPendingAppo(); + break; + case 20: + return _getPayNowAppo(); + break; + case 30: + return _getQRAppo(); + break; + } + } + + String getNextAction() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return 'No Action'; + break; + case 10: + return 'Confirm'; + break; + case 15: + return 'Payment Pending'; + break; + case 20: + return 'Pay Now'; + break; + case 30: + return 'QR Code'; + break; + } + } + + Widget _getConfirmAppo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0, bottom: 40.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).confirmAppo, + style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + _getBulletPoint("1"), + Container( + child: Text( + "Please confirm the appointment to avoid the cancellation", + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], ), - Flex( - direction: Axis.horizontal, + ), + ), + ], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(top: 20.0, left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(left: 10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - _getBulletPoint("1"), - Container( - child: Text( - "Please confirm the appointment to avoid the cancellation", - overflow: TextOverflow.fade, - style: TextStyle(fontSize: 13.0)), - ), - ], - ), - ), + _getBulletPoint("2"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + "The online payment process will be available 24 hours before the appointment.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 13.0)), ), ], ), - Flex( - direction: Axis.horizontal, + ), + ), + ], + ), + Container( + margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), + child: Image.asset("assets/images/new-design/payment-method.png"), + ), + Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.32, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () {}, + child: Text(TranslationBase.of(context).confirm.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).confirmLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + ], + ); + } + + Widget _getPaymentPendingAppo() { + return Container(); + } + + Widget _getPayNowAppo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 20.0, bottom: 0.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).payNowBookSuccess, + style: TextStyle(fontSize: 20.0, letterSpacing: 0.8, fontWeight: FontWeight.bold)), + ), + Container( + alignment: Alignment.center, + child: Image.asset("assets/images/new-design/no-wait-queue.png", width: 120.0, + height: 120.0), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(top: 20.0, left: 10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - _getBulletPoint("2"), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Text( - "The online payment process will be available 24 hours before the appointment.", - overflow: TextOverflow.clip, - style: TextStyle(fontSize: 13.0)), - ), - ], - ), - ), + _getBulletPoint("1"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).payNowBookSuccesstext1, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), + child: Image.asset("assets/images/new-design/payment-method.png"), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(top: 0.0, left: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + _getBulletPoint("2"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).payNowBookSuccesstext2, + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 13.0)), ), ], ), - Container( - margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), - child: Image.asset( - "assets/images/new-design/payment-method.png"), + ), + ), + ], + ), + Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.32, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () {}, - child: Text( - TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () {}, + child: Text(TranslationBase.of(context).payNow.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).payLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + ], + ); + } + + Widget _getQRAppo() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0, bottom: 40.0), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).noNeedToWaitInLine, + style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), + ), + Container( + alignment: Alignment.center, + child: Image.asset("assets/images/new-design/device_icon.png", width: 120.0, + height: 120.0), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + _getBulletPoint("1"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).useQRAppoAttend, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context) - .confirmLater - .toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + _getBulletPoint("2"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).passQRAppoAttend, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], ), - ], - ), + ), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Row( + children: [ + _getBulletPoint("3"), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + TranslationBase.of(context).sitWaitingQR, + overflow: TextOverflow.fade, + style: TextStyle(fontSize: 13.0)), + ), + ], + ), + ), + ], ), - ], + ), ), ], ), - ), + Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.18, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { +// navigateToQR(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).viewQR.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + ], ); } - - _getTextStyling() { return TextStyle(fontSize: 14.0, color: Colors.white, letterSpacing: 0.7); } @@ -292,7 +569,29 @@ class _BookSuccessState extends State { } Future navigateToHome(context) async { - Navigator.popUntil(context, ModalRoute.withName('/')); + Navigator.of(context).pushNamed(HOME); + } + + getAppoQR(context) { + DoctorsListService service = new DoctorsListService(); + service + .generateAppointmentQR(widget.patientShareResponse, context) + .then((res) { + print(res); + navigateToQR(context, res['AppointmentQR']); + }).catchError((err) { + print(err); + }); + } + + Future navigateToQR(context, String appoQR) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => QRCode( + patientShareResponse: widget.patientShareResponse, + appoQR: appoQR, + ))); } _getNormalText(text) { diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart new file mode 100644 index 00000000..a850437b --- /dev/null +++ b/lib/pages/BookAppointment/QRCode.dart @@ -0,0 +1,297 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +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/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class QRCode extends StatefulWidget { + PatientShareResponse patientShareResponse; + String appoQR; + AuthenticatedUser authUser; + AppSharedPreferences sharedPref = AppSharedPreferences(); + + QRCode({@required this.patientShareResponse, @required this.appoQR}); + + @override + _QRCodeState createState() => _QRCodeState(); +} + +class _QRCodeState extends State { + Uint8List _bytes; + + @override + void initState() { + // TODO: implement initState + _bytes = base64.decode(widget.appoQR.split(',').last); + widget.authUser = new AuthenticatedUser(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).attendRegisterCode, + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + child: Image.memory(_bytes, scale: 0.5), + ), + Container( + margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), + child: Divider( + color: Colors.red[700], + thickness: 0.8, + ), + ), + Container( + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), + child: Image.asset( + "assets/images/new-design/device_icon.png", + width: 120.0, + height: 120.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + color: Colors.red[700], + fontSize: 20.0, + fontWeight: FontWeight.bold)), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + child: Divider( + color: Colors.red[700], + thickness: 0.8, + ), + ), + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).appoInfo, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700], + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(left: 20.0, bottom: 20.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.grey[200], + boxShadow: [ + BoxShadow(color: Colors.grey, spreadRadius: 2), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(widget.patientShareResponse.doctorNameObj, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700], + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only( + bottom: 10.0, left: 20.0, right: 20.0), + child: Text( + getDoctorSpeciality( + widget.patientShareResponse.doctorSpeciality), + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + Container( + margin: EdgeInsets.only( + top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(widget.patientShareResponse.projectName, + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + Container( + margin: EdgeInsets.only( + top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text( + getDate(widget.patientShareResponse.appointmentDate), + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + alignment: Alignment.bottomCenter, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { +// navigateToQR(context); +// getAppoQR(context); + sendEmail(); + }, + child: Text( + TranslationBase.of(context).sendEmail.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.1, + margin: EdgeInsets.only(bottom: 20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).close.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + sendEmail() async { + DoctorsListService service = new DoctorsListService(); + + if (await widget.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await widget.sharedPref.getObject(USER_PROFILE)); + setState(() { + widget.authUser = data; + }); + } + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: "Send a copy of this QR to the email " + + widget.authUser.emailAddress + + "?", + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () { + service + .sendAppointmentQREmail( + widget.authUser.emailAddress, + widget.patientShareResponse.appointmentDate, + widget.patientShareResponse.appointmentNo.toString(), + widget.patientShareResponse.doctorNameObj, + widget.patientShareResponse.projectName, + widget.appoQR, + getDoctorSpeciality( + widget.patientShareResponse.doctorSpeciality), + context) + .then((res) { + print(res); + ConfirmDialog.closeAlertDialog(context); + }).catchError((err) { + ConfirmDialog.closeAlertDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + Future navigateToHome(context) async { + Navigator.of(context).pushNamed(HOME); + } + + getPatientShare(context, String appointmentNo, int clinicID, int projectID, + DoctorList docObject) {} + + String getDate(String appoDate) { + var appoDateFormatted = ""; + + var dateObj = DateUtil.convertStringToDate(appoDate); + + setState(() { + appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + ", " + + dateObj.hour.toString() + + ":" + + dateObj.minute.toString() + + ":00"; + }); + + return appoDateFormatted; + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } +} diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index a83dee33..55fa943e 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -30,7 +30,8 @@ class _SearchState extends State with SingleTickerProviderStateMixin { ], controller: _tabController, ), - title: Text(TranslationBase.of(context).bookAppo), + title: Text(TranslationBase.of(context).bookAppo, + style: TextStyle(color: Colors.white)), ), body: TabBarView( physics: NeverScrollableScrollPhysics(), diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index a23abccd..19c7cc79 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -55,7 +55,8 @@ class _DocAvailableAppointmentsState extends State _selectedDay: ['Event A0'] }; - getDoctorFreeSlots(context, widget.doctor); + WidgetsBinding.instance + .addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor)); _calendarController = CalendarController(); _animationController = AnimationController( @@ -322,7 +323,7 @@ class _DocAvailableAppointmentsState extends State DoctorsListService service = new DoctorsListService(); service .getDoctorFreeSlots( - docObject.doctorID, docObject.clinicID, docObject.projectID) + docObject.doctorID, docObject.clinicID, docObject.projectID, context) .then((res) { if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 1c871c40..63053077 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -20,8 +20,8 @@ class _SearchByClinicState extends State { @override void initState() { - // TODO: implement initState - getClinicsList(); + WidgetsBinding.instance + .addPostFrameCallback((_) => getClinicsList()); super.initState(); } @@ -74,7 +74,7 @@ class _SearchByClinicState extends State { setState(() { dropdownValue = newValue; print(dropdownValue); - getDoctorsList(); + getDoctorsList(context); }); }, ), @@ -86,7 +86,7 @@ class _SearchByClinicState extends State { getClinicsList() { ClinicListService service = new ClinicListService(); - service.getClinicsList().then((res) { + service.getClinicsList(context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListClinicCentralized'].forEach((v) { @@ -99,10 +99,10 @@ class _SearchByClinicState extends State { }); } - getDoctorsList() { + getDoctorsList(BuildContext context) { List doctorsList = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(int.parse(dropdownValue), 0).then((res) { + service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 27b7166d..668426ad 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -69,17 +69,17 @@ class _SearchByDoctorState extends State { textColor: Colors.white, disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), - onPressed: _isButtonDisabled ? null : _searchDoctor, + onPressed: _isButtonDisabled ? null : _searchDoctor(context), child: Text(TranslationBase.of(context).search, style: TextStyle(fontSize: 18.0)), ), ); } - getDoctorsList() { + getDoctorsList(BuildContext context) { List doctorsList = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsListByName(doctorNameController.text).then((res) { + service.getDoctorsListByName(doctorNameController.text, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { if(res['DoctorList'].length != 0) { @@ -111,8 +111,8 @@ class _SearchByDoctorState extends State { print(_isButtonDisabled); } - void _searchDoctor() { - getDoctorsList(); + _searchDoctor(BuildContext context) { + getDoctorsList(context); } Future navigateToSearchResults(context, List docList) async { diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index e50829a1..031f53c3 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -16,7 +16,6 @@ class DoctorView extends StatelessWidget { Widget build(BuildContext context) { return InkWell( onTap: () { -// navigateToDoctorProfile(context); getDoctorsProfile(context, doctor); }, child: Card( @@ -117,7 +116,7 @@ class DoctorView extends StatelessWidget { DoctorsListService service = new DoctorsListService(); service .getDoctorsProfile( - docObject.doctorID, docObject.clinicID, docObject.projectID) + docObject.doctorID, docObject.clinicID, docObject.projectID, context) .then((res) { if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 4f94c47b..fff6d383 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -165,7 +165,7 @@ class _AppointmentDetailsState extends State ), ), Container( - height: MediaQuery.of(context).size.height * 0.8, + height: MediaQuery.of(context).size.height * 0.87, child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ @@ -213,6 +213,7 @@ class _AppointmentDetailsState extends State docObj.actualDoctorRate = widget.appo.actualDoctorRate; docObj.projectName = widget.appo.projectName; docObj.originalClinicID = widget.appo.originalClinicID; + docObj.doctorImageURL = widget.appo.doctorImageURL; return docObj; } } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart new file mode 100644 index 00000000..122222b2 --- /dev/null +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -0,0 +1,243 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class MyAppointments extends StatefulWidget { + List appoList = []; + + List bookedAppoList = []; + List confirmedAppoList = []; + List arrivedAppoList = []; + + @override + _MyAppointmentsState createState() => _MyAppointmentsState(); +} + +class _MyAppointmentsState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + bool isDataLoaded = false; + + @override + void initState() { + _tabController = new TabController(length: 3, vsync: this); + WidgetsBinding.instance + .addPostFrameCallback((_) => getPatientAppointmentHistory()); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "My Appointments", + isShowAppBar: true, + body: Container( + child: Column(children: [ + /// this is will not colored with theme data + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).booked), + Tab(text: TranslationBase.of(context).confirmed), + Tab(text: TranslationBase.of(context).arrived), + ], + controller: _tabController, + ), + Divider( + color: Colors.grey[600], + thickness: 0.5, + ), + Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + isDataLoaded ? getBookedAppointments() : Container(), + isDataLoaded ? getConfirmedAppointments() : Container(), + isDataLoaded ? getArrivedAppointments() : Container() + ], + controller: _tabController, + ), + ), + ]), + ), + ); + } + + getPatientAppointmentHistory() { + DoctorsListService service = new DoctorsListService(); + widget.appoList.clear(); + widget.bookedAppoList.clear(); + widget.confirmedAppoList.clear(); + widget.arrivedAppoList.clear(); + service.getPatientAppointmentHistory(false, context).then((res) { + print(res['AppoimentAllHistoryResultList'].length); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList + .add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + sortAppointmentList(); + openAppointmentsTab(); + isDataLoaded = true; + } else {} + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }); + } + + bool isConfirmed(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isConfirmed(appo); + } + + bool isArrived(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isArrived(appo); + } + + bool isBooked(AppoitmentAllHistoryResultList appo) { + return AppointmentType.isBooked(appo); + } + + sortAppointmentList() { + widget.appoList.forEach((v) { + if (isBooked(v)) { + widget.bookedAppoList.add(v); + } + + if (isConfirmed(v)) { + widget.confirmedAppoList.add(v); + } + + if (isArrived(v)) { + widget.arrivedAppoList.add(v); + } + }); + } + + openAppointmentsTab() { + if (widget.bookedAppoList.length != 0) { + _tabController.animateTo((_tabController.index + 1) % 1); + return; + } + + if (widget.confirmedAppoList.length != 0) { + _tabController.animateTo((_tabController.index + 1) % 2); + return; + } + + if (widget.arrivedAppoList.length != 0) { + _tabController.animateTo((_tabController.index + 1) % 3); + return; + } + } + + Widget getBookedAppointments() { + return Container( + child: widget.bookedAppoList.length != 0 + ? new ListView.builder( + itemCount: widget.bookedAppoList.length, + itemBuilder: (context, i) { + return AppointmentCard( + appo: widget.bookedAppoList[i], + onReloadAppointmentHistory: getPatientAppointmentHistory, + ); + }, + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Booked Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ), + ); + } + + Widget getConfirmedAppointments() { + return widget.confirmedAppoList.length != 0 + ? Container( + child: new ListView.builder( + itemCount: widget.confirmedAppoList.length, + itemBuilder: (context, i) { + return AppointmentCard( + appo: widget.confirmedAppoList[i], + onReloadAppointmentHistory: getPatientAppointmentHistory, + ); + }, + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset("assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Confirmed Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ); + } + + Widget getArrivedAppointments() { + return widget.arrivedAppoList.length != 0 + ? Container( + child: new ListView.builder( + itemCount: widget.arrivedAppoList.length, + itemBuilder: (context, i) { + return AppointmentCard( + appo: widget.arrivedAppoList[i], + onReloadAppointmentHistory: getPatientAppointmentHistory, + ); + }, + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset("assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Arrived Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart index a4dd0a5e..923ef67d 100644 --- a/lib/pages/MyAppointments/VisitTicket.dart +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -19,7 +19,7 @@ class _VisitTicketState extends State { @override void initState() { - getPatientAppointmentCurfewHistory(); + getPatientAppointmentCurfewHistory(context); super.initState(); } @@ -46,10 +46,10 @@ class _VisitTicketState extends State { ); } - getPatientAppointmentCurfewHistory() { + getPatientAppointmentCurfewHistory(BuildContext context) { loading(true); DoctorsListService service = new DoctorsListService(); - service.getPatientAppointmentHistory(true).then((res) { + service.getPatientAppointmentHistory(true, context).then((res) { print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index 98b32def..00778ef7 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -42,7 +42,7 @@ class ArrivedButtons { { "title": "Insurance", "subtitle": "Approvals", - "icon": "assets/images/new-design/insurance_approvals_icon-in.png", + "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "goToTodoList" }, { diff --git a/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart index 98b32def..00778ef7 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtonsAllowCheckIn.dart @@ -42,7 +42,7 @@ class ArrivedButtons { { "title": "Insurance", "subtitle": "Approvals", - "icon": "assets/images/new-design/insurance_approvals_icon-in.png", + "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "goToTodoList" }, { diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 2aaf13d1..f0ff2e6f 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -303,20 +303,16 @@ class _AppointmentActionsState extends State { cancelAppointment() { ConfirmDialog.closeAlertDialog(context); - loading(true); DoctorsListService service = new DoctorsListService(); - service.cancelAppointment(widget.appo).then((res) { + service.cancelAppointment(widget.appo, context).then((res) { print(res); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - loading(false); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - loading(false); } }).catchError((err) { print(err); - loading(false); }); } @@ -355,7 +351,7 @@ class _AppointmentActionsState extends State { DoctorsListService service = new DoctorsListService(); service .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, - widget.appo.projectID) + widget.appo.projectID, context) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart new file mode 100644 index 00000000..e038c0af --- /dev/null +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -0,0 +1,144 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; + +import '../AppointmentDetails.dart'; + +class AppointmentCard extends StatefulWidget { + AppoitmentAllHistoryResultList appo; + final Function onReloadAppointmentHistory; + + AppointmentCard( + {@required this.appo, @required this.onReloadAppointmentHistory}); + + @override + _ApointmentCardState createState() => _ApointmentCardState(); +} + +class _ApointmentCardState extends State { + @override + Widget build(BuildContext context) { + return InkWell( + onTap: () { + navigateToAppointmentDetails(context, widget.appo); + }, + child: Card( + margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(widget.appo.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), + Container( + width: MediaQuery.of(context).size.width * 0.666, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.appo.doctorTitle + + " " + + widget.appo.doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.appo.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.appo.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text(getDate(widget.appo.appointmentDate).trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + widget.appo.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + transform: Matrix4.translationValues(0.0, -40.0, 0.0), + child: Image.asset( + "assets/images/new-design/arrow.png", + width: 25.0, + height: 25.0), + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), + ); + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + Future navigateToAppointmentDetails(context, appo) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AppointmentDetails(appo: appo))) + .then((value) { + widget.onReloadAppointmentHistory(); + }); + } +} diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b916ee22..c3b02a2c 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1,9 +1,13 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.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/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -25,13 +29,16 @@ class ToDo extends StatefulWidget { class _ToDoState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); - bool isLoading = false; + AuthenticatedUser authUser; + AuthProvider authProvider = new AuthProvider(); @override void initState() { +// authUser = authProvider.getAuthenticatedUser(); print("initState!!!!!"); widget.patientShareResponse = new PatientShareResponse(); - getPatientAppointmentHistory(); + WidgetsBinding.instance + .addPostFrameCallback((_) => getPatientAppointmentHistory()); super.initState(); } @@ -39,222 +46,208 @@ class _ToDoState extends State { Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, - body: isLoading == false - ? SingleChildScrollView( - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: widget.appoList.length, - itemBuilder: (context, index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + body: SingleChildScrollView( + child: Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.appoList.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + children: [ + Image.asset( + "assets/images/new-design/time_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: EdgeInsets.only(left: 10.0, right: 30.0), + child: Text( + getDate( + widget.appoList[index].appointmentDate), + style: TextStyle(fontSize: 12.0)), + ), + Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: EdgeInsets.only(left: 10.0, right: 10.0), + child: Text(widget.appoList[index].projectName, + style: TextStyle(fontSize: 12.0)), + ), + ], ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Row( - children: [ - Image.asset( - "assets/images/new-design/time_icon.png", - width: 20.0, - height: 20.0), - Container( - margin: EdgeInsets.only( - left: 10.0, right: 30.0), - child: Text( - getDate(widget - .appoList[index].appointmentDate), - style: TextStyle(fontSize: 12.0)), - ), - Image.asset( - "assets/images/new-design/hospital_address_icon.png", - width: 20.0, - height: 20.0), - Container( - margin: EdgeInsets.only( - left: 10.0, right: 10.0), - child: Text( - widget.appoList[index].projectName, - style: TextStyle(fontSize: 12.0)), - ), - ], - ), - Container( + Container( + margin: EdgeInsets.only(top: 5.0), + child: Divider( + color: Colors.grey[500], + ), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + height: + MediaQuery.of(context).size.height * 0.1, margin: EdgeInsets.only(top: 5.0), - child: Divider( - color: Colors.grey[500], + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + widget.appoList[index].doctorImageURL, + fit: BoxFit.fill), ), ), - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - height: - MediaQuery.of(context).size.height * - 0.1, - margin: EdgeInsets.only(top: 5.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: Image.network( + ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 20.0, left: 20.0, right: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.appoList[index].doctorTitle + + " " + widget - .appoList[index].doctorImageURL, - fit: BoxFit.fill), - ), - ), - ), - Expanded( - flex: 3, - child: Container( + .appoList[index].doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 1.0)), + Container( margin: EdgeInsets.only( - top: 20.0, left: 20.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - widget.appoList[index] - .doctorTitle + - " " + - widget.appoList[index] - .doctorNameObj, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.bold, - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only( - top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(widget - .appoList[index] - .doctorSpeciality) - .trim(), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: widget - .appoList[index] - .actualDoctorRate - .toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ], - ), - ], - ), + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(widget + .appoList[index] + .doctorSpeciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => performNextAction( - widget.appoList[index]), - child: Container( - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Image.asset( - getNextActionImage(widget - .appoList[index] - .nextAction), - width: 50.0, - height: 50.0), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Text( - getNextActionText(widget - .appoList[index] - .nextAction), - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 12.0)), - ) - ], + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: widget + .appoList[index].actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, ), - ), + ], ), - ) - ], - ), - Divider( - color: Colors.grey[500], + ], + ), ), - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 2, - child: Container( - child: Text( - getNextActionDescription(widget + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => + performNextAction(widget.appoList[index]), + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + getNextActionImage(widget .appoList[index].nextAction), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[700])), - ), - ), - Expanded( - flex: 1, - child: GestureDetector( - onTap: () { - navigateToAppointmentDetails( - context, widget.appoList[index]); - }, - child: Container( + width: 50.0, + height: 50.0), + Container( + margin: EdgeInsets.only(top: 5.0), child: Text( - TranslationBase.of(context) - .upcomingDetails, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 12.0, - color: Colors.red[600], - decoration: - TextDecoration.underline)), - ), - ), - ) - ], - ) - ], - ), + getNextActionText(widget + .appoList[index].nextAction), + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12.0)), + ) + ], + ), + ), + ), + ) + ], + ), + Divider( + color: Colors.grey[500], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text( + getNextActionDescription( + widget.appoList[index].nextAction), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[700])), + ), + ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + navigateToAppointmentDetails( + context, widget.appoList[index]); + }, + child: Container( + child: Text( + TranslationBase.of(context) + .upcomingDetails, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 12.0, + color: Colors.red[600], + decoration: + TextDecoration.underline)), + ), + ), + ) + ], ), - ), - ); - }, + ], + ), + ), ), - ), - ) - : AppCircularProgressIndicator(), + ); + }, + ), + ), + ), ); } @@ -305,6 +298,10 @@ class _ToDoState extends State { case 20: getPatientShare(context, appo); break; + + case 30: + getAppoQR(context, appo); + break; } } @@ -425,9 +422,8 @@ class _ToDoState extends State { } getPatientAppointmentHistory() { - loading(true); DoctorsListService service = new DoctorsListService(); - service.getPatientAppointmentHistory(true).then((res) { + service.getPatientAppointmentHistory(true, context).then((res) { print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { @@ -439,33 +435,59 @@ class _ToDoState extends State { }); } else {} }); - loading(false); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - loading(false); } }).catchError((err) { print(err); - loading(false); }); } getPatientShare(context, AppoitmentAllHistoryResultList appo) { - loading(true); DoctorsListService service = new DoctorsListService(); service - .getPatientShare( - appo.appointmentNo.toString(), appo.clinicID, appo.projectID) + .getPatientShare(appo.appointmentNo.toString(), appo.clinicID, + appo.projectID, context) .then((res) { - loading(false); widget.patientShareResponse = new PatientShareResponse.fromJson(res); openPaymentDialog(appo, widget.patientShareResponse); }).catchError((err) { - loading(false); print(err); }); } + getAppoQR(context, AppoitmentAllHistoryResultList appo) { + PatientShareResponse patientShareResponse = new PatientShareResponse(); + + patientShareResponse.doctorNameObj = appo.doctorNameObj; + patientShareResponse.doctorSpeciality = appo.doctorSpeciality; + patientShareResponse.projectName = appo.projectName; + patientShareResponse.appointmentDate = appo.appointmentDate; + patientShareResponse.appointmentNo = appo.appointmentNo; + patientShareResponse.clinicID = appo.clinicID; + patientShareResponse.projectID = appo.projectID; + patientShareResponse.isFollowup = appo.isFollowup; + + DoctorsListService service = new DoctorsListService(); + service.generateAppointmentQR(patientShareResponse, context).then((res) { + print(res); + navigateToQR(context, res['AppointmentQR'], patientShareResponse); + }).catchError((err) { + print(err); + }); + } + + Future navigateToQR( + context, String appoQR, PatientShareResponse patientShareResponse) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => QRCode( + patientShareResponse: patientShareResponse, + appoQR: appoQR, + ))); + } + openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) { showGeneralDialog( @@ -489,33 +511,29 @@ class _ToDoState extends State { context: context, pageBuilder: (context, animation1, animation2) {}) .then((value) { - getPatientAppointmentHistory(); +// getPatientAppointmentHistory(); }); } + Future navigateToPaymentMethod(context) async { + Navigator.push( + context, MaterialPageRoute(builder: (context) => PaymentMethod())); + } + confirmAppointment(AppoitmentAllHistoryResultList appo) { - loading(true); DoctorsListService service = new DoctorsListService(); service - .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID) + .confirmAppointment( + appo.appointmentNo, appo.clinicID, appo.projectID, context) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - loading(false); getPatientAppointmentHistory(); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - loading(false); } }).catchError((err) { print(err); - loading(false); - }); - } - - loading(bool flag) { - setState(() { - isLoading = flag; }); } } diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index 5f3eff18..e9f72ed8 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class PaymentMethod extends StatefulWidget { @override diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index 8341c6de..cc7a8748 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -9,7 +9,9 @@ class PaymentDialog extends StatefulWidget { AppoitmentAllHistoryResultList appo; PatientShareResponse patientShareResponse; - PaymentDialog({@required this.appo, this.patientShareResponse}); + final Function onPaymentMethodSelected; + + PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse}); @override _PaymentDialogState createState() => _PaymentDialogState(); @@ -158,7 +160,7 @@ class _PaymentDialogState extends State { child: InkWell( onTap: () { Navigator.of(context).pop(); - naviagetToPaymentMethod(context); + widget.onPaymentMethodSelected(); }, child: Container( child: Text("Ok", @@ -196,10 +198,10 @@ class _PaymentDialogState extends State { color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold"); } - Future naviagetToPaymentMethod(context) async { - Navigator.push( - context, MaterialPageRoute(builder: (context) => PaymentMethod())); - } +// Future navigateToPaymentMethod(context) async { +// Navigator.push( +// context, MaterialPageRoute(builder: (context) => PaymentMethod())); +// } String getDate(String date) { DateTime dateObj = DateUtil.convertStringToDate(date); diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index ceacaed4..bea8b2d1 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -1,5 +1,4 @@ -import 'dart:math'; - +import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -47,8 +46,9 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - onTap: (){ - Navigator.push(context, FadePage(page: DoctorHomePage())); + onTap: () { + Navigator.push( + context, FadePage(page: DoctorHomePage())); }, child: MedicalProfileItem( title: 'My Doctor', @@ -60,9 +60,7 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - onTap: (){ - - }, + onTap: () {}, child: MedicalProfileItem( title: 'Lab', imagePath: 'lab_result_icon.png', @@ -85,9 +83,9 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - onTap: (){ - Navigator.push(context, FadePage(page: HomePrescriptionsPage())); - + onTap: () { + Navigator.push(context, + FadePage(page: HomePrescriptionsPage())); }, child: MedicalProfileItem( title: 'Medicines', @@ -130,7 +128,17 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: Container(), + child: InkWell( + onTap: () { + Navigator.push( + context, FadePage(page: MyAppointments())); + }, + child: MedicalProfileItem( + title: 'My Appointments', + imagePath: 'my_appointment_icon.png', + subTitle: 'List', + ), + ), ) ], ), diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index f4494d2f..6d3ff1af 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1,17 +1,36 @@ +import 'dart:io'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/base_service.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/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; 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(); - Future getDoctorsList(int clinicID, int projectID) async { + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getDoctorsList( + int clinicID, int projectID, BuildContext context) async { + Utils.showProgressDialog(context); Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -28,9 +47,9 @@ class DoctorsListService extends BaseService { "ProjectID": projectID, "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": true, - "PatientID": 0, - "gender": 0, - "age": 0, + "PatientID": authUser.patientID, + "gender": authUser.gender, + "age": authUser.age, "IsGetNearAppointment": false, "Latitude": 0, "Longitude": 0, @@ -41,15 +60,24 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } - Future getDoctorsListByName(String docName) async { + Future getDoctorsListByName(String docName, BuildContext context) async { Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -67,9 +95,9 @@ class DoctorsListService extends BaseService { "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": false, "DoctorName": docName, - "PatientID": 0, - "gender": 0, - "age": 0, + "PatientID": authUser.patientID, + "gender": authUser.gender, + "age": authUser.age, "IsGetNearAppointment": false, "Latitude": 0, "Longitude": 0, @@ -80,14 +108,15 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - Future getDoctorsProfile(int docID, int clinicID, int projectID) async { + Future getDoctorsProfile(int docID, int clinicID, int projectID, context) async { + Utils.showProgressDialog(context); Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -114,14 +143,18 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTOR_PROFILE, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } - Future getDoctorFreeSlots(int docID, int clinicID, int projectID) async { + Future getDoctorFreeSlots( + int docID, int clinicID, int projectID, BuildContext context) async { + Utils.showProgressDialog(context); Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -148,19 +181,29 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } Future insertAppointment(int docID, int clinicID, int projectID, - String selectedTime, String selectedDate) async { + String selectedTime, String selectedDate, BuildContext context) async { + Utils.showProgressDialog(context); + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); - request = { "IsForLiveCare": false, "ProjectID": projectID, @@ -172,7 +215,7 @@ class DoctorsListService extends BaseService { "InitialSlotDuration": 0, "StrAppointmentDate": selectedDate, "IsVirtual": false, - "DeviceType": "iOS", + "DeviceType": Platform.isIOS ? 'iOS' : 'Android', "BookedBy": 102, "VisitType": 1, "VisitFor": 1, @@ -181,29 +224,40 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "DeviceTypeID": 1, - "PatientID": 1231755, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, "TokenID": "@dm!n", - "PatientTypeID": 1, - "PatientType": 1 + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType }; dynamic localRes; await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } - Future getPatientShare(String appoID, int clinicID, int projectID) async { + Future getPatientShare( + String appoID, int clinicID, int projectID, BuildContext context) async { + Utils.showProgressDialog(context); Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -217,29 +271,40 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "DeviceTypeID": 1, - "PatientID": 1231755, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, "TokenID": "@dm!n", - "PatientTypeID": 1, - "PatientType": 1 + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType }; dynamic localRes; await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async { - localRes = response['OnlineCheckInAppointments'][0]; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response['OnlineCheckInAppointments'][0]; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } - Future getPatientAppointmentHistory(bool isActiveAppointment) async { + Future getPatientAppointmentHistory( + bool isActiveAppointment, BuildContext context) async { + Utils.showProgressDialog(context); Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -253,25 +318,28 @@ class DoctorsListService extends BaseService { "PatientOutSA": 0, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "DeviceTypeID": 1, - "PatientID": 1231755, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, "TokenID": "@dm!n", - "PatientTypeID": 1, - "PatientType": 1 + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType }; dynamic localRes; await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } - Future getPatientAppointmentCurfewHistory(bool isActiveAppointment) async { + Future getPatientAppointmentCurfewHistory( + bool isActiveAppointment) async { Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -286,7 +354,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": 0, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "DeviceTypeID": 1, + "DeviceTypeID": req.DeviceTypeID, "PatientID": 1231755, "TokenID": "@dm!n", "PatientTypeID": 1, @@ -297,15 +365,24 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - Future confirmAppointment(int appoNo, int clinicID, int projectID) async { + Future confirmAppointment( + int appoNo, int clinicID, int projectID, BuildContext context) async { + Utils.showProgressDialog(context); Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -322,26 +399,37 @@ class DoctorsListService extends BaseService { "PatientOutSA": 0, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "DeviceTypeID": 1, - "PatientID": 1231755, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, "TokenID": "@dm!n", - "PatientTypeID": 1, - "PatientType": 1 + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType }; dynamic localRes; await baseAppClient.post(CONFIRM_APPOINTMENT, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } - Future cancelAppointment(AppoitmentAllHistoryResultList appo) async { + Future cancelAppointment( + AppoitmentAllHistoryResultList appo, BuildContext context) async { + Utils.showProgressDialog(context); Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -361,25 +449,130 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, - "DeviceTypeID": 1, - "PatientID": 1231755, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, "TokenID": "@dm!n", - "PatientTypeID": 1, - "PatientType": 1 + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType }; dynamic localRes; await baseAppClient.post(CANCEL_APPOINTMENT, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); + return Future.value(localRes); + } + + Future generateAppointmentQR( + PatientShareResponse patientShareResponse, BuildContext context) async { + Utils.showProgressDialog(context); + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNo": patientShareResponse.appointmentNo, + "ClinicID": patientShareResponse.clinicID, + "ProjectID": patientShareResponse.projectID, + "IsFollowup": patientShareResponse.isFollowup, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "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 { + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); return Future.value(localRes); } + Future sendAppointmentQREmail( + String to, + String appoDate, + String appoNo, + String docName, + String projName, + String QR, + String speciality, + BuildContext context) async { + Utils.showProgressDialog(context); + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNo": appoNo, + "AppointmentDate": appoDate, + "DoctorName": docName, + "ProjectName": projName, + "QR": QR, + "Speciality": speciality, + "To": to, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "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 { + localRes = response; + Utils.hideProgressDialog(); + }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); + throw error; + }, body: request); + return Future.value(localRes); + } } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 8f1a053e..3cb63ac3 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -1,25 +1,20 @@ -import 'dart:convert'; - import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; -import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_request.dart'; -import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; -import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; -import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; // SharedPreferences sharedPref = new SharedPreferences(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } + AppSharedPreferences sharedPref = new AppSharedPreferences(); const String INSERT_DEVICE_IMEI = '/Patients.svc/REST/Patient_INSERTDeviceIMEI'; @@ -40,6 +35,7 @@ class AuthProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; dynamic authenticatedUser; + AuthProvider() { getUserAuthentication(); } @@ -250,9 +246,10 @@ class AuthProvider with ChangeNotifier { } } - AuthenticatedUser getAuthenticatedUser() { + Future getAuthenticatedUser() async { this.isLogin = true; - return authenticatedUser; + return Future.value( + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE))); } Future checkPatientForRegisteration( diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index b9a023f0..05f6a2cb 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; class ClinicListService extends BaseService { AppSharedPreferences sharedPref = AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); - Future getClinicsList() async { + Future getClinicsList(context) async { + Utils.showProgressDialog(context); Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -30,7 +32,9 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_CLINICS_LIST_URL, onSuccess: (response, statusCode) async { localRes = response; + Utils.hideProgressDialog(); }, onFailure: (String error, int statusCode) { + Utils.hideProgressDialog(); throw error; }, body: request); return Future.value(localRes); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 81efd65b..168978b5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -268,8 +268,30 @@ class TranslationBase { String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode]; String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode]; String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode]; - - + String get moreVerification => + localizedValues['more-verify'][locale.languageCode]; + String get welcomeBack => + localizedValues['welcome-back'][locale.languageCode]; + String get accountInfo => + localizedValues['account-info'][locale.languageCode]; + String get useAnotherAccount => + localizedValues['another-acc'][locale.languageCode]; + String get next => localizedValues['next'][locale.languageCode]; + String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode]; + String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode]; + String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode]; + String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode]; + String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode]; + String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode]; + String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; + String get close => localizedValues['close'][locale.languageCode]; + String get booked => localizedValues['booked'][locale.languageCode]; + String get confirmed => localizedValues['confirmed'][locale.languageCode]; + String get arrived => localizedValues['arrived'][locale.languageCode]; + String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode]; + String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode]; + String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode]; + String get payLater => localizedValues['payLater'][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 7a987279..0c753cbb 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -1,5 +1,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:progress_dialog/progress_dialog.dart'; import 'app_shared_preferences.dart'; import 'app_toast.dart'; @@ -7,6 +9,8 @@ import 'app_toast.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); class Utils { + static ProgressDialog pr; + ///show custom Error Toast /// [message] to show for user static showErrorToast([String message]) { @@ -96,4 +100,34 @@ class Utils { var length = loginType == 1 ? 10 : 7; return "([0-9]{" + length.toString() + "})"; } + + static showProgressDialog(context, [String message = "Loading..."]) async { + pr = ProgressDialog(context, + type: ProgressDialogType.Normal, isDismissible: false, showLogs: false); + pr.style( + message: message, + borderRadius: 10.0, + backgroundColor: Colors.white, + elevation: 10.0, + insetAnimCurve: Curves.easeInOut, + progress: 0.0, + maxProgress: 100.0, + progressTextStyle: TextStyle( + color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400), + messageTextStyle: TextStyle( + color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600)); + + if (!pr.isShowing()) { + await pr.show(); + } else { + await pr.hide(); + await pr.show(); + } + } + + static hideProgressDialog() async { + if (pr.isShowing()) { + await pr.hide(); + } + } } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 406f5b76..62403454 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -1,10 +1,10 @@ +import 'dart:convert'; + import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'dart:convert'; - class MyInAppBrowser extends InAppBrowser { // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT @@ -97,11 +97,18 @@ class MyInAppBrowser extends InAppBrowser { await sharedPref.getString(PUSH_TOKEN); } + getPatientData() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + } + String generateURL(int amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, [var patientData, var servID, var LiveServID]) { - authUser = authProvider.getAuthenticatedUser(); - + getPatientData(); String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = getForm(); @@ -153,12 +160,12 @@ class MyInAppBrowser extends InAppBrowser { } Codec stringToBase64Url = utf8.fuse(base64Url); - String encoded = stringToBase64Url.encode('data:text/html;base64,' + form); // dXNlcm5hbWU6cGFzc3dvcmQ= - String decoded = stringToBase64Url.decode(encoded); // username:password + String encoded = stringToBase64Url + .encode('data:text/html;base64,' + form); // dXNlcm5hbWU6cGFzc3dvcmQ= + String decoded = stringToBase64Url.decode(encoded); // username:password print(form); print(encoded); return encoded; - } String getForm() { diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index e1a42180..3e86397a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -14,6 +14,7 @@ class AppScaffold extends StatelessWidget { final Widget bottomSheet; final bool isLoading; final bool isShowAppBar; + final bool hasAppBarParam; final BaseViewModel baseViewModel; AppScaffold( @@ -21,6 +22,7 @@ class AppScaffold extends StatelessWidget { this.appBarTitle = '', this.isLoading = false, this.isShowAppBar = false, + this.hasAppBarParam, this.bottomSheet, this.baseViewModel}); diff --git a/no-wait-queue.png b/no-wait-queue.png new file mode 100644 index 0000000000000000000000000000000000000000..d87a172ff4a73581d7553b9076ef6af25ada57c5 GIT binary patch literal 3314 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 literal 0 HcmV?d00001 diff --git a/pubspec.yaml b/pubspec.yaml index 1b6090af..372bd628 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -87,6 +87,9 @@ dependencies: #InAppBrowser flutter_inappwebview: ^4.0.0+4 + #ProgressDialog + progress_dialog: ^1.2.4 +