diff --git a/assets/images/verification_faceid_lg_icon.png b/assets/images/verification_faceid_lg_icon.png deleted file mode 100644 index dc206911..00000000 Binary files a/assets/images/verification_faceid_lg_icon.png and /dev/null differ diff --git a/assets/images/verification_fingerprint_lg_icon.png b/assets/images/verification_fingerprint_lg_icon.png deleted file mode 100644 index 559c0671..00000000 Binary files a/assets/images/verification_fingerprint_lg_icon.png and /dev/null differ diff --git a/assets/images/verification_sms_lg_icon.png b/assets/images/verification_sms_lg_icon.png deleted file mode 100644 index 9c316230..00000000 Binary files a/assets/images/verification_sms_lg_icon.png and /dev/null differ diff --git a/assets/images/verification_whatsapp_lg_icon.png b/assets/images/verification_whatsapp_lg_icon.png deleted file mode 100644 index 115a2e6d..00000000 Binary files a/assets/images/verification_whatsapp_lg_icon.png and /dev/null differ diff --git a/assets/images/verify-face.png b/assets/images/verify-face.png new file mode 100644 index 00000000..58e1f4a6 Binary files /dev/null and b/assets/images/verify-face.png differ diff --git a/assets/images/verify-finger.png b/assets/images/verify-finger.png new file mode 100644 index 00000000..15d60b03 Binary files /dev/null and b/assets/images/verify-finger.png differ diff --git a/assets/images/verify-sms.png b/assets/images/verify-sms.png new file mode 100644 index 00000000..e265e1f9 Binary files /dev/null and b/assets/images/verify-sms.png differ diff --git a/assets/images/verify-whtsapp.png b/assets/images/verify-whtsapp.png new file mode 100644 index 00000000..9a79516c Binary files /dev/null and b/assets/images/verify-whtsapp.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 654f704a..52fb8c3f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 80e9d656..194ee2af 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -128,22 +128,22 @@ const Map> localizedValues = { 'description': {'en': 'Description', 'ar': 'الوصف'}, 'value': {'en': 'Value', 'ar': 'القيمة'}, 'range': {'en': 'Range', 'ar': 'النطاق'}, - 'enterId': {'en': 'Enter ID', 'ar': 'الهوية'}, + 'enterId': {'en': 'User ID', 'ar': 'معرف المستخدم'}, 'pleaseEnterYourID': { 'en': 'Please enter your ID', 'ar': 'الرجاء ادخال الهوية' }, - 'enterPassword': {'en': 'Enter Password', 'ar': 'الرقم السري'}, + 'enterPassword': {'en': 'Password', 'ar': 'كلمه السر'}, 'pleaseEnterPassword': { 'en': 'Please Enter Password', 'ar': 'الرجاء ادخال الرقم السري' }, - 'selectYourProject': {'en': 'Select Your Project', 'ar': 'اختر المستشفى'}, + 'selectYourProject': {'en': 'Branch', 'ar': 'فرع'}, 'pleaseEnterYourProject': { 'en': 'Please Enter Your Project', 'ar': 'الرجاء ادخال مستشفى' }, - 'login': {'en': 'LOGIN', 'ar': 'تسجيل دخول'}, + 'login': {'en': 'Login', 'ar': 'تسجيل دخول'}, 'drSulaimanAlHabib': {'en': 'Dr Sulaiman Al Habib', 'ar': 'د.سليمان الحبيب'}, 'welcomeTo': {'en': 'Welcome to', 'ar': 'مرحبا بك'}, 'welcomeBackTo': {'en': 'Welcome Back to', 'ar': 'مرحبًا بعودتك الى '}, @@ -306,6 +306,7 @@ const Map> localizedValues = { 'en': "No sick leave available, apply Now", 'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن' }, + 'no-sickleve': {'en': "No sick leave available", 'ar': 'لا توجد إجازة مرضية'}, 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, 'add': {'en': "Add", 'ar': 'أضف'}, @@ -572,11 +573,14 @@ const Map> localizedValues = { "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" }, "register-user": {"en": "Register", "ar": "تسجيل"}, - "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, - "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, - "verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"}, - "verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"}, - "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, + "verify-with-fingerprint": {"en": "Verify through Fingerprint", "ar": "بصمة"}, + "verify-with-faceid": {"en": "Verify through Face ID", "ar": "معرف الوجه"}, + "verify-with-sms": {"en": "Verify through SMS", "ar": "الرسائل القصيرة"}, + "verify-with-whatsapp": {"en": "Verify through WhatsApp", "ar": " الواتس اب"}, + "last-login": { + "en": "Last login details:", + "ar": "تفاصيل تسجيل الدخول الأخير:" + }, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { "en": @@ -826,11 +830,17 @@ const Map> localizedValues = { "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, "searchHere": {"en": "Search here", "ar": "إبحث هنا"}, "replied": {"en": "Replied", "ar": " تم الرد"}, - "typeHereToReply": { - "en": "Type here to reply", - "ar": "اكتب هنا للرد" - },"remove": { - "en": "Remove", - "ar": "حذف" + "typeHereToReply": {"en": "Type here to reply", "ar": "اكتب هنا للرد"}, + "remove": {"en": "Remove", "ar": "حذف"}, + "changeOfSchedule": {"en": "Change of Schedule", "ar": "تغيير الجدول"}, + "newSchedule": {"en": "New Schedule", "ar": "جدول جديد"}, + "enter_credentials": { + "en": "Enter the user credentials below", + "ar": "أدخل بيانات اعتماد المستخدم أدناه" + + }, + "step": { + "en": "Step", + "ar": "خطوة" }, }; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index 093c4066..097047cf 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -161,9 +161,12 @@ class AdmissionRequestService extends LookupService { ); } - Future getDietTypesList() async { + Future getDietTypesList(int patientMrn) async { hasError = false; + Map body = Map(); + body['patientMRN'] = patientMrn; + await baseAppClient.post( GET_DIET_TYPES, onSuccess: (dynamic response, int statusCode) { @@ -180,7 +183,7 @@ class AdmissionRequestService extends LookupService { hasError = true; super.error = error; }, - body: Map(), + body: body, ); } diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 787aecae..052f78b6 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -101,12 +101,14 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList(String clinicId) async { + Future getDoctorsList(String clinicId, int branchId) async { hasError = false; DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); + _doctorsByClinicIdRequest.projectID = branchId; _doctorsByClinicIdRequest.clinicID = clinicId; + await baseAppClient.post( PATIENT_GET_DOCTOR_BY_CLINIC_URL, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 44261c26..0f0b9bf0 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -114,9 +114,9 @@ class AdmissionRequestViewModel extends BaseViewModel{ } } - Future getDietTypes() async { + Future getDietTypes(int patientMrn) async { setState(ViewState.BusyLocal); - await _admissionRequestService.getDietTypesList(); + await _admissionRequestService.getDietTypesList(patientMrn); if (_admissionRequestService.hasError) { error = _admissionRequestService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 7458456c..f46fe463 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -82,9 +82,9 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors(String clinicId) async { + Future getClinicDoctors(String clinicId, int branchId) async { setState(ViewState.BusyLocal); - await _referralPatientService.getDoctorsList(clinicId); + await _referralPatientService.getDoctorsList(clinicId, branchId); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 9627353f..6632df4d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -62,7 +62,7 @@ class ProcedureViewModel extends BaseViewModel { await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { error = _procedureService.error; - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index dfd00326..7c33c9e0 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -2299,7 +2299,62 @@ "search": [ "obese-bmi-r" ] - } + }, + { + "uid": "3375043683ed20c80d3307cef405e3ff", + "css": "verify-face", + "code": 59395, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M181.3 0H36.2A36.3 36.3 0 0 0 0 36.2V253.7A36.2 36.2 0 0 0 72.5 253.7V72.5H181.3A36.2 36.2 0 1 0 181.3 0ZM181.3 927.5H72.5V746.2A36.2 36.2 0 1 0 0 746.2V963.7A36.3 36.3 0 0 0 36.2 1000H181.3A36.2 36.2 0 1 0 181.3 927.5ZM978.8 0H833.7A36.2 36.2 0 0 0 833.7 72.5H942.5V253.8A36.2 36.2 0 0 0 1015 253.8V36.2A36.3 36.3 0 0 0 978.8 0ZM978.8 710A36.3 36.3 0 0 0 942.5 746.2V927.5H833.8A36.2 36.2 0 0 0 833.8 1000H978.8A36.3 36.3 0 0 0 1015 963.8V746.3A36.3 36.3 0 0 0 978.8 710ZM507.5 144.9A350.9 350.9 0 1 0 858.4 495.8 350.9 350.9 0 0 0 507.5 144.9ZM637 378.9A50.3 50.3 0 1 1 586.7 429.2 50.3 50.3 0 0 1 637 378.9ZM378 378.9A50.3 50.3 0 1 1 327.7 429.2 50.3 50.3 0 0 1 378 378.9ZM696.8 617.8A229.7 229.7 0 0 1 318.1 617.8 30.7 30.7 0 1 1 368.8 582.9 168.3 168.3 0 0 0 646.3 582.9 30.7 30.7 0 1 1 696.8 617.8Z", + "width": 1015 + }, + "search": [ + "verify-face" + ] + }, + { + "uid": "49b31d628bdc0d2127dc489c84c7101b", + "css": "verify-finger", + "code": 59394, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M792.5 147.2H237.8A76.6 76.6 0 0 0 161.3 223.7V778.4A76.6 76.6 0 0 0 237.8 854.9H792.5A76.6 76.6 0 0 0 869.1 778.4V223.7A76.6 76.6 0 0 0 792.5 147.2ZM292.8 283.5C439.9 176.7 595 177.8 739.9 285.4A20.8 20.8 0 0 1 727.6 322.8C704.1 322.8 543.8 152.4 317.1 317.1A20.7 20.7 0 0 1 292.8 283.5ZM486.1 816.8A20.7 20.7 0 0 1 457.2 811.5C428 769.3 361.6 722.1 361.6 633.8A159.5 159.5 0 0 1 515.1 469.3 159.5 159.5 0 0 1 668.7 633.8V655.9A20.7 20.7 0 0 1 627.2 655.9V633.8A118 118 0 0 0 515.2 510.7 118 118 0 0 0 403.3 633.8C403.3 733.7 530.5 786.1 486.2 816.8ZM743.8 709.5A108.7 108.7 0 0 1 538.7 656C538.7 566.5 477.5 596.6 491.1 650.9A20.7 20.7 0 0 1 450.8 661C422.6 548 580.2 502.2 580.2 656A66.9 66.9 0 0 0 632.1 725C728.1 747.7 756.6 589.3 660.8 487.4 528.5 346.3 314.7 455.1 314.7 622.8A167.7 167.7 0 0 0 344.1 732.4 20.7 20.7 0 0 1 310.4 756.5 211.3 211.3 0 0 1 273.3 622.8 245.9 245.9 0 0 1 515.3 380.8C694.1 380.8 807.9 581.4 744.1 709.6ZM757.7 452.8A20.7 20.7 0 0 1 729.4 445.1C688.2 372.8 588.3 333.9 515.3 333.9A296.7 296.7 0 0 0 300.3 446.4 20.7 20.7 0 0 1 265.8 423.4 336.1 336.1 0 0 1 515.3 292.5C668.9 292.5 806 425.3 757.8 452.9ZM181.3 0H36.2A36.3 36.3 0 0 0 0 36.2V253.7A36.2 36.2 0 0 0 72.5 253.7V72.5H181.3A36.2 36.2 0 1 0 181.3 0ZM181.3 927.5H72.5V746.2A36.2 36.2 0 1 0 0 746.2V963.7A36.3 36.3 0 0 0 36.2 1000H181.3A36.2 36.2 0 1 0 181.3 927.5ZM978.8 0H833.7A36.2 36.2 0 0 0 833.7 72.5H942.5V253.8A36.2 36.2 0 0 0 1015 253.8V36.2A36.3 36.3 0 0 0 978.8 0ZM978.8 710A36.3 36.3 0 0 0 942.5 746.2V927.5H833.8A36.2 36.2 0 0 0 833.8 1000H978.8A36.3 36.3 0 0 0 1015 963.8V746.3A36.3 36.3 0 0 0 978.8 710Z", + "width": 1015 + }, + "search": [ + "verify-finger" + ] + }, + { + "uid": "f57a7cc9bc5e75095215adfc141a8b17", + "css": "verify-whtsapp", + "code": 59393, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M132.6 857.5L196.3 666.3A364.2 364.2 0 1 1 340.1 802.9ZM742 601.7C725.1 569.9 663.1 533.6 663.1 533.6 649 525.7 632.1 524.7 624.1 538.8A321.2 321.2 0 0 1 598.8 566.5 47.1 47.1 0 0 1 531.8 559.8L481 508.9 430.1 458A47.1 47.1 0 0 1 423.5 391.3 321.3 321.3 0 0 1 451.1 366C465.4 358.1 464.5 341.1 456.4 327.1 456.4 327.1 420 265 388.2 248.2A34.8 34.8 0 0 0 347.3 254.3L324.8 276.8C253.6 348 288.6 428.5 359.9 499.8L425.3 564.9 490.5 630C561.7 701.3 642.2 736.4 713.5 665.1L735.9 642.6A34.9 34.9 0 0 0 742 601.7ZM181.3 0H36.2A36.3 36.3 0 0 0 0 36.2V253.7A36.2 36.2 0 0 0 72.5 253.7V72.5H181.3A36.2 36.2 0 1 0 181.3 0ZM181.3 927.5H72.5V746.3A36.2 36.2 0 1 0 0 746.3V963.8A36.3 36.3 0 0 0 36.2 1000H181.3A36.2 36.2 0 1 0 181.3 927.5ZM978.8 0H833.7A36.2 36.2 0 0 0 833.7 72.5H942.5V253.8A36.2 36.2 0 0 0 1015 253.8V36.2A36.3 36.3 0 0 0 978.8 0ZM978.8 710A36.3 36.3 0 0 0 942.5 746.3V927.5H833.8A36.2 36.2 0 0 0 833.8 1000H978.8A36.3 36.3 0 0 0 1015 963.8V746.3A36.3 36.3 0 0 0 978.8 710Z", + "width": 1015 + }, + "search": [ + "verify-whtsapp" + ] + }, + { + "uid": "89f9e9928bf0aa0ec55c15055f8ce27a", + "css": "verify-sms", + "code": 59392, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M766.3 175.1H252.2A64.5 64.5 0 0 0 187.9 239.4V817.7L316.4 689.2H766.1A64.5 64.5 0 0 0 830.5 624.8V239.4A64.5 64.5 0 0 0 766.3 175.1ZM412.8 464.4H348.5V400H412.8ZM541.3 464.4H477.2V400H541.3ZM669.8 464.4H605.6V400H669.9ZM181.3 0H36.2A36.3 36.3 0 0 0 0 36.2V253.7A36.2 36.2 0 0 0 72.5 253.7V72.5H181.3A36.2 36.2 0 1 0 181.3 0ZM181.3 927.5H72.5V746.2A36.2 36.2 0 1 0 0 746.2V963.7A36.3 36.3 0 0 0 36.2 1000H181.3A36.2 36.2 0 1 0 181.3 927.5ZM978.8 0H833.7A36.2 36.2 0 0 0 833.7 72.5H942.5V253.8A36.2 36.2 0 0 0 1015 253.8V36.2A36.3 36.3 0 0 0 978.8 0ZM978.8 710A36.3 36.3 0 0 0 942.5 746.2V927.5H833.8A36.2 36.2 0 0 0 833.8 1000H978.8A36.3 36.3 0 0 0 1015 963.8V746.3A36.3 36.3 0 0 0 978.8 710Z", + "width": 1015 + }, + "search": [ + "verify-sms" + ] + } ] - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 00b4d547..a3a0238c 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -202,14 +202,14 @@ class DoctorApp { IconData(0xe857, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData external_link = IconData(0xe858, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_face = - IconData(0xe859, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_sms = - IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + // static const IconData verify_face = + // IconData(0xe859, fontFamily: _kFontFam, fontPackage: _kFontPkg); + // static const IconData verify_sms = + // IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData home = IconData(0xe85b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_finger = - IconData(0xe85c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + // static const IconData verify_finger = + // IconData(0xe85c, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData dr_reply_active = IconData(0xe85d, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData dr_reply = @@ -350,4 +350,12 @@ class DoctorApp { IconData(0xe8a1, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData home_active_1 = IconData(0xe8a2, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_sms = + IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_whtsapp = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_finger = + IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_face = + IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index ce6c0a12..4ae7ed8c 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,4 +1,4 @@ -class GetPatientProgressNoteResModel { +class GetPatientProgressNoteResModel { int appointmentNo; int createdBy; String createdByName; diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index 5a6bd749..c4e52af7 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -5,6 +5,7 @@ class MySelectedAllergy { MasterKeyModel selectedAllergy; String remark; bool isChecked; + bool isExpanded; int createdBy; MySelectedAllergy( @@ -12,6 +13,7 @@ class MySelectedAllergy { this.selectedAllergy, this.remark, this.isChecked, + this.isExpanded = true, this.createdBy}); MySelectedAllergy.fromJson(Map json) { @@ -22,7 +24,8 @@ class MySelectedAllergy { ? new MasterKeyModel.fromJson(json['selectedAllergy']) : null; remark = json['remark']; - remark = json['isChecked']; + isChecked = json['isChecked']; + isExpanded = json['isExpanded']; createdBy = json['createdBy']; } @@ -35,7 +38,8 @@ class MySelectedAllergy { data['selectedAllergy'] = this.selectedAllergy.toJson(); } data['remark'] = this.remark; - data['isChecked'] = this.remark; + data['isChecked'] = this.isChecked; + data['isExpanded'] = this.isExpanded; data['createdBy'] = this.createdBy; return data; } diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 84121abf..957dcc66 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -101,6 +102,7 @@ class _LoginsreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, + backgroundColor: HexColor('#F8F8F8'), body: SafeArea( child: (_isLoading == false) ? ListView(children: [ @@ -116,6 +118,9 @@ class _LoginsreenState extends State { CrossAxisAlignment.start, children: [ AuthHeader(loginType.knownUser), + SizedBox( + height: 60, + ), LoginForm( changeLoadingStata: changeLoadingStata, ), diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 0045f032..40fe4bd6 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import '../../lookups/auth_lookup.dart'; import '../../widgets/auth/auth_header.dart'; @@ -43,13 +44,18 @@ class _VerificationMethodsScreenState extends State { return AppScaffold( isLoading: _isLoading, isShowAppBar: false, + isHomeIcon: false, + backgroundColor: HexColor('#F8F8F8'), body: ListView(children: [ Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AuthHeader(loginType.verificationMethods), + // AuthHeader(loginType.verificationMethods), + SizedBox( + height: 50, + ), VerificationMethods( password: widget.password, changeLoadingStata: changeLoadingStata, diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 25ea1f22..bc3323ad 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -468,10 +468,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'ICD', - fontWeight: - FontWeight - .w700, + 'ICD: ', + fontSize: 13.0, ), AppText( model @@ -488,14 +486,20 @@ class _MedicalFileDetailsState extends State { index] .iCD10 .trim(), + fontSize: 13.5, + fontWeight: + FontWeight + .w700, ), SizedBox( - width: 35.0), + width: 15.0), + ], + ), + Row( + children: [ AppText( 'Condition: ', - fontWeight: - FontWeight - .w700, + fontSize: 12.5, ), Expanded( child: AppText( @@ -514,6 +518,10 @@ class _MedicalFileDetailsState extends State { index] .condition .trim(), + fontSize: 13.0, + fontWeight: + FontWeight + .w700, ), ), ], @@ -539,6 +547,7 @@ class _MedicalFileDetailsState extends State { fontWeight: FontWeight .w700, + fontSize: 15.0, ), ) ], @@ -547,24 +556,29 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Type: ', - fontWeight: - FontWeight - .w700, + fontSize: 15.5, ), Expanded( - child: AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .type), + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .type, + fontSize: 16.0, + fontWeight: + FontWeight + .w700, + ), ), ], ), @@ -700,9 +714,6 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Procedure ID: ', - fontWeight: - FontWeight - .w700, ), AppText( model @@ -720,6 +731,11 @@ class _MedicalFileDetailsState extends State { index] .procedureId .trim(), + fontSize: + 13.5, + fontWeight: + FontWeight + .w700, ), ], ), @@ -729,9 +745,6 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Order Date: ', - fontWeight: - FontWeight - .w700, ), AppText( Helpers.getDateFormatted( @@ -755,6 +768,9 @@ class _MedicalFileDetailsState extends State { )), fontSize: 13.5, + fontWeight: + FontWeight + .w700, ), ], ), @@ -792,23 +808,26 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'CPT Code : ', + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .patientID + .toString(), fontWeight: FontWeight .w700, ), - AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstProcedure[ - index] - .patientID - .toString()), ], ), SizedBox( @@ -924,22 +943,25 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Exam Type: ', + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .examDesc, fontWeight: FontWeight .w700, ), - AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstPhysicalExam[ - index] - .examDesc), ], ), Row( @@ -968,22 +990,25 @@ class _MedicalFileDetailsState extends State { children: [ AppText( 'Abnormal: ', + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .abnormal, fontWeight: FontWeight .w700, ), - AppText(model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstPhysicalExam[ - index] - .abnormal), ], ), SizedBox( diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index f4b26f6a..99948bed 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -32,6 +32,9 @@ class _UcafDetailScreenState extends State { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + final screenSize = MediaQuery.of(context).size; return BaseView( diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index d4c1b803..18939d54 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -3,9 +3,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -53,337 +56,385 @@ class _UCAFInputScreenState extends State { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) => model.getUCAFData(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, body: model.patientVitalSigns != null && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 - ? SingleChildScrollView( - child: Column( - children: [ - PatientHeaderWidgetNoAvatar(patient), - Container( - margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + ? Column( + children: [ + Expanded( + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CheckboxListTile( - title: AppText( - TranslationBase.of(context).inPatient, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, + // PatientHeaderWidgetNoAvatar(patient), + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).patient}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).ucaf}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], ), - value: _inPatient, - onChanged: (newValue) { - setState(() { - _inPatient = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), ), - CheckboxListTile( - title: AppText( - TranslationBase.of(context).emergencyCase, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _emergencyCase, - onChanged: (newValue) { - setState(() { - _emergencyCase = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), + PageStepperWidget( + stepsCount: 2, + currentStepIndex: 1, + screenSize: screenSize, ), Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .durationOfIllness, - null, - false), - enabled: true, - controller: _durationOfIllnessController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - keyboardType: TextInputType.number, - )), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "BP (H/L)", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, + margin: EdgeInsets.symmetric( + vertical: 0, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CheckboxListTile( + title: AppText( + TranslationBase.of(context).inPatient, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, ), - AppText( - "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, + value: _inPatient, + onChanged: (newValue) { + setState(() { + _inPatient = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context).emergencyCase, fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, ), - ], - ), - SizedBox( - width: 4, - ), - Expanded( - child: Row( + value: _emergencyCase, + onChanged: (newValue) { + setState(() { + _emergencyCase = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: + TranslationBase.of(context).durationOfIllness, + dropDownText: "3", + inputType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + ), + SizedBox( + height: 16, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + "BP (H/L)", + fontSize: + SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}", + fontSize: + SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.w700, + ), + ], ), SizedBox( - width: 8, + width: 4, ), Expanded( - child: AppText( - "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).temperature}", + fontSize: + SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", + fontSize: + SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.w700, + ), + ), + ], ), ), ], ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).pulseBeats} :", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.pulseBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context) - .chiefComplaintsAndSymptoms, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 8, - ), - AppText( - TranslationBase.of(context) - .patientFeelsPainInHisBackAndCough, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .additionalTextComplaints, - helpers.parseHtmlString(model - .patientChiefComplaintList[0] - .chiefComplaint), - false), - enabled: false, - controller: _additionalComplaintsController, - keyboardType: TextInputType.multiline, - minLines: 1, - maxLines: 20, - )), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).otherConditions, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - ...List.generate( - conditionsData.length, - (index) => CheckboxListTile( - title: AppText( - conditionsData[index]['name'], - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, + SizedBox( + height: 4, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).pulseBeats} :", + fontSize: + SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.pulseBeatPerMinute}", + fontSize: + SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.w700, + ), + ], ), - value: conditionsData[index]['isChecked'], - onChanged: (newValue) { - setState(() { - conditionsData[index]['isChecked'] = - newValue; - }); - }, - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - )), - SizedBox( - height: 8, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).other, - null, - false), - enabled: true, - controller: _otherController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 8, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).how, - null, - false), - enabled: true, - controller: _howController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 8, - ), - Row( - children: [ - Expanded( - child: Container( + ], + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).chiefComplaintsAndSymptoms, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 4, + ), + AppText( + TranslationBase.of(context) + .patientFeelsPainInHisBackAndCough, + fontFamily: 'Poppins', + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + SizedBox( + height: 8, + ), + AppTextFieldCustom( + hintText: TranslationBase.of(context).instruction, + dropDownText: helpers.parseHtmlString(model + .patientChiefComplaintList[0] + .chiefComplaint), + controller: _additionalComplaintsController, + inputType: TextInputType.multiline, + enabled: false, + minLines: 1, + maxLines: 20, + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).otherConditions, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ...List.generate( + conditionsData.length, + (index) => CheckboxListTile( + title: AppText( + conditionsData[index]['name'], + fontWeight: FontWeight.bold, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + value: conditionsData[index] + ['isChecked'], + onChanged: (newValue) { + setState(() { + conditionsData[index] + ['isChecked'] = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + )), + SizedBox( + height: 8, + ), + Container( height: screenSize.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).when, + TranslationBase.of(context).other, null, false), enabled: true, - controller: _whenController, + controller: _otherController, keyboardType: TextInputType.text, )), - ), - SizedBox( - width: 4, - ), - Expanded( - child: Container( + SizedBox( + height: 8, + ), + Container( height: screenSize.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).where, + TranslationBase.of(context).how, null, false), enabled: true, - controller: _whereController, + controller: _howController, keyboardType: TextInputType.text, )), - ), - ], - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .specifyPossibleLineManagement, - null, - false), - enabled: true, - controller: _managementsLineController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).significantSigns, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).backAbdomen, - null, - false), - enabled: true, - controller: _signsController, - keyboardType: TextInputType.multiline, - minLines: null, - maxLines: null, - )), - SizedBox( - height: 16, - ), - AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#B8382B"), - onPressed: () { - Navigator.of(context).pushNamed( - PATIENT_UCAF_DETAIL, - arguments: {'patient': patient}); - }, + SizedBox( + height: 8, + ), + Row( + children: [ + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of(context) + .when, + null, + false), + enabled: true, + controller: _whenController, + keyboardType: TextInputType.text, + )), + ), + SizedBox( + width: 4, + ), + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of(context) + .where, + null, + false), + enabled: true, + controller: _whereController, + keyboardType: TextInputType.text, + )), + ), + ], + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .specifyPossibleLineManagement, + null, + false), + enabled: true, + controller: _managementsLineController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).significantSigns, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .backAbdomen, + null, + false), + enabled: true, + controller: _signsController, + keyboardType: TextInputType.multiline, + minLines: null, + maxLines: null, + )), + ], + ), ), ], ), ), - ], - ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#D02127"), + onPressed: () { + Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, + arguments: {'patient': patient}); + }, + ), + ), + ], ) : Container( child: Center( diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart new file mode 100644 index 00000000..5e93f141 --- /dev/null +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -0,0 +1,145 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class PageStepperWidget extends StatelessWidget { + final int stepsCount; + final int currentStepIndex; + final Size screenSize; + + PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize}); + + @override + Widget build(BuildContext context) { + double dividerWidth = (screenSize.width / stepsCount) - (10 * stepsCount); + + return Container( + margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + for (int i = 1; i <= stepsCount; i++) + if (i == currentStepIndex) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, + dividerWidth) + else + StepWidget(i, false, i == stepsCount, i < currentStepIndex, + dividerWidth) + ], + ) + ], + ), + ); + } +} + +class StepWidget extends StatelessWidget { + final int index; + final bool isInProgress; + final bool isFinalStep; + final bool isStepFinish; + final double dividerWidth; + + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, + this.dividerWidth); + + @override + Widget build(BuildContext context) { + StepStatus status; + if (isInProgress) { + status = StepStatus.InProgress; + } else { + if(isStepFinish){ + status = StepStatus.Completed; + }else { + status = StepStatus.Locked; + } + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: EdgeInsets.all(0.0), + margin: EdgeInsets.symmetric(horizontal: 1), + width: 25, + height: 25, + decoration: BoxDecoration( + color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), + shape: BoxShape.circle, + border: Border.all( + color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), + width: 1), + ), + child: Center( + child: Icon( + Icons.check, + size: 20, + color: status == StepStatus.InProgress ? Colors.white : status == StepStatus.Locked ? Colors.grey.shade800 : Color(0xFF359846), + )), + ), + if (!isFinalStep) + Container( + width: dividerWidth, + height: 2, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 8, + ), + AppText( + "${TranslationBase.of(context).step} $index", + fontWeight: FontWeight.bold, + color: status == StepStatus.InProgress ? Colors.black : status == StepStatus.Locked ? Colors.grey : Color(0xFF359846), + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + Container( + margin: EdgeInsets.symmetric(vertical: 4), + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + decoration: BoxDecoration( + color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + child: AppText( + status == StepStatus.InProgress + ? "inProgress" + : status == StepStatus.Locked + ? "Locked" + : "Completed", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFF969696) + : Color(0xFF359846), + ), + ) + ], + ); + } +} + +enum StepStatus { + InProgress, + Locked, + Completed, +} \ No newline at end of file diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 3fa16be2..8095d04a 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -55,7 +56,9 @@ class _AdmissionRequestThirdScreenState return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { @@ -72,9 +75,8 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientPageHeaderWidget(patient), - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), + // PatientProfileHeaderNewDesign( + // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -220,23 +222,24 @@ class _AdmissionRequestThirdScreenState SizedBox( height: 10, ), - CheckboxListTile( - title: AppText( - TranslationBase.of(context).patientPregnant, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, + if(patient.gender != 1) + CheckboxListTile( + title: AppText( + TranslationBase.of(context).patientPregnant, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.0, + ), + value: _patientPregnant, + activeColor: HexColor("#D02127"), + onChanged: (newValue) { + setState(() { + _patientPregnant = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), ), - value: _patientPregnant, - activeColor: HexColor("#D02127"), - onChanged: (newValue) { - setState(() { - _patientPregnant = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), CheckboxListTile( title: AppText( TranslationBase.of(context).isSickLeaveRequired, @@ -287,7 +290,7 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog( context); - await model.getDietTypes().then((_) => + await model.getDietTypes(patient.patientId).then((_) => GifLoaderDialogUtils.hideDialog( context)); if (model.state == ViewState.Idle && diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index b5cf732a..a48a7c45 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -51,7 +52,9 @@ class _AdmissionRequestThirdScreenState return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { @@ -67,8 +70,6 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 987f5f43..2dcfbbf9 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -63,7 +64,9 @@ class _AdmissionRequestSecondScreenState return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { @@ -79,8 +82,8 @@ class _AdmissionRequestSecondScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), + // PatientProfileHeaderNewDesign( + // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 43c1382e..2619b200 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -303,7 +303,7 @@ class _PatientMakeReferralScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await model .getClinicDoctors( - _selectedClinic['ClinicID'].toString()) + _selectedClinic['ClinicID'].toString(), _selectedBranch['facilityId']) .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 31595fa6..1b51ba30 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -162,12 +162,15 @@ class ProcedureCard extends StatelessWidget { ), if (entityList.categoryID == 2 || entityList.categoryID == 4) - Icon(Icons.edit) + InkWell( + child: Icon(Icons.edit), + onTap: onTap, + ) ], ) ], ), - onTap: onTap, + //onTap: onTap, ), ), ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 7060a77f..e8fdd882 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -115,31 +115,28 @@ class ProcedureScreen extends StatelessWidget { model.procedureList[0].entityList[index].categoryID, entityList: model.procedureList[0].entityList[index], onTap: () { - // if (model.procedureList[0].entityList[index] - // .categoryID == - // 2 || - // model.procedureList[0].entityList[index] - // .categoryID == - // 4) { - updateProcedureForm(context, - model: model, - patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model - .procedureList[0].entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model - .procedureList[0].entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index] - .lineItemNo); + if (model.procedureList[0].entityList[index].categoryID == + 2 || + model.procedureList[0].entityList[index].categoryID == 4) + updateProcedureForm(context, + model: model, + patient: patient, + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model.procedureList[0] + .entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model.procedureList[0] + .entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0] + .entityList[index].lineItemNo); // } else // helpers.showErrorToast( // 'You Cant Update This Procedure'); diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 8981f374..41f7c6aa 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -155,9 +155,16 @@ class AddRescheduleLeavScreen extends StatelessWidget { item.requisitionType == 1 ? TranslationBase.of(context) .offTime - : TranslationBase.of(context) - .holiday + - ' ', + : item.requisitionType == 2 + ? TranslationBase.of(context) + .holiday + : item.requisitionType == 3 + ? TranslationBase.of( + context) + .changeOfSchedule + : TranslationBase.of( + context) + .newSchedule, fontWeight: FontWeight.bold, )), SizedBox( diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 1c7199fa..ba90cf6e 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -233,7 +233,21 @@ class AddSickLeavScreen extends StatelessWidget { )); }).toList(), ) - : SizedBox() + : patient.patientStatusType != 43 + ? Container( + height: 200, + width: SizeConfig.screenWidth, + color: Colors.white, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noSickLeave, + color: Colors.red, + ) + ]), + ) + : SizedBox() // : new Builder(builder: (context) { // return Column( // crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6eba28fc..6094331f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -661,7 +661,8 @@ class TranslationBase { String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => localizedValues['bmiObeseExtreme'][locale.languageCode]; + String get bmiObeseExtreme => + localizedValues['bmiObeseExtreme'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; @@ -1204,9 +1205,19 @@ class TranslationBase { String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get typeHereToReply => + localizedValues['typeHereToReply'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode]; + + String get step => localizedValues['step'][locale.languageCode]; + + String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; + String get changeOfSchedule => + localizedValues['changeOfSchedule'][locale.languageCode]; + String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; + String get enterCredentials => + localizedValues['enter_credentials'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/auth_header.dart b/lib/widgets/auth/auth_header.dart index 8ab79b5c..364cfc85 100644 --- a/lib/widgets/auth/auth_header.dart +++ b/lib/widgets/auth/auth_header.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -23,18 +24,18 @@ class AuthHeader extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: SizeConfig.isMobile - ? EdgeInsetsDirectional.fromSTEB( - 0, SizeConfig.realScreenHeight * 0.03, 0, 0) - : EdgeInsetsDirectional.fromSTEB( - SizeConfig.realScreenWidth * 0.13, 0, 0, 0), - child: buildImageLogo(), - ), + // Container( + // margin: SizeConfig.isMobile + // ? EdgeInsetsDirectional.fromSTEB( + // 0, SizeConfig.realScreenHeight * 0.03, 0, 0) + // : EdgeInsetsDirectional.fromSTEB( + // SizeConfig.realScreenWidth * 0.13, 0, 0, 0), + // child: buildImageLogo(), + // ), SizedBox( - height: 10, + height: 30, ), - buildTextUnderLogo(context), + //buildTextUnderLogo(context), ], ), Column( @@ -146,15 +147,15 @@ class AuthHeader extends StatelessWidget { return Container(); } return Container( - margin: SizeConfig.isMobile - ? null - : EdgeInsetsDirectional.fromSTEB( - SizeConfig.realScreenWidth * 0.13, 0, 0, 0), + // margin: SizeConfig.isMobile + // ? null + // : EdgeInsetsDirectional.fromSTEB( + // SizeConfig.realScreenWidth * 0.13, 0, 0, 0), child: Text( "Doctor App", style: TextStyle( fontSize: - SizeConfig.isMobile ? 26 : SizeConfig.realScreenWidth * 0.030, + SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w800, color: HexColor('#B8382C')), ), @@ -170,10 +171,10 @@ class AuthHeader extends StatelessWidget { return Text( TranslationBase.of(context).drSulaimanAlHabib, style: TextStyle( - fontWeight: FontWeight.w800, - fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, - color: HexColor('#B8382C'), - ), + fontWeight: FontWeight.w800, + fontSize: + SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, + fontFamily: 'Poppins'), ); } @@ -187,11 +188,11 @@ class AuthHeader extends StatelessWidget { userType == loginType.verificationMethods) { return Text(''); } - return Text( + return AppText( text, - style: TextStyle( - fontSize: - SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029), + // style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, ); } } diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index c52e9a77..c59c01d9 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,6 +1,9 @@ import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -72,119 +75,212 @@ class _LoginFormState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ buildSizedBox(), - TextFormField( - keyboardType: TextInputType.number, - textInputAction: TextInputAction.next, - decoration: buildInputDecoration( - context, - TranslationBase.of(context).enterId, - 'assets/images/user_id_icon.png'), - validator: (value) { - if (value.isEmpty) { - return TranslationBase.of(context).pleaseEnterYourID; - } - return null; - }, - onSaved: (value) { - userInfo.userID = value.trim(); - }, - onChanged: (value) { - userInfo.userID = value.trim(); - }, - onFieldSubmitted: (_) { - focusPass.nextFocus(); - }, - onEditingComplete: () {}, - autofocus: false, - ), + Padding( + child: AppText( + TranslationBase.of(context).enterCredentials, + fontSize: 18, + fontWeight: FontWeight.w600, + ), + padding: EdgeInsets.only(top: 10, bottom: 10)), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).enterId, + fontWeight: FontWeight.w600, + )), + AppTextFormField( + labelText: '', + borderColor: Colors.white, + // keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context).enterId, + // 'assets/images/user_id_icon.png'), + validator: (value) { + if (value != null && value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterYourID; + } + return null; + }, + onSaved: (value) { + if (value != null) userInfo.userID = value.trim(); + }, + onChanged: (value) { + if (value != null) userInfo.userID = value.trim(); + }, + onFieldSubmitted: (_) { + focusPass.nextFocus(); + }, + // onEditingComplete: () {}, + // autofocus: false, + ) + ])), buildSizedBox(), - TextFormField( - focusNode: focusPass, - obscureText: true, - textInputAction: TextInputAction.next, - decoration: buildInputDecoration( - context, - TranslationBase.of(context).enterPassword, - 'assets/images/password_icon.png'), - validator: (value) { - if (value.isEmpty) { - return TranslationBase.of(context).pleaseEnterPassword; - } - return null; - }, - onSaved: (value) { - userInfo.password = value; - }, - onFieldSubmitted: (_) { - focusPass.nextFocus(); - helpers.showCupertinoPicker( - context, projectsList, 'facilityName', onSelectProject); - }, - onTap: () { - this.getProjects(userInfo.userID); - }, - ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).enterPassword, + fontWeight: FontWeight.w600, + )), + AppTextFormField( + focusNode: focusPass, + obscureText: true, + borderColor: Colors.white, + textInputAction: TextInputAction.next, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context).enterPassword, + // 'assets/images/password_icon.png'), + validator: (value) { + if (value != null && value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterPassword; + } + return null; + }, + onSaved: (value) { + userInfo.password = value; + }, + onFieldSubmitted: (_) { + focusPass.nextFocus(); + helpers.showCupertinoPicker(context, projectsList, + 'facilityName', onSelectProject); + }, + onTap: () { + this.getProjects(userInfo.userID); + }, + ) + ])), buildSizedBox(), projectsList.length > 0 - ? TextFormField( - focusNode: focusProject, - controller: projectIdController, - onTap: () { - helpers.showCupertinoPicker(context, projectsList, - 'facilityName', onSelectProject); - }, - showCursor: false, - //readOnly: true, - decoration: buildInputDecoration( - context, - TranslationBase.of(context).selectYourProject, - 'assets/images/password_icon.png'), - validator: (value) { - if (value.isEmpty) { - return TranslationBase.of(context) - .pleaseEnterYourProject; - } - return null; - }) - : TextFormField( - readOnly: true, - decoration: buildInputDecoration( - context, - TranslationBase.of(context).pleaseEnterYourProject, - 'assets/images/password_icon.png')), + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).selectYourProject, + fontWeight: FontWeight.w600, + )), + AppTextFormField( + focusNode: focusProject, + controller: projectIdController, + borderColor: Colors.white, + onTap: () { + helpers.showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject); + }, + // showCursor: false, + // //readOnly: true, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context).selectYourProject, + // 'assets/images/password_icon.png'), + validator: (value) { + if (value != null && value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterYourProject; + } + return null; + }) + ])) + : Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).selectYourProject, + fontWeight: FontWeight.w600, + )), + AppTextFormField( + readOnly: true, borderColor: Colors.white + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context) + // .pleaseEnterYourProject, + // 'assets/images/password_icon.png') + + ) + ])), buildSizedBox(), + Row( - mainAxisAlignment: MainAxisAlignment.end, children: [ - RaisedButton( - onPressed: () { + Expanded( + child: Button( + title: TranslationBase.of(context).login, + color: Colors.red[700], + onTap: () { login(context, authProv, widget.changeLoadingStata); }, - textColor: Colors.white, - elevation: 0.0, - padding: const EdgeInsets.all(0.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))), - child: Container( - padding: const EdgeInsets.all(10.0), - height: 50, - width: SizeConfig.realScreenWidth * 0.35, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(TranslationBase.of(context).login, - style: TextStyle( - fontSize: SizeConfig.isMobilePortrait - ? 2.3 * SizeConfig.textMultiplier - : 2.3 * SizeConfig.textMultiplier)), - Image.asset('assets/images/login_btn_arrow_icon.png') - ], - ), - ), - ) + )), ], - ), + ) + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // RaisedButton( + // onPressed: () { + // login(context, authProv, widget.changeLoadingStata); + // }, + // textColor: Colors.white, + // elevation: 0.0, + // padding: const EdgeInsets.all(0.0), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10), + // side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))), + // child: Container( + // padding: const EdgeInsets.all(10.0), + // height: 50, + // width: SizeConfig.realScreenWidth * 0.35, + // child: ), + // ) + // ], + // ), ], ), ), @@ -200,23 +296,24 @@ class _LoginFormState extends State { */ InputDecoration buildInputDecoration(BuildContext context, hint, asset) { return InputDecoration( - prefixIcon: Image.asset(asset), + // prefixIcon: Image.asset(asset), hintText: hint, hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), + fillColor: Colors.white, enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), + //borderRadius: BorderRadius.all(Radius.circular(20)), borderSide: BorderSide(color: HexColor('#CCCCCC')), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), + // borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(color: Theme.of(context).primaryColor), ), errorBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), + // borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(color: Theme.of(context).errorColor), ), focusedErrorBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), + // borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(color: Theme.of(context).errorColor), ), ); diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 5e8d7674..cbd2e730 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -114,13 +114,13 @@ class _VerificationMethodsState extends State { } else { return SingleChildScrollView( child: Container( - height: SizeConfig.realScreenHeight, + height: SizeConfig.realScreenHeight * .9, width: SizeConfig.realScreenWidth, child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - // height: SizeConfig.realScreenHeight * 0.6, child: Column( children: [ user != null && isMoreOption == false @@ -130,13 +130,13 @@ class _VerificationMethodsState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText(TranslationBase.of(context) + .welcomeBack), AppText( - TranslationBase.of(context) - .welcomeBack + - ' ' + - user.doctorName, + Helpers.capitalize(user.doctorName), fontSize: SizeConfig.textMultiplier * 3.5, + fontWeight: FontWeight.bold, ), SizedBox( height: 20, @@ -145,55 +145,86 @@ class _VerificationMethodsState extends State { TranslationBase.of(context).accountInfo, fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.w600, ), SizedBox( height: 20, ), Card( - color: Colors.grey[300], + color: Colors.white, child: Row( children: [ Flexible( + flex: 4, child: ListTile( - title: Text( - TranslationBase.of(context) - .lastLoginAt, - textAlign: TextAlign.center, - overflow: - TextOverflow.ellipsis, - ), - subtitle: Text( - user.editedOn != null - ? formatDate(Helpers - .convertStringToDate( - user.editedOn)) - : user.createdOn != null - ? formatDate(Helpers - .convertStringToDate(user - .createdOn)) - : '--', - overflow: - TextOverflow.ellipsis, - textAlign: - TextAlign.center), - )), + title: Text( + TranslationBase.of( + context) + .lastLoginAt, + overflow: TextOverflow + .ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600, + ), + ), + subtitle: AppText( + getType( + user.logInTypeID, + context), + ) + // Text( + // user.editedOn != null + // ? formatDate(Helpers + // .convertStringToDate( + // user.editedOn)) + // : user.createdOn != null + // ? formatDate(Helpers + // .convertStringToDate(user + // .createdOn)) + // : '--', + // overflow: + // TextOverflow.ellipsis, + // style: TextStyle( + // fontFamily: 'Poppins'), + // textAlign: + // TextAlign.center), + )), Flexible( + flex: 2, child: ListTile( - title: Text( - TranslationBase.of(context) - .lastLoginWith, - overflow: - TextOverflow.ellipsis, - textAlign: - TextAlign.center), - subtitle: Text( - getType(user.logInTypeID, - context), - overflow: - TextOverflow.ellipsis, - textAlign: - TextAlign.center), - )) + title: AppText( + user.editedOn != null + ? getDate(Helpers + .convertStringToDate( + user + .editedOn)) + : user.createdOn != + null + ? getDate(Helpers + .convertStringToDate( + user.createdOn)) + : '--', + textAlign: + TextAlign.right, + ), + subtitle: AppText( + user.editedOn != null + ? getTime(Helpers + .convertStringToDate( + user + .editedOn)) + : user.createdOn != + null + ? getTime(Helpers + .convertStringToDate( + user.createdOn)) + : '--', + textAlign: + TextAlign.right, + ), + )) ], )), ], @@ -232,6 +263,11 @@ class _VerificationMethodsState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ + // Expanded( + // child: + // getButton(3, authProv)), + // Expanded( + // child: getButton(4, authProv)) Expanded( child: InkWell( onTap: () => { @@ -243,7 +279,17 @@ class _VerificationMethodsState extends State { authProv))), Expanded( child: getButton(5, authProv)) - ]) + ]), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.center, + // children: [ + // Expanded( + // child: getButton(1, authProv)), + // Expanded( + // child: getButton(2, authProv)) + // ], + // ) ]) : Column( mainAxisAlignment: MainAxisAlignment.start, @@ -290,6 +336,7 @@ class _VerificationMethodsState extends State { child: Button( title: TranslationBase.of(context) .useAnotherAccount, + color: Colors.red[700], onTap: () { Navigator.of(context).pushNamed(LOGIN); }, @@ -424,25 +471,33 @@ class _VerificationMethodsState extends State { case 2: return InkWell( onTap: () => {authenticateUser(2, true, authProv)}, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, + child: Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), child: Padding( - padding: EdgeInsets.fromLTRB(30, 15, 30, 15), + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - 'assets/images/login/104.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, + Row( + children: [ + Image.asset( + 'assets/images/verify-whtsapp.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + ], ), SizedBox( height: 20, ), AppText( TranslationBase.of(context).verifyWhatsApp, - fontSize: SizeConfig.textMultiplier * 2, - textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 2.2, ) ], ), @@ -451,16 +506,20 @@ class _VerificationMethodsState extends State { case 1: return InkWell( onTap: () => {authenticateUser(1, true, authProv)}, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, + child: Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), child: Padding( - padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), child: Column( mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/login/103.png', + 'assets/images/verify-sms.png', height: SizeConfig.imageSizeMultiplier * 13, width: SizeConfig.imageSizeMultiplier * 16, ), @@ -475,8 +534,7 @@ class _VerificationMethodsState extends State { TranslationBase.of(context).verifySMS, fontSize: projectsProvider.isArabic ? SizeConfig.textMultiplier * 1.8 - : SizeConfig.textMultiplier * 2, - textAlign: TextAlign.center, + : SizeConfig.textMultiplier * 2.2, ) ], ), @@ -488,19 +546,20 @@ class _VerificationMethodsState extends State { if (checkIfBiometricAvailable(BiometricType.fingerprint)) {authenticateUser(3, true, authProv)} }, - child: RoundedContainer( - backgroundColor: - checkIfBiometricAvailable(BiometricType.fingerprint) - ? Colors.white - : Colors.white.withOpacity(.7), - borderColor: Colors.grey, - showBorder: true, + child: Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), child: Padding( - padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/login/102.png', + 'assets/images/verification_fingerprint_icon.png', height: SizeConfig.imageSizeMultiplier * 13, width: SizeConfig.imageSizeMultiplier * 16, ), @@ -509,8 +568,7 @@ class _VerificationMethodsState extends State { ), AppText( TranslationBase.of(context).verifyFingerprint, - fontSize: SizeConfig.textMultiplier * 2, - textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 2.2, ) ], ), @@ -523,33 +581,40 @@ class _VerificationMethodsState extends State { authenticateUser(4, true, authProv); } }, - child: RoundedContainer( - backgroundColor: checkIfBiometricAvailable(BiometricType.face) - ? Colors.white - : Colors.white.withOpacity(.7), - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB(5, 15, 5, 15), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/login/101.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, - ), - SizedBox( - height: 20, + child: + // RoundedContainer( + // backgroundColor: checkIfBiometricAvailable(BiometricType.face) + // ? Colors.white + // : Colors.white.withOpacity(.7), + // borderColor: Colors.grey, + // showBorder: false, + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), + margin: EdgeInsets.all(10), + child: Padding( + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/verification_faceid_icon.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyFaceID, + fontSize: SizeConfig.textMultiplier * 2.2, + ) + ], ), - AppText( - TranslationBase.of(context).verifyFaceID, - fontSize: SizeConfig.textMultiplier * 2, - textAlign: TextAlign.center, - ) - ], - ), - ))); + ))); break; default: @@ -559,13 +624,19 @@ class _VerificationMethodsState extends State { isMoreOption = true; }) }, - child: RoundedContainer( - backgroundColor: Colors.white, - borderColor: Colors.grey, - showBorder: true, + child: Container( + // backgroundColor: Colors.white, + // borderColor: Colors.grey, + // showBorder: false, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), child: Padding( - padding: EdgeInsets.fromLTRB(5, 0, 5, 5), + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( 'assets/images/login/more_icon.png', @@ -574,15 +645,15 @@ class _VerificationMethodsState extends State { ), projectsProvider.isArabic ? SizedBox( - height: 15, + height: 20, ) : SizedBox( height: 10, ), AppText( TranslationBase.of(context).moreVerification, - fontSize: SizeConfig.textMultiplier * 2, - textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 2.2, + // textAlign: TextAlign.center, ) ], ), @@ -800,4 +871,16 @@ class _VerificationMethodsState extends State { helpers.showErrorToast(err); }); } + + getDate(DateTime date) { + final DateFormat formatter = DateFormat('dd MMM yyyy'); + + return formatter.format(date); + } + + getTime(DateTime date) { + final DateFormat formatter = DateFormat('HH:mm a'); + + return formatter.format(date); + } } diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index fb5a9a0c..951e14ed 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -59,6 +60,7 @@ class SMSOTP { builder: (context) { projectProvider = Provider.of(context); return AlertDialog( + contentPadding: EdgeInsets.fromLTRB(24.0, 20.0, 0.0, 24.0), title: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -72,8 +74,8 @@ class SMSOTP { ) ], ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0))), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.all(Radius.circular(10.0))), content: StatefulBuilder(builder: (context, setState) { if (displayTime == '') { startTimer(setState); @@ -85,11 +87,23 @@ class SMSOTP { child: Center( child: SingleChildScrollView( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ type == 1 - ? Image.asset('assets/images/login/103.png') - : Image.asset('assets/images/login/104.png'), + ? Padding( + child: Icon( + DoctorApp.verify_sms_1, + size: 40, + ), + padding: EdgeInsets.only(bottom: 20), + ) + : Padding( + child: Icon( + DoctorApp.verify_whtsapp, + size: 40, + ), + padding: EdgeInsets.only(bottom: 20), + ), Padding( padding: EdgeInsets.only(top: 5), child: AppText( @@ -98,7 +112,8 @@ class SMSOTP { mobileNo .toString() .substring(mobileNo.toString().length - 3), - textAlign: TextAlign.center, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, )), Form( key: verifyAccountForm, @@ -220,13 +235,18 @@ class SMSOTP { ), Padding( padding: EdgeInsets.only(top: 10), - child: AppText( - TranslationBase.of(context).validationMessage + - ' ' + - displayTime, - color: Colors.red, - textAlign: TextAlign.center, - )) + child: Row(children: [ + AppText( + TranslationBase.of(context).validationMessage + ' ', + fontWeight: FontWeight.w600, + ), + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ) + ])) ], ))), ); @@ -248,15 +268,15 @@ class SMSOTP { // contentPadding: EdgeInsets.only(top: 20, bottom: 20), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.black), + borderSide: BorderSide(color: Colors.grey[100]), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).primaryColor), + borderSide: BorderSide(color: Colors.grey[100]), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Colors.grey[100]), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 3ac6888e..bfe8fcad 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -15,9 +15,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final PatiantInformtion patient; final String patientType; final String arrivalType; + final double height; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); @override Widget build(BuildContext context) { @@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: 200, + height: height == 0 ? 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 4de0e439..ddb52e84 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -27,6 +27,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre final String invoiceNO; final String orderNo; final bool isPrescriptions; + final String clinic; PatientProfileHeaderWhitAppointmentAppBar( {this.patient, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 512e6d49..8dc2a8c0 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -151,7 +151,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).myReferral, + nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 3ad583d0..0abc84c7 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -22,18 +22,21 @@ class StepsWidget extends StatelessWidget { children: [ Container( height: height == 0 ? 150 : height, - width: MediaQuery.of(context).size.width, + width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, child: Center( - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, + child: Container( + width: MediaQuery.of(context).size.width * 0.87, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), ), ), ), Positioned( - top: 50, + top: 43, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -84,8 +87,11 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, - left: MediaQuery.of(context).size.width * 0.28, + top: 43, + left: MediaQuery + .of(context) + .size + .width * 0.25, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -137,8 +143,11 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, - left: MediaQuery.of(context).size.width * 0.52, + top: 43, + left: MediaQuery + .of(context) + .size + .width * 0.50, child: InkWell( onTap: () { if (index >= 3) changeCurrentTab(2); @@ -192,7 +201,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, + top: 43, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -218,30 +227,28 @@ class StepsWidget extends StatelessWidget { ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( height: 5, ), - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: 12, - ), - StatusLabel( - selectedStepId: index, - stepId: 3, - ), - ], - ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + "Plan", + fontWeight: FontWeight.bold, + // textAlign: TextAlign.center, + fontSize: 12, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], ), ], ), @@ -264,7 +271,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, + top: 43, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -286,28 +293,39 @@ class StepsWidget extends StatelessWidget { ? Color(0xFFCC9B14) : index > 0 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), - AppText( - "شخصي", - fontWeight: FontWeight.bold, - fontSize: 16, + Column( + children: [ + AppText( + "شخصي", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + StatusLabel( + selectedStepId: index, + stepId: 0, + ), + ], ), ], ), ), ), Positioned( - top: 50, - right: MediaQuery.of(context).size.width * 0.28, + top: 43, + right: MediaQuery + .of(context) + .size + .width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -328,28 +346,39 @@ class StepsWidget extends StatelessWidget { ? Color(0xFFCC9B14) : index > 1 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), - AppText( - "هدف", - fontWeight: FontWeight.bold, - fontSize: 14, + Column( + children: [ + AppText( + "هدف", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel( + selectedStepId: index, + stepId: 1, + ), + ], ), ], ), ), ), Positioned( - top: 50, - right: MediaQuery.of(context).size.width * 0.52, + top: 43, + right: MediaQuery + .of(context) + .size + .width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -384,10 +413,18 @@ class StepsWidget extends StatelessWidget { ), Padding( padding: const EdgeInsets.only(right: 2), - child: AppText( - "تقدير", - fontWeight: FontWeight.bold, - fontSize: 14, + child: Column( + children: [ + AppText( + "تقدير", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), + ], ), ), ], @@ -395,12 +432,12 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 50, + top: 43, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( width: 38, @@ -431,10 +468,18 @@ class StepsWidget extends StatelessWidget { ), Container( margin: EdgeInsets.only(right: index == 3 ? 15 : 0), - child: AppText( - "خطة", - fontWeight: FontWeight.bold, - fontSize: 14, + child: Column( + children: [ + AppText( + "خطة", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], ), ), ], diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart index fd424767..1b159ec0 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart @@ -46,40 +46,9 @@ class UpdateChiefComplaints extends StatelessWidget { child: CustomValidationError( error: complaintsControllerError, )), - - // Container( - // margin: - // EdgeInsets.only(left: 10, right: 10, top: 15), - // child: TextFields( - // hasLabelText: complaintsController.text != '' - // ? true - // : false, - // hintText: TranslationBase - // .of(context) - // .addChiefComplaints, - // fontSize: 13.5, - // // hintColor: Colors.black, - // showLabelText: true, - // fontWeight: FontWeight.w600, - // maxLines: 25, - // minLines: 13, - // controller: complaintsController, - // validator: (value) { - // if (value == null || value == "") - // return TranslationBase.of(context) - // .emptyMessage; - // else if (value.length < 25) - // return TranslationBase - // .of(context) - // .chiefComplaintLength; - // //""; - // else - // return null; - // }), - // ), - SizedBox( - height: 20, - ), + SizedBox( + height: 20, + ), NewTextFields( hintText: TranslationBase diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index c00daa6b..2a25861a 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -1,4 +1,5 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -8,21 +9,19 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../custom_validation_error.dart'; - class UpdateAllergiesWidget extends StatefulWidget { - final List myAllergiesList; + List myAllergiesList; UpdateAllergiesWidget({Key key, this.myAllergiesList}); @@ -34,31 +33,68 @@ class _UpdateAllergiesWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + changeAllState() { + setState(() { + + }); + } return Column( children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).addAllergies, - borderColor: HexColor('#707070'), - borderWidth: 0.30, - fontSize: 13.5, - borderRadius: 12, - onTapTextFields: () { - openAllergiesList(context); - }, - readOnly: true, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: Color(0xFF2B353E), - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), + InkWell( + onTap: () { + openAllergiesList(context, changeAllState); + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), + margin: + EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade400, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(8), + ), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).addAllergies}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.grey.shade700, + fontWeight: FontWeight.bold, + ), + ], + )), + Icon( + Icons.add_box_rounded, + size: 25, + ) + ], + ), + ), ), SizedBox( height: 20, @@ -186,49 +222,36 @@ class _UpdateAllergiesWidgetState extends State { print(allergy); } - openAllergiesList(BuildContext context) { + openAllergiesList(BuildContext context, Function changeParentState) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, + isDismissible: false, context: context, builder: (context) { return AddAllergies( - addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - if (mySelectedAllergy.selectedAllergySeverity == null || - mySelectedAllergy.selectedAllergy == null) { - helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); - - } else { - setState(() { - List allergy = - // ignore: missing_return - widget.myAllergiesList - .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) - .toList(); - - if (allergy.isEmpty) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - } else { - allergy.first.selectedAllergy = - mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; - allergy.first.remark = mySelectedAllergy.remark; - allergy.first.isChecked = mySelectedAllergy.isChecked; - Navigator.of(context).pop(); - - // helpers.showErrorToast(TranslationBase - // .of(context) - // .itemExist); + myAllergiesList: widget.myAllergiesList, + addAllergiesFun: (List mySelectedAllergy) { + bool isAllDataFilled = true; + mySelectedAllergy.forEach((element) { + if (element.selectedAllergySeverity == null) { + isAllDataFilled = false; } }); - } - },); + if (isAllDataFilled) { + mySelectedAllergy.forEach((element) { + if (!widget.myAllergiesList.contains(element)) { + widget.myAllergiesList.add(element); + } + }); + changeParentState(); + Navigator.of(context).pop(); + } else { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + } + }); }); } @@ -236,8 +259,9 @@ class _UpdateAllergiesWidgetState extends State { class AddAllergies extends StatefulWidget { final Function addAllergiesFun; + final List myAllergiesList; - const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); + const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); @@ -251,7 +275,13 @@ class _AddAllergiesState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); + List myAllergiesListLocal; + @override + initState(){ + super.initState(); + myAllergiesListLocal = [...widget.myAllergiesList]; + } GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @@ -291,7 +321,7 @@ class _AddAllergiesState extends State { .of(context) .size; return FractionallySizedBox( - heightFactor: 0.7, + heightFactor: 1, child: BaseView( onModelReady: (model) async { if (model.allergiesList.length == 0) { @@ -305,220 +335,170 @@ class _AddAllergiesState extends State { AppScaffold( baseViewModel: model, isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - SizedBox( - height: 16, - ), - AppText( - TranslationBase - .of(context) - .addAllergies, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - allergyController.text = null; - }); - } - : null, - child: _selectedAllergy==null? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .selectAllergy, - _selectedAllergy != null - ? _selectedAllergy.nameEn - : null, true, icon: EvaIcons.search), - itemSubmitted: (item) => - setState(() { - _selectedAllergy = item; - allergyController.text = - projectViewModel.isArabic - ? _selectedAllergy - .nameAr - : _selectedAllergy - .nameEn; - }), - key: key, - suggestions: model.allergiesList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - projectViewModel.isArabic ? suggestion - .nameAr : suggestion.nameEn), - padding: EdgeInsets.all(2.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.nameAr.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.nameEn.toLowerCase() - .startsWith(input.toLowerCase()), - ) : - TextFields( - onTapTextFields: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - allergyController.text = null; - }); - } - : null, - hasLabelText: allergyController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .selectAllergy, - fontSize: 13.5, - readOnly: true, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: allergyController, - suffixIcon: EvaIcons.search, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }) - ), - ), - if(isFormSubmitted && _selectedAllergy == null) - CustomValidationError(), - SizedBox( - height: 10, - ), - TextFields( - onTapTextFields: model - .allergySeverityList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.allergySeverityList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedAllergySeverity = - selectedValue; - - severityController.text = - projectViewModel.isArabic - ? _selectedAllergySeverity - .nameAr - : _selectedAllergySeverity - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: severityController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .selectSeverity, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: severityController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedAllergySeverity == null) - CustomValidationError(), + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ - SizedBox( - height: 10, + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hasLabelText: remarkController.text != ''?true:false, - showLabelText: true, - hintText: TranslationBase.of(context).remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 10, - controller: remarkController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), SizedBox( - height: 10, + height: 115, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: 40), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context). + addAllergies, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(FontAwesomeIcons.times, + size: 30, + color: Color(0xFF2B353E))) + ], + ), + ], + ), ), - AppButton( - title: TranslationBase.of(context).add.toUpperCase(), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - isChecked: true, - selectedAllergySeverity: _selectedAllergySeverity,); - widget.addAllergiesFun(mySelectedAllergy); - } - - }, + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchAllergiesWidget( + model: model, + masterList: model.allergiesList, + removeAllergy: (master) { + setState(() { + removeAllergyFromLocalList(master); + }); + }, + addAllergy: (MySelectedAllergy mySelectedAllergy){ + AddAllergyLocally(mySelectedAllergy); + }, + addSelectedAllergy: ()=> + widget.addAllergiesFun(myAllergiesListLocal) + , + isServiceSelected: (master) =>isServiceSelected(master), + getServiceSelectedAllergy: (master)=>getSelectedAllergy(master), + ), + ), + ), + ), ), - ] + ), + ] - ), ), ), - )), + ) + + ), ), ); } + + isServiceSelected(MasterKeyModel masterKey) { + Iterable allergy = + myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); + if (allergy.length > 0) { + return true; + } + return false; + } + + removeAllergyFromLocalList(MasterKeyModel masterKey) { + myAllergiesListLocal.removeWhere((element) => + element.selectedAllergy.id == masterKey.id); + } + + MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { + Iterable allergy = + myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); + if (allergy.length > 0) { + return allergy.first; + } + return null; + } + + AddAllergyLocally(MySelectedAllergy mySelectedAllergy) { + if ( + mySelectedAllergy.selectedAllergy == null) { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + + } else { + setState(() { + List allergy = + // ignore: missing_return + myAllergiesListLocal + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); + + if (allergy.isEmpty) { + myAllergiesListLocal.add(mySelectedAllergy); + // Navigator.of(context).pop(); + } else { + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + // Navigator.of(context).pop(); + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); + } + }); + }} + } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index eb69e7a5..aba4af07 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -49,28 +50,60 @@ class _UpdateHistoryWidgetState extends State ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).addHistory, - borderColor: HexColor('#707070'), - borderWidth: 0.30, - fontSize: 13.5, - borderRadius: 12, - onTapTextFields: () { - openHistoryList(context); - }, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: Color(0xFF2B353E), - readOnly: true, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), + InkWell( + onTap: () { + openHistoryList(context); + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), + margin: + EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade400, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(8), + ), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).addHistory}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.grey.shade700, + fontWeight: FontWeight.bold, + ), + ], + )), + Icon( + Icons.add_box_rounded, + size: 25, + ) + ], + ), + ), ), SizedBox( height: 20, @@ -143,10 +176,6 @@ class _UpdateHistoryWidgetState extends State } removeHistory(MasterKeyModel historyKey) { - // Iterable history = widget.myHistoryList.where((element) => - // masterKey.id == element.id && masterKey.typeId == element.typeId); - // - List history = // ignore: missing_return widget.myHistoryList.where((element) => diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 45202baf..2d475624 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -205,10 +205,11 @@ class _UpdateSubjectivePageState extends State { doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { + isChiefExpand = true; complaintsController.text = helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = model.patientChiefComplaintList[0].currentMedication + '\n \n'; + medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; } await getHistory(model); @@ -304,7 +305,7 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height:MediaQuery.of(context).size.height * 0.2, + height:MediaQuery.of(context).size.height * 0.16, ), ], ), @@ -324,13 +325,13 @@ class _UpdateSubjectivePageState extends State { height: MediaQuery .of(context) .size - .height * 0.15, + .height * 0.1, width: double.infinity, child: Column( children: [ SizedBox( - height: 15, + height: 10, ), Container(child: FractionallySizedBox( widthFactor: .80, @@ -351,7 +352,7 @@ class _UpdateSubjectivePageState extends State { ), ),), SizedBox( - height: 15, + height: 5, ), ], ),), diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index f85f49f2..288171c4 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -68,9 +68,8 @@ class _UpdateSoapIndexState extends State // baseViewModel: model, isLoading: _isLoading, isShowAppBar: false, - // appBarTitle: TranslationBase.of(context).healthRecordInformation, - // TODO mousa removed the singleChildScrollView body: SingleChildScrollView( + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -96,7 +95,7 @@ class _UpdateSoapIndexState extends State child: StepsWidget( index: _currentIndex, changeCurrentTab: changePageViewIndex, - height: MediaQuery.of(context).size.height * 0.21, + height: MediaQuery.of(context).size.height * 0.20, ), ), Container( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 43106db1..6193204d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -46,7 +46,7 @@ class _AppDrawerState extends State { child: ListView(padding: EdgeInsets.zero, children: [ Container( margin: EdgeInsets.symmetric(horizontal: 20), - height: SizeConfig.heightMultiplier * 50, + // height: SizeConfig.heightMultiplier * 50, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -54,9 +54,9 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', ), - margin: EdgeInsets.only(top: 10, bottom: 15), + margin: EdgeInsets.only(top: 10, bottom: 10), ), - SizedBox(height: 15), + SizedBox(height: 10), if (authProvider.doctorProfile != null) InkWell( onTap: () { @@ -91,14 +91,14 @@ class _AppDrawerState extends State { ], ), ), - SizedBox(height: 15), + SizedBox(height: 10), InkWell( child: DrawerItem( TranslationBase.of(context).rescheduleLeaves, // " or " + // TranslationBase.of(context).leaves, - DoctorApp.leaves, + DoctorApp.reschedule__1, // subTitle: , ), onTap: () { @@ -111,6 +111,29 @@ class _AppDrawerState extends State { )); }, ), + + SizedBox(height: 10), + InkWell( + child: DrawerItem( + 'My QR Code', + // " or " + + // TranslationBase.of(context).leaves, + + DoctorApp.qr_code_3, + // subTitle: , + ), + ), + + InkWell( + child: Container( + height: 80, + child: Image.asset('assets/images/qr_code.png'), + ), + onTap: () { + }, + ), + + ], ), ), @@ -121,15 +144,8 @@ class _AppDrawerState extends State { margin: EdgeInsets.symmetric(horizontal: 20), child: Column( children: [ - InkWell( - child: DrawerItem( - TranslationBase.of(context).logout, Icons.settings), - onTap: () async { - Navigator.pop(context); - await helpers.logout(); - projectsProvider.isLogin = false; - }, - ), + + InkWell( child: DrawerItem( projectsProvider.isArabic @@ -143,6 +159,16 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, DoctorApp.logout_1), + onTap: () async { + Navigator.pop(context); + await helpers.logout(); + projectsProvider.isLogin = false; + }, + ), + ], ), ), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 60aa5415..337083a4 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -20,6 +20,7 @@ class AppScaffold extends StatelessWidget { final Widget bottomSheet; final Color backgroundColor; final Widget appBar; + final bool isHomeIcon; AppScaffold( {this.appBarTitle = '', this.body, @@ -28,6 +29,7 @@ class AppScaffold extends StatelessWidget { this.baseViewModel, this.bottomSheet, this.backgroundColor, + this.isHomeIcon = true, this.appBar}); @override @@ -60,12 +62,14 @@ class AppScaffold extends StatelessWidget { }), centerTitle: true, actions: [ - IconButton( - icon: Icon(DoctorApp.home_icon_active), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), - ), + isHomeIcon + ? IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), + ) + : SizedBox() ], ) : null, diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 026f46b2..0f5673ab 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -37,8 +37,8 @@ class _BottomNavBarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ BottomNavigationItem( - icon: DoctorApp.home_icon, - activeIcon: DoctorApp.home_icon_active, + icon: DoctorApp.home_icon_active, + activeIcon: DoctorApp.home_active, changeIndex: _changeIndex, index: _index, currentIndex: 0, @@ -46,7 +46,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( icon: DoctorApp.schedule_icon, - activeIcon: DoctorApp.scdedule_icon_active, + activeIcon: DoctorApp.scdedule_icon_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 1, @@ -54,7 +54,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( icon: DoctorApp.qr_code, - activeIcon: DoctorApp.qr_code, + activeIcon: DoctorApp.qr_reader_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 2, @@ -62,7 +62,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( icon: DoctorApp.message_icon, - activeIcon: DoctorApp.message_icon_active, + activeIcon: DoctorApp.dr_reply_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 3, diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart new file mode 100644 index 00000000..f84db092 --- /dev/null +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -0,0 +1,619 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'app_texts_widget.dart'; +import 'dialogs/master_key_dailog.dart'; +import 'expandable-widget-header-body.dart'; + +class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { + final SOAPViewModel model; + final Function () addSelectedAllergy; + final Function(MasterKeyModel) removeAllergy; + final Function(MySelectedAllergy mySelectedAllergy) addAllergy; + final bool Function(MasterKeyModel) isServiceSelected; + final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; + + final List masterList; + final String buttonName; + final String hintSearchText; + + MasterKeyCheckboxSearchAllergiesWidget( + {Key key, + this.model, + this.addSelectedAllergy, + this.removeAllergy, + this.masterList, + this.addAllergy, + this.isServiceSelected, + this.buttonName, + this.hintSearchText, + this.getServiceSelectedAllergy}) + : super(key: key); + + @override + _MasterKeyCheckboxSearchAllergiesWidgetState createState() => + _MasterKeyCheckboxSearchAllergiesWidgetState(); +} + +class _MasterKeyCheckboxSearchAllergiesWidgetState + extends State { + List items = List(); + MasterKeyModel _selectedAllergySeverity; + bool isSubmitted = false; + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + child: Column( + children: [ + Expanded( + child: Container( + height: MediaQuery.of(context).size.height * 0.62, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + TextFields( + hintText: widget.hintSearchText ?? + TranslationBase.of(context).selectAllergy, + borderWidth: 0.0, + padding: EdgeInsets.all(20), + borderRadius: 0, + suffixIcon: EvaIcons.search, + onChanged: (value) { + filterSearchResults(value); + }, + ), + SizedBox( + height: 10, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + height: MediaQuery.of(context).size.height * 0.60, + child: ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) { + bool isSelected = + widget.isServiceSelected(items[index]); + MySelectedAllergy mySelectedAllergy; + if (isSelected) { + mySelectedAllergy = + widget.getServiceSelectedAllergy( + items[index]); + } + TextEditingController remarkController = + TextEditingController( + text: isSelected + ? mySelectedAllergy.remark + : null); + TextEditingController severityController = + TextEditingController( + text: isSelected + ? mySelectedAllergy + .selectedAllergySeverity != + null + ? projectViewModel.isArabic + ? mySelectedAllergy + .selectedAllergySeverity + .nameAr + : mySelectedAllergy + .selectedAllergySeverity + .nameEn + : null + : null); + return HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Checkbox( + value: + widget.isServiceSelected( + items[index]), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + // setState(() { + // if (widget + // .isServiceSelected(items[index])) { + // widget.removeHistory(items[index]); + // } else { + // widget.addHistory(items[index]); + // } + // }); + }), + InkWell( + onTap: () { + setState(() { + if (widget + .isServiceSelected( + items[index])) { + widget.removeAllergy( + items[index]); + } else { + // TODO add Allergy + + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy( + mySelectedAllergy); + } + }); + }, + child: Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Container( + + child: AppText( + projectViewModel.isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index].nameEn, + color: Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, + ), + width: MediaQuery.of(context).size.width * 0.55, + ), + ), + ), + ), + ], + ), + InkWell( + onTap: () { + if (mySelectedAllergy != null) { + setState(() { + mySelectedAllergy + .isExpanded = + mySelectedAllergy + .isExpanded + ? false + : true; + }); + } + }, + child: Icon((mySelectedAllergy != + null + ? mySelectedAllergy + .isExpanded + : false) + ? EvaIcons + .arrowIosUpwardOutline + : EvaIcons + .arrowIosDownwardOutline)) + ], + ), + bodyWidget: Column( + children: [ + TextFields( + onTapTextFields: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + mySelectedAllergy + .selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, + hasLabelText: + mySelectedAllergy != null && + mySelectedAllergy + .selectedAllergySeverity != + null + ? true + : false, + showLabelText: true, + hintText: + TranslationBase + .of(context) + .selectSeverity, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + SizedBox( + height: 5, + ), + if(isSubmitted && + mySelectedAllergy + .selectedAllergySeverity == null) + Row( + + children: [ + CustomValidationError(), + ], + mainAxisAlignment: MainAxisAlignment.start, + ), + + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hasLabelText: + remarkController.text != + '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase + .of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 10, + initialValue: isSelected + ? mySelectedAllergy + .remark : '', + // controller: remarkControlle + + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + }; + }, + + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ],), + isExpand: mySelectedAllergy != null + ? mySelectedAllergy.isExpanded + : false, + ); + + + + + Column( + children: [ + InkWell( + onTap: () { + setState(() { + if (widget.isServiceSelected( + items[index])) { + widget + .removeAllergy( + items[index]); + } else { + // TODO add Allergy + + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true); + widget.addAllergy( + mySelectedAllergy); + } + }); + }, + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: widget + .isServiceSelected( + items[index]), + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + // setState(() { + // if (widget + // .isServiceSelected(items[index])) { + // widget.removeHistory(items[index]); + // } else { + // widget.addHistory(items[index]); + // } + // }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: AppText( + projectViewModel.isArabic + ? items[index] + .nameAr != + "" + ? items[index] + .nameAr + : items[index] + .nameEn + : items[index].nameEn, + color: Color(0xFF575757), + fontSize: 16, + fontWeight: + FontWeight.w600, + ), + ), + ), + ], + ), + if(widget + .isServiceSelected( + items[index])) + Column(children: [ + TextFields( + onTapTextFields: widget.model + .allergySeverityList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: widget.model + .allergySeverityList, + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + mySelectedAllergy + .selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, + hasLabelText: + mySelectedAllergy + .selectedAllergySeverity != + null + ? true + : false, + showLabelText: true, + hintText: + TranslationBase + .of(context) + .selectSeverity, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + SizedBox( + height: 5, + ), + if(isSubmitted && + mySelectedAllergy + .selectedAllergySeverity == null) + Row( + + children: [ + CustomValidationError(), + ], + mainAxisAlignment: MainAxisAlignment.start, + ), + + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hasLabelText: + remarkController.text != + '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase + .of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 10, + initialValue: isSelected + ? mySelectedAllergy + .remark : '', + // controller: remarkControlle + + onChanged: (value) { + if (isSelected) { + mySelectedAllergy + .remark = value; + }; + }, + + validator: (value) { + if (value == null) + return TranslationBase + .of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ],) + ], + ), + ), + // DividerWithSpacesAround(), + ], + ); + }, + ), + ), + ), + ), + ], + ) + )), + ), + ), + SizedBox( + height: 10, + ), + if (widget.model.state == ViewState.Idle) + AppButton( + title: "Add Selected Allergy", + padding: 10, + color: Color(0xFF359846), + onPressed: () { + setState(() { + isSubmitted = true; + }); + widget.addSelectedAllergy(); + }, + ), + ], + ), + ); + } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((items) { + if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || + items.nameEn.toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(items); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +}