From 27b4450dac8414ffa74321ccdb9e813331239cd8 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Mon, 19 Apr 2021 12:26:58 +0300 Subject: [PATCH 01/21] versionID changed to 5.5 --- lib/core/service/patient-doctor-referral-service.dart | 2 +- lib/core/viewModel/hospital_view_model.dart | 2 +- lib/models/doctor/profile_req_Model.dart | 2 +- lib/models/patient/get_clinic_by_project_id_request.dart | 2 +- .../patient/get_list_stp_referral_frequency_request.dart | 2 +- lib/models/patient/insurance_aprovals_request.dart | 2 +- lib/models/patient/lab_orders/lab_orders_req_model.dart | 2 +- lib/models/patient/orders_request.dart | 2 +- lib/models/patient/prescription/prescription_req_model.dart | 2 +- lib/models/patient/progress_note_request.dart | 2 +- lib/models/patient/radiology/radiology_req_model.dart | 2 +- lib/models/patient/refer_to_doctor_request.dart | 2 +- lib/models/patient/vital_sign/vital_sign_req_model.dart | 2 +- lib/models/pharmacies/pharmacies_List_request_model.dart | 2 +- lib/models/pharmacies/pharmacies_items_request_model.dart | 4 ++-- lib/screens/QR_reader_screen.dart | 2 +- lib/screens/dashboard_screen.dart | 2 +- lib/screens/doctor/patient_arrival_screen.dart | 2 +- lib/screens/patients/patient_search_screen.dart | 2 +- lib/screens/patients/patients_screen.dart | 2 +- lib/widgets/auth/login_form.dart | 4 ++-- lib/widgets/auth/verfiy_account.dart | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 1677bbce..989d0a3c 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -29,7 +29,7 @@ class PatientReferralService extends LookupService { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 1.2, + "VersionID": 5.5, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/core/viewModel/hospital_view_model.dart b/lib/core/viewModel/hospital_view_model.dart index 7865a40f..dbb5e4fb 100644 --- a/lib/core/viewModel/hospital_view_model.dart +++ b/lib/core/viewModel/hospital_view_model.dart @@ -13,7 +13,7 @@ class HospitalViewModel with ChangeNotifier { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 1.2, + "VersionID": 5.5, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 6a850811..8f2ef985 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -29,7 +29,7 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=1.2, + this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 862fbab4..09198dc0 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -40,7 +40,7 @@ class ClinicByProjectIdRequest { this.languageID = 2, this.stamp = "2020-06-03T11:18:19.979Z", this.iPAdress = "11.11.11.11", - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 3b3c2655..f524aa37 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -37,7 +37,7 @@ class STPReferralFrequencyRequest { {this.languageID = 2, this.stamp = "2020-06-03T11:18:19.986Z", this.iPAdress = "11.11.11.11", - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index e36355d8..63e7926a 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -45,7 +45,7 @@ class InsuranceAprovalsRequest { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 1.2, + this.versionID = 5.5, this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index 0295ce8d..a97f4093 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -28,7 +28,7 @@ class LabOrdersReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=1.2, + this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp =true, diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 5e1283fa..1372cfd6 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -49,7 +49,7 @@ class OrdersRequest { this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, - this.versionID = 1.2, + this.versionID = 5.5, this.patientOutSA = false}); OrdersRequest.fromJson(Map json) { diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart index 45ca2d74..9141c282 100644 --- a/lib/models/patient/prescription/prescription_req_model.dart +++ b/lib/models/patient/prescription/prescription_req_model.dart @@ -27,7 +27,7 @@ class PrescriptionReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index ce38b56e..fe0add5f 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -49,7 +49,7 @@ class ProgressNoteRequest { this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, - this.versionID = 1.2, + this.versionID = 5.5, this.patientOutSA = false}); ProgressNoteRequest.fromJson(Map json) { diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index b39fb393..47154d8b 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -25,7 +25,7 @@ class RadiologyReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 28eb488b..83db54f4 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -84,7 +84,7 @@ class ReferToDoctorRequest { this.languageID = 2, this.stamp = "2020-06-03T11:26:42.358Z", this.iPAdress = "11.11.11.11", - this.versionID = 1.2, + this.versionID = 5.5, this.channel = 9, @required this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index ddd1f7d2..61e3fcf2 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -31,7 +31,7 @@ class VitalSignReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=1.2, + this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp=true, diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 33588345..90b5c378 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -26,7 +26,7 @@ class PharmaciesListRequestModel { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 5.3, + this.versionID = 5.5, this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 9602a803..8d6b9b46 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -10,7 +10,7 @@ class PharmaciesItemsRequestModel { String pHRItemName; int pageIndex = 0; int pageSize = 20; - double versionID = 5.3; + double versionID = 5.5; int channel = 3; int languageID = 2; String iPAdress = "10.20.10.20"; @@ -24,7 +24,7 @@ class PharmaciesItemsRequestModel { {this.pHRItemName, this.pageIndex = 0, this.pageSize = 20, - this.versionID = 5.3, + this.versionID = 5.5, this.channel = 3, this.languageID = 2, this.iPAdress = "10.20.10.20", diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 2ddb4049..2645f7a4 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -45,7 +45,7 @@ class _QrReaderScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "@dm!n", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index c249c0bc..1b3022f9 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -72,7 +72,7 @@ class _DashboardScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index d5a254e8..3dc63a7b 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -30,7 +30,7 @@ class _PatientArrivalScreen extends State LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 51750e38..ecb27d3c 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -63,7 +63,7 @@ class _PatientSearchScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 482d6d80..eac01964 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -98,7 +98,7 @@ class _PatientsScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 1.2, + VersionID: 5.5, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 9fc50008..e5c685bd 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -52,7 +52,7 @@ class _LoginFormState extends State { projectID: 15, languageID: 2, iPAdress: "11.11.11.11", - versionID: 1.2, + versionID: 5.5, channel: 9, sessionID: "i1UJwCTSqt"); @@ -386,7 +386,7 @@ class _LoginFormState extends State { "ProjectName": "", "DoctorImageURL": "UNKNOWN", "LogInTokenID": preRes['LogInTokenID'], - "VersionID": 5.3 + "VersionID": 5.5 }; authProv.insertDeviceImei(imeiInfo).then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 587c248c..66a53857 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -356,7 +356,7 @@ class _VerifyAccountState extends State { "LanguageID": 2, "stamp": "2020-02-26T14:48:27.221Z", "IPAdress": "11.11.11.11", - "VersionID": 1.2, + "VersionID": 5.5, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", From 9c68f23647f3bbc2cf8cb73077689fa4046c2892 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Wed, 28 Apr 2021 11:15:31 +0300 Subject: [PATCH 02/21] updates & fixes --- android/app/build.gradle | 2 +- android/app/google-services.json | 23 ++-- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 4 +- .../ui/VideoCallActivity.java | 2 +- .../doctor_app_flutter/MainActivity.kt | 101 ------------------ android/app/src/profile/AndroidManifest.xml | 2 +- android/google-services.json | 16 +-- ios/Flutter/AppFrameworkInfo.plist | 40 +++---- ios/Podfile.lock | 2 +- ios/Runner.xcodeproj/project.pbxproj | 18 ++-- ios/Runner/Info.plist | 36 ++++--- pubspec.yaml | 2 +- 13 files changed, 79 insertions(+), 171 deletions(-) delete mode 100644 android/app/src/main/kotlin/com/example/doctor_app_flutter/MainActivity.kt diff --git a/android/app/build.gradle b/android/app/build.gradle index af0821ee..fd6c7720 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,7 +38,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.doctor_app_flutter" + applicationId "com.hmg.hmgDr" minSdkVersion 18 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() diff --git a/android/app/google-services.json b/android/app/google-services.json index 27e5dfb1..db548786 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,41 +1,34 @@ { "project_info": { - "project_number": "1097451043303", - "project_id": "doctor-app-35ddc", - "storage_bucket": "doctor-app-35ddc.appspot.com" + "project_number": "157373154094", + "project_id": "hmg-doctor-app-1553688619744", + "storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:1097451043303:android:f82ecce9562ecaad866542", + "mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", "android_client_info": { - "package_name": "com.example.doctor_app_flutter" + "package_name": "com.hmg.hmgDr" } }, "oauth_client": [ { - "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyChu44P8Dp8jtRqnoDR2mdjqKgSKQq-FPY" + "current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 - }, - { - "client_id": "1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.hmg.doctorApp" - } } ] } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 631e9b28..317d0290 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.hmg.hmgDr"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fdd8f424..57a59745 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.hmg.hmgDr"> diff --git a/android/google-services.json b/android/google-services.json index 3c00f05c..db548786 100644 --- a/android/google-services.json +++ b/android/google-services.json @@ -1,33 +1,33 @@ { "project_info": { - "project_number": "1008895414777", - "project_id": "doctorapp-9f172", - "storage_bucket": "doctorapp-9f172.appspot.com" + "project_number": "157373154094", + "project_id": "hmg-doctor-app-1553688619744", + "storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28", + "mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", "android_client_info": { - "package_name": "com.example.doctor_app_flutter" + "package_name": "com.hmg.hmgDr" } }, "oauth_client": [ { - "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw" + "current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_type": 3 } ] diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 6b4c0f78..25fb7fb6 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 9.0 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..a365fcf4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f35ae084..9d448f00 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -375,7 +375,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -383,12 +383,14 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + MARKETING_VERSION = 1.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -508,7 +510,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -516,12 +518,14 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + MARKETING_VERSION = 1.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -537,7 +541,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -545,12 +549,14 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + MARKETING_VERSION = 1.3.0; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 645c587b..acabe064 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + HMG Doctor CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,15 +17,25 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion - $(FLUTTER_BUILD_NUMBER) + $(CURRENT_PROJECT_VERSION) + FirebaseAppDelegateProxyEnabled + LSRequiresIPhoneOS + NSSpeechRecognitionUsageDescription + This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. + NSAppleMusicUsageDescription + This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. + NSCalendarsUsageDescription + This app requires calendar access to set reminders for Virtual & Normal Appointments. NSCameraUsageDescription - Camera permission is required for barcode scanning. + App requires access to camera incase you are interested to attach images to your Qr Code. + NSContactsUsageDescription + This app requires contacts access to show incoming virtual consultation request. NSFaceIDUsageDescription We are using it for authentication @@ -31,6 +43,14 @@ ${PRODUCT_NAME} requires access to use voice command + NSLocationWhenInUseUsageDescription + This App requires access to your location to show the nearest hospitals from your location. + NSMicrophoneUsageDescription + This app requires microphone access to enable virtual consultation between patient & doctor + NSMotionUsageDescription + This app requires motion detection access to function properly. + NSPhotoLibraryUsageDescription + Need to upload image UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -50,15 +70,5 @@ UIViewControllerBasedStatusBarAppearance - - NSCameraUsageDescription - App requires access to camera incase you are interested to attach images to your Qr Code. - NSPhotoLibraryUsageDescription - Need to upload image - - NSMicrophoneUsageDescription - ${PRODUCT_NAME} always Microphone use - FirebaseAppDelegateProxyEnabled - diff --git a/pubspec.yaml b/pubspec.yaml index 347b7a62..9472f598 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +version: 1.2.1+1 environment: sdk: ">=2.8.0 <3.0.0" From 30bc9b4beafa57347d62861b0bd272608556ce55 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 28 Apr 2021 21:40:59 +0300 Subject: [PATCH 03/21] fix issue --- lib/screens/home/home_screen.dart | 10 +- .../out_patient/out_patient_screen.dart | 251 ++++++++++++++++++ .../patient_search_screen_new.dart | 8 + .../profile/patient_profile_screen.dart | 2 +- .../update_Chief_complaints.dart | 6 +- lib/widgets/shared/errors/error_message.dart | 30 ++- ..._key_checkbox_search_allergies_widget.dart | 4 +- 7 files changed, 284 insertions(+), 27 deletions(-) create mode 100644 lib/screens/patients/out_patient/out_patient_screen.dart diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 307b635c..d3d2c827 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -18,6 +18,7 @@ import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart' import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; @@ -555,14 +556,9 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientsScreenNew( - isSearch: false, - isInpatient: false, + OutPatientsScreen( patientSearchRequestModel: - PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID), - selectedPatientType: - PatientType.OutPatient, - isSearchWithKeyInfo: false, + PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID) ), )); }, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart new file mode 100644 index 00000000..8a4a7b3d --- /dev/null +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -0,0 +1,251 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.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/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OutPatientsScreen extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + final arrivalType; + final isView; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + final bool isSearch; + final bool isInpatient; + final bool isSearchAndOut; + final String searchKey; + + + OutPatientsScreen( + {this.patientSearchForm, + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + + @override + _OutPatientsScreenState createState() => _OutPatientsScreenState(); +} + +class _OutPatientsScreenState extends State { + int clinicId; + AuthViewModel authProvider; + + List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + + int _activeLocation = 0; + String patientType; + String patientTypeTitle; + var selectedFilter = 1; + String arrivalType; + ProjectViewModel projectsProvider; + var isView; + final _controller = TextEditingController(); + + PatientModel patient; + + + @override + Widget build(BuildContext context) { + authProvider = Provider.of(context); + _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + final screenSize = MediaQuery.of(context).size; + + + return BaseView( + onModelReady: (model) async { + await model.getOutPatient(widget.patientSearchRequestModel); + }, + builder: (_, model, w) => AppScaffold( + appBarTitle: "Search Patient", + isShowAppBar: true, + appBar: HeaderInSearch( + title: "My Out patient", + + ), + baseViewModel: model, + body: Column( + children: [ + Container( + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils + .containerBorderDecoration( + Color(0Xffffffff), + Color(0xFFCCCCCC), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item + ? true + : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ), + + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + 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) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isFromSearch:widget.isSearchAndOut, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + })), + ), + ], + ) + ), + ); + } +} diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index c17c173a..5270511d 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -107,8 +109,14 @@ class _PatientSearchScreenNewState extends State { isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, + inputType:TextInputType.number, hasBorder: true, controller: patientFileInfoController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + onChanged: (_){}, validationError: (isFormSubmitted && ( patientFileInfoController .text.isEmpty && diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index bae49ef9..9e3d5140 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -109,7 +109,7 @@ class _PatientProfileScreenState extends State height: !isSearchAndOut ? MediaQuery .of(context) .size - .height * 0.70 : MediaQuery + .height * 0.65 : MediaQuery .of(context) .size .height * 0.69, diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 10f9c2a6..216fbd53 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -40,7 +40,7 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null , + validationError:complaintsControllerError !=''?complaintsControllerError:null , ), SizedBox( @@ -55,7 +55,7 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + validationError:illnessControllerError !=''?illnessControllerError:null , ), SizedBox( height: 10, @@ -74,7 +74,7 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null , + validationError:medicationControllerError !=''?medicationControllerError:null , ), SizedBox( diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 53c41d2b..21e04e6c 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -12,22 +12,24 @@ class ErrorMessage extends StatelessWidget { @override Widget build(BuildContext context) { - return Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), - Center( - child: Center( - child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), - child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + return SingleChildScrollView( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Center( + child: Center( + child: Padding( + padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), + child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + ), ), - ), - ) + ) - ], + ], + ), ), ); } diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 31115b11..e91236e8 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -76,8 +76,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - height: - MediaQuery.of(context).size.height * 0.070, + // height: + // MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).selectAllergy, isTextFieldHasSuffix: true, From 8e9687c2ed275878f8681b9d0328cf5e4d54cca4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 28 Apr 2021 21:49:49 +0300 Subject: [PATCH 04/21] fix issue on add examination --- .../objective/add_examination_page.dart | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index c77e9a49..d98e17be 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -102,36 +102,56 @@ class _AddExaminationPageState extends State { setState(() { widget.mySelectedExamination .add(selectedExamination); - }); - }, + }); + }, + ), + ], + ), ), ], ), ), + ), + ], + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + "${TranslationBase.of(context).addExamination}", + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addSelectedExamination(); + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), ], ), ), - ), - Container( - padding: EdgeInsets.all(16), - color: Colors.white, - child: AppButton( - title:"${TranslationBase.of(context).addExamination}", - color: HexColor("#359846"), - fontColor: Colors.white, - vPadding: 12, - radius: 12, - fontWeight: FontWeight.w600, - fontSize: SizeConfig.textMultiplier * 2.5, - onPressed: () { - widget.addSelectedExamination(); - }, - ), - ) - ], - ), - ), - ); + )); } isServiceSelected(MasterKeyModel masterKey) { From 0244334bb532787f09ab0e1d0a5759eafa66914a Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Thu, 29 Apr 2021 10:50:20 +0300 Subject: [PATCH 05/21] Update on store --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 101 ++++++++++++++++++ ios/Runner.xcodeproj/project.pbxproj | 12 +-- ios/Runner/Info.plist | 11 +- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 2 +- .../patient-doctor-referral-service.dart | 2 +- lib/core/viewModel/hospital_view_model.dart | 2 +- ...t_list_stp_referral_frequency_request.dart | 2 +- .../patient/insurance_aprovals_request.dart | 2 +- .../vital_sign/vital_sign_req_model.dart | 2 +- .../pharmacies_items_request_model.dart | 2 +- .../doctor/patient_arrival_screen.dart | 2 +- .../patients/patient_search_screen.dart | 2 +- pubspec.yaml | 2 +- 14 files changed, 121 insertions(+), 25 deletions(-) create mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt new file mode 100644 index 00000000..aed21dd3 --- /dev/null +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -0,0 +1,101 @@ +package com.hmg.hmgDr + +import android.app.Activity +import android.content.Intent +import androidx.annotation.NonNull +import com.example.doctor_app_flutter.Model.GetSessionStatusModel +import com.example.doctor_app_flutter.Model.SessionStatusModel +import com.example.doctor_app_flutter.ui.VideoCallActivity +import com.google.gson.GsonBuilder +import io.flutter.embedding.android.FlutterFragmentActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler { + + private val CHANNEL = "Dr.cloudSolution/videoCall" + private var result: MethodChannel.Result? = null + private var call: MethodCall? = null + private val LAUNCH_VIDEO: Int = 1 + + + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine) + + MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler(this) + } + + + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { + + this.result = result + this.call = call + + if (call.method == "openVideoCall") { + val apiKey = call.argument("kApiKey") + val sessionId = call.argument("kSessionId") + val token = call.argument("kToken") + val appLang = call.argument("appLang") + val baseUrl = call.argument("baseUrl") + + // Session Status model + val VC_ID = call.argument("VC_ID") + val tokenID = call.argument("TokenID") + val generalId = call.argument("generalId") + val doctorId = call.argument("DoctorId") + + val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId) + + + openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel) + + } else { + result.notImplemented() + } + } + + private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?, appLang: String?, baseUrl: String?, sessionStatusModel: GetSessionStatusModel) { + // val videoCallActivity = VideoCallActivity() + + val intent = Intent(this, VideoCallActivity::class.java) + intent.putExtra("apiKey", apiKey) + intent.putExtra("sessionId", sessionId) + intent.putExtra("token", token) + intent.putExtra("appLang", appLang) + intent.putExtra("baseUrl", baseUrl) + intent.putExtra("sessionStatusModel", sessionStatusModel) + startActivityForResult(intent, LAUNCH_VIDEO) + + } + + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + var asd = ""; + if (requestCode == LAUNCH_VIDEO) { + if (resultCode == Activity.RESULT_OK) { + val result : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond") + val callResponse : HashMap = HashMap() + + val sessionStatus : HashMap = HashMap() + val gson = GsonBuilder().serializeNulls().create() + + callResponse["callResponse"] = "CallNotRespond" + val jsonRes = gson.toJson(result) + callResponse["sessionStatus"] = jsonRes + + this.result?.success(callResponse) + } + if (resultCode == Activity.RESULT_CANCELED) { + val callResponse : HashMap = HashMap() + callResponse["callResponse"] = "CallEnd" + + result?.success(callResponse) + } + } + } + + +} diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9d448f00..f0784432 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -375,7 +375,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -389,7 +389,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -510,7 +510,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -524,7 +524,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -541,7 +541,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -555,7 +555,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.3.1; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index acabe064..2314a2c8 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -26,10 +26,8 @@ LSRequiresIPhoneOS - NSSpeechRecognitionUsageDescription - This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. NSAppleMusicUsageDescription - This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. + ${PRODUCT_NAME} requires access to use voice command NSCalendarsUsageDescription This app requires calendar access to set reminders for Virtual & Normal Appointments. NSCameraUsageDescription @@ -38,11 +36,6 @@ This app requires contacts access to show incoming virtual consultation request. NSFaceIDUsageDescription We are using it for authentication - - NSAppleMusicUsageDescription - ${PRODUCT_NAME} requires access to use voice command - - NSLocationWhenInUseUsageDescription This App requires access to your location to show the nearest hospitals from your location. NSMicrophoneUsageDescription @@ -51,6 +44,8 @@ This app requires motion detection access to function properly. NSPhotoLibraryUsageDescription Need to upload image + NSSpeechRecognitionUsageDescription + This permission is not needed by the app, but it is required by an underlying API. If you see this dialog, contact us. UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e92a921c..177b95ee 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 8.3; + body['VersionID'] = 5.8; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/config.dart b/lib/config/config.dart index 07151d1d..9596a029 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.9; +const VERSION_ID = 5.8; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 76f9f18a..680adada 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -29,7 +29,7 @@ class PatientReferralService extends LookupService { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 5.5, + "VersionID": 5.8, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/core/viewModel/hospital_view_model.dart b/lib/core/viewModel/hospital_view_model.dart index dbb5e4fb..a49b85e5 100644 --- a/lib/core/viewModel/hospital_view_model.dart +++ b/lib/core/viewModel/hospital_view_model.dart @@ -13,7 +13,7 @@ class HospitalViewModel with ChangeNotifier { "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", - "VersionID": 5.5, + "VersionID": 5.8, "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index f524aa37..7f466deb 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -37,7 +37,7 @@ class STPReferralFrequencyRequest { {this.languageID = 2, this.stamp = "2020-06-03T11:18:19.986Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.5, + this.versionID = 5.8, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index 63e7926a..2d3ac663 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -45,7 +45,7 @@ class InsuranceAprovalsRequest { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 5.5, + this.versionID = 5.8, this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 61e3fcf2..2cfd24c2 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -31,7 +31,7 @@ class VitalSignReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=5.5, + this.versionID=5.8, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp=true, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 8d6b9b46..4f2e947a 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -24,7 +24,7 @@ class PharmaciesItemsRequestModel { {this.pHRItemName, this.pageIndex = 0, this.pageSize = 20, - this.versionID = 5.5, + this.versionID = 5.8, this.channel = 3, this.languageID = 2, this.iPAdress = "10.20.10.20", diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 4580e5c8..e4f933e7 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -31,7 +31,7 @@ class _PatientArrivalScreen extends State LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 5.5, + VersionID: 5.8, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index db7a2e21..88b8547b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -62,7 +62,7 @@ class _PatientSearchScreenState extends State { LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", - VersionID: 5.5, + VersionID: 5.8, Channel: 9, TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", diff --git a/pubspec.yaml b/pubspec.yaml index 9472f598..58dd50be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.1+1 +version: 1.2.2+2 environment: sdk: ">=2.8.0 <3.0.0" From 7c2889c5d22c435ca0199a2dcb89df9b2adb397d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 11:47:30 +0300 Subject: [PATCH 06/21] fix height issue --- lib/screens/patients/profile/patient_profile_screen.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9e3d5140..31be0812 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -102,11 +102,14 @@ class _PatientProfileScreenState extends State height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 - : 0, + : isDischargedPatient?240:0, ), Container( - height: !isSearchAndOut ? MediaQuery + height: !isSearchAndOut ? isDischargedPatient?MediaQuery + .of(context) + .size + .height * 0.64 : MediaQuery .of(context) .size .height * 0.65 : MediaQuery From 3d6b55681a20fadda4c6b4ebe2ac851b7ab6cb89 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 29 Apr 2021 14:00:02 +0300 Subject: [PATCH 07/21] fix arabic and font style --- lib/config/localized_values.dart | 2 + .../patient-admission-request-service.dart | 2 +- .../patient-vital-sign-viewmodel.dart | 6 +- .../lab_result_chart_and_detials.dart | 3 +- .../profile/patient_profile_screen.dart | 2 +- .../vital_sign/vital_sign_details_screen.dart | 201 +----------------- .../profile/vital_sign/vital_sign_item.dart | 5 +- .../vital_sing_chart_and_detials.dart | 2 +- .../vital_sing_chart_blood_pressure.dart | 2 +- lib/util/translations_delegate_base.dart | 2 + .../profile/PatientProfileButton.dart | 8 +- .../shared/app_expandable_notifier.dart | 3 +- .../shared/buttons/app_buttons_widget.dart | 123 +++++------ .../shared/buttons/button_bottom_sheet.dart | 53 ++++- 14 files changed, 141 insertions(+), 273 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea99a982..c46fb2c3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -870,4 +870,6 @@ const Map> localizedValues = { }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, + "severe": {"en": "Severe", "ar": "الشدة"}, + "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, }; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index bdbf125e..c97f8426 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -163,7 +163,7 @@ class AdmissionRequestService extends LookupService { hasError = false; Map body = Map(); - body['patientMRN'] = patientMrn; + body['PatientMRN'] = patientMrn; await baseAppClient.post( GET_DIET_TYPES, diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index cd02f538..59b13fe8 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -23,7 +23,7 @@ class VitalSignsViewModel extends BaseViewModel { String hartRat = "0"; String respirationBeatPerMinute = "0"; String bloodPressure = "0 / 0"; - String oxygenation = "0 - 0"; + String oxygenation = "0"; String painScore = "-"; String painLocation = "-"; String painCharacter = "-"; @@ -93,11 +93,11 @@ class VitalSignsViewModel extends BaseViewModel { bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } - if (oxygenation == "0 - 0" || + if (oxygenation == "0" || oxygenation == null || oxygenation == 'null') { oxygenation = - "${element.sAO2.toString()} - ${element.fIO2.toString()}"; + "${element.sAO2.toString()}";/* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { painScore = element.painScore.toString() != 'null' diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index b6699b22..6026c9e9 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.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'; @@ -45,7 +46,7 @@ class LabResultChartAndDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index bae49ef9..eafcd0d6 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -431,7 +431,7 @@ class _PatientProfileScreenState extends State NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.01, crossAxisCount: 3, children: [ PatientProfileButton( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 0b41e0a2..a6f36784 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -57,15 +57,15 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${patient.firstName ?? patient.patientDetails.firstName}'s", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).vitalSign, - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, ), @@ -544,8 +544,8 @@ class VitalSignDetailsScreen extends StatelessWidget { .oxygenation, imagePath: "${assetBasePath}oxg.png", - lastVal: mode.oxygenation, - unit: "%", + lastVal: "${mode.oxygenation}%", + unit: "", ), ), InkWell( @@ -576,198 +576,11 @@ class VitalSignDetailsScreen extends StatelessWidget { imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: "", + unit: TranslationBase.of(context).severe, ), ), ], ), - /*RoundedContainer( - width: MediaQuery.of(context).size.width / 2, - margin: EdgeInsets.symmetric( - horizontal: 0.0, vertical: 16), - child: Container( - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(top: 8), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painScore}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Location", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painLocation}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Character", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painCharacter}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Duration", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painDuration}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).painManagement, - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.isPainDone}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).frequency, - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painFrequency}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ), - ), - Container( - child: Image.asset( - "${assetBasePath}painScale.png", - width: 40, - height: 40, - )) - ], - ), - ), - Container( - child: Column( - children: [ - Align( - alignment: - Alignment.topRight, - child: Icon( - EvaIcons.eye, - ), - ), - Align( - alignment: - Alignment.topLeft, - child: Container( - margin: EdgeInsets.only( - left: 5, right: 5), - child: AppText( - "${TranslationBase.of(context).painScale}", - fontFamily: 'Poppins', - fontSize: SizeConfig - .textMultiplier * - 1.3, - fontWeight: - FontWeight.bold, - ), - ), - ), - ], - ), - ), - ], - ), - ), - ),*/ ], ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index fbea0452..20d5b439 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -52,6 +52,7 @@ class VitalSignItem extends StatelessWidget { fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.4, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), margin: 0, ), Expanded( @@ -62,7 +63,7 @@ class VitalSignItem extends StatelessWidget { fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.2, fontWeight: FontWeight.w700, - color: Color(0xFFB8382C), + color: Color(0xFFD02127), margin: 0, ), ], @@ -98,7 +99,7 @@ class VitalSignItem extends StatelessWidget { margin: EdgeInsets.only(left: 5, right: 5), child: AppText( "$des", - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.3, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index f59f6c23..2d4abec8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -58,7 +58,7 @@ class VitalSingChartAndDetials extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 27256525..0ac2f18b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -63,7 +63,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.3, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6602722c..56c2f710 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1247,6 +1247,8 @@ class TranslationBase { String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get severe => localizedValues["severe"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 66d33fe7..9a027e36 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,9 +1,11 @@ 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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientProfileButton extends StatelessWidget { final String nameLine1; @@ -42,6 +44,8 @@ class PatientProfileButton extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), padding: EdgeInsets.fromLTRB(10, 10, 10, 5), @@ -63,11 +67,11 @@ class PatientProfileButton extends StatelessWidget { url + icon, width: 50, height: 50, - )) + ),) ], )), Container( - alignment: Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index 5e934167..76a7f57e 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -30,7 +31,7 @@ class AppExpandableNotifier extends StatelessWidget { header: Padding( padding: EdgeInsets.all(10), child: Text( - "See Graph Details", + "${TranslationBase.of(context).graphDetails}", style: TextStyle(fontWeight: FontWeight.bold), )), collapsed: Text(''), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index eab11a57..e63acba2 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -48,71 +48,74 @@ class AppButton extends StatefulWidget { class _AppButtonState extends State { @override Widget build(BuildContext context) { - return IgnorePointer( - ignoring: widget.loading ||widget.disabled, - child: RawMaterialButton( - fillColor: widget.disabled - ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: (widget.hPadding > 0 || widget.vPadding > 0) - ? EdgeInsets.symmetric( - vertical: widget.vPadding, horizontal: widget.hPadding) - : EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Container(width: 25, height: 25, child: widget.icon), - if (widget.iconData != null) - Icon( - widget.iconData, - color: Colors.white, - ), - if (widget.icon != null || widget.iconData != null) - SizedBox( - width: 5.0, - ), - widget.loading - ? Padding( - padding: EdgeInsets.all(2.6), - child: SizedBox( - height: 19.0, - width: 19.0, - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + return Container( + height: MediaQuery.of(context).size.height * 0.075, + child: IgnorePointer( + ignoring: widget.loading ||widget.disabled, + child: RawMaterialButton( + fillColor: widget.disabled + ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: (widget.hPadding > 0 || widget.vPadding > 0) + ? EdgeInsets.symmetric( + vertical: widget.vPadding, horizontal: widget.hPadding) + : EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Container(width: 25, height: 25, child: widget.icon), + if (widget.iconData != null) + Icon( + widget.iconData, + color: Colors.white, + ), + if (widget.icon != null || widget.iconData != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[300], + ), ), ), + ) + : Container( + child: AppText( + widget.title, + color: widget.fontColor, + fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontWeight: widget.fontWeight, + ), ), - ) - : Container( - child: AppText( - widget.title, - color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, - fontWeight: widget.fontWeight, - ), - ), - ], + ], + ), ), + onPressed: widget.disabled ? (){} : widget.onPressed, + shape: RoundedRectangleBorder( + side: BorderSide( + color: + widget.hasBorder ? widget.borderColor : widget.disabled + ? Colors.grey : widget.color ?? Color(0xFFB8382C), + width: 0.8, + ), + borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), - onPressed: widget.disabled ? (){} : widget.onPressed, - shape: RoundedRectangleBorder( - side: BorderSide( - color: - widget.hasBorder ? widget.borderColor : widget.disabled - ? Colors.grey : widget.color ?? Color(0xFFB8382C), - width: 0.8, - ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), ); } diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 224907d9..9db662d2 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -4,20 +4,61 @@ import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { - final double height; - final String buttonTitle; - final Function onPressed; + final GestureTapCallback onPressed; + final String title; + final IconData iconData; + final Widget icon; + final Color color; + final double fontSize; + final double padding; + final Color fontColor; + final bool loading; + final bool disabled; + final FontWeight fontWeight; + final bool hasBorder; + final Color borderColor; + final double radius; + final double vPadding; + final double hPadding; - ButtonBottomSheet({@required this.height, @required this.buttonTitle, @required this.onPressed}); + ButtonBottomSheet({@required this.onPressed, + this.title, + this.iconData, + this.icon, + this.color, + this.fontSize = 2, + this.padding = 13, + this.loading = false, + this.disabled = false, + this.fontColor = Colors.white, + this.fontWeight = FontWeight.normal, + this.vPadding = 0, + this.hPadding = 0, + this.radius = 8.0, + this.hasBorder = false, + this.borderColor,}); @override Widget build(BuildContext context) { return Container( - height: height ?? null, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( - title: buttonTitle, + title: title, onPressed: onPressed, + fontWeight: fontWeight, + color: color, + fontSize: fontSize, + padding: padding, + disabled: disabled, + radius: radius, + hasBorder: hasBorder, + fontColor: fontColor, + icon: icon, + iconData: iconData, + hPadding: hPadding, + vPadding: vPadding, + borderColor: borderColor, + loading: loading, ), ); } From 68f405cb21761f2be99e6b85dbc1d4c7a66c17e8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 29 Apr 2021 15:01:44 +0300 Subject: [PATCH 08/21] design fixes --- lib/config/localized_values.dart | 2 +- .../admission-request-first-screen.dart | 19 ++++-- .../admission-request-third-screen.dart | 10 +-- .../admission-request_second-screen.dart | 14 ++-- .../profile/patient_profile_screen.dart | 4 +- .../text_fields/app-textfield-custom.dart | 65 +++++++++++-------- pubspec.lock | 2 +- 7 files changed, 64 insertions(+), 52 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c46fb2c3..ebeabbd1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -447,7 +447,7 @@ const Map> localizedValues = { 'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة' }, - 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, + 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'المريض حامل'}, 'treatmentLine': { 'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج' 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 dd93be70..d23397da 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 @@ -44,6 +44,7 @@ class _AdmissionRequestThirdScreenState String clinicError; String doctorError; String sickLeaveCommentError; + String dietTypeError; String medicalHistoryError; String surgicalHistoryError; @@ -78,8 +79,6 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientProfileHeaderNewDesign( - // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -87,15 +86,15 @@ class _AdmissionRequestThirdScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -109,7 +108,7 @@ class _AdmissionRequestThirdScreenState AppText( TranslationBase.of(context) .specialityAndDoctorDetail, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), @@ -278,6 +277,7 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).dietType, isTextFieldHasSuffix: true, + validationError: dietTypeError, dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, @@ -426,6 +426,11 @@ class _AdmissionRequestThirdScreenState }else { sickLeaveCommentError = null; } + if(_selectedDietType == null){ + dietTypeError = TranslationBase.of(context).fieldRequired; + }else { + dietTypeError = null; + } if(_postMedicalHistoryController.text == ""){ medicalHistoryError = TranslationBase.of(context).fieldRequired; }else { 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 71a29a1e..120b6adf 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 @@ -76,15 +76,15 @@ class _AdmissionRequestThirdScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -96,7 +96,7 @@ class _AdmissionRequestThirdScreenState children: [ AppText( TranslationBase.of(context).diagnosisDetail, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), 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 05a43460..90131c03 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 @@ -91,8 +91,6 @@ class _AdmissionRequestSecondScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientProfileHeaderNewDesign( - // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -100,15 +98,15 @@ class _AdmissionRequestSecondScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -122,7 +120,7 @@ class _AdmissionRequestSecondScreenState AppText( TranslationBase.of(context) .postPlansEstimatedCost, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), @@ -170,7 +168,7 @@ class _AdmissionRequestSecondScreenState ), AppText( TranslationBase.of(context).otherInformation, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 826b0eea..b160f48c 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -134,7 +134,7 @@ class _PatientProfileScreenState extends State NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.01, crossAxisCount: 3, children: [ PatientProfileButton( @@ -679,7 +679,7 @@ class _PatientProfileScreenState extends State NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.01, crossAxisCount: 3, children: [ PatientProfileButton( diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 88b95936..12eaaa7c 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -1,8 +1,10 @@ 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/widgets/shared/text_fields/text_field_error.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; @@ -50,10 +52,12 @@ class AppTextFieldCustom extends StatefulWidget { class _AppTextFieldCustomState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Column( children: [ Container( - height: widget.height != 0 ? widget.height + 8 : null, + height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -72,7 +76,7 @@ class _AppTextFieldCustomState extends State { child: Container( padding: widget.dropDownText == null ? EdgeInsets.symmetric(vertical: 0) - : EdgeInsets.symmetric(vertical: 8), + : EdgeInsets.symmetric(vertical: 0), // 8.0 child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -82,40 +86,45 @@ class _AppTextFieldCustomState extends State { widget.dropDownText != null) AppText( widget.hintText, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.4, fontWeight: FontWeight.w700, ), widget.dropDownText == null - ? TextField( - textAlign: TextAlign.left, - decoration: - TextFieldsUtils.textFieldSelectorDecoration( - widget.hintText, null, true), - style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, - fontFamily: 'Poppins', - color: Colors.grey.shade800, - ), - controller: widget.controller, - keyboardType: widget.inputType, - enabled: widget.enabled, - minLines: widget.minLines, - maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], - onChanged: (value) { - if (widget.onChanged != null) { - widget.onChanged(value); + ? Container( + height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, + child: TextField( + textAlign: projectViewModel.isArabic + ? TextAlign.right + : TextAlign.left, + decoration: + TextFieldsUtils.textFieldSelectorDecoration( + widget.hintText, null, true), + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.7, + fontFamily: 'Poppins', + color: Color(0xFF575757), + ), + controller: widget.controller, + keyboardType: widget.inputType, + enabled: widget.enabled, + minLines: widget.minLines, + maxLines: widget.maxLines, + inputFormatters: widget.inputFormatters != null + ? widget.inputFormatters + : [], + onChanged: (value) { setState(() {}); - } - }, - ) + if (widget.onChanged != null) { + widget.onChanged(value); + } + }, + ), + ) : AppText( widget.dropDownText, fontFamily: 'Poppins', - color: Colors.grey.shade800, + color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.7, ), ], diff --git a/pubspec.lock b/pubspec.lock index d338a618..9d52ce65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: From 0f8820fa443a892638da9dd1e0c53525b700f207 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 15:08:16 +0300 Subject: [PATCH 09/21] fix profile screen and start the first step from filter page --- lib/core/enum/filter_type.dart | 4 + .../viewModel/PatientSearchViewModel.dart | 16 +- lib/routes.dart | 2 +- .../out_patient/filter_date_page.dart | 308 +++++ .../out_patient/out_patient_screen.dart | 49 +- .../profile/patient_profile_screen.dart | 1152 ----------------- .../patient_profile_screen.dart | 319 +++++ .../profile_gird_for_InPatient.dart | 275 ++++ .../profile_gird_for_other.dart | 309 +++++ .../profile_gird_for_search.dart | 164 +++ .../profile/patient-page-header-widget.dart | 2 +- .../text_fields/app_text_form_field.dart | 1 + 12 files changed, 1423 insertions(+), 1178 deletions(-) create mode 100644 lib/screens/patients/out_patient/filter_date_page.dart delete mode 100644 lib/screens/patients/profile/patient_profile_screen.dart create mode 100644 lib/screens/patients/profile/profile_screen/patient_profile_screen.dart create mode 100644 lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart create mode 100644 lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart create mode 100644 lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart diff --git a/lib/core/enum/filter_type.dart b/lib/core/enum/filter_type.dart index 4591e023..bfa781f9 100644 --- a/lib/core/enum/filter_type.dart +++ b/lib/core/enum/filter_type.dart @@ -1,2 +1,6 @@ enum FilterType { Clinic, Hospital } +enum OutPatientFilterType { Previous, Today, NextWeek } + + + diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a714cef9..40074370 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -88,14 +88,14 @@ class PatientSearchViewModel extends BaseViewModel{ bool isSearchWithKeyInfo })async { String dateTo; String dateFrom; - if (item == 'Tomorrow') { + if (item == 'Previous') { dateTo = DateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), + DateTime.now().day-1), 'yyyy-MM-dd'); dateFrom = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), + DateTime(DateTime.now().year, DateTime.now().month-3, + DateTime.now().day), 'yyyy-MM-dd'); } else if (item == 'Next Week') { @@ -127,13 +127,7 @@ class PatientSearchViewModel extends BaseViewModel{ currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; - - - if(isSearchWithKeyInfo) { - await getPatientFileInformation(currentModel); - } else { - await getOutPatient(currentModel, isLocalBusy: true); - } + await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; } diff --git a/lib/routes.dart b/lib/routes.dart index 91c3eaed..97f842f6 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import './screens/auth/login_screen.dart'; import './screens/auth/verification_methods_screen.dart'; import './screens/patients/patients_screen.dart'; -import './screens/patients/profile/patient_profile_screen.dart'; +import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart new file mode 100644 index 00000000..73632fdd --- /dev/null +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -0,0 +1,308 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.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/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class FilterDatePage extends StatefulWidget { + final OutPatientFilterType outPatientFilterType; + final PatientSearchViewModel patientSearchViewModel; + + const FilterDatePage( + {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + : super(key: key); + + @override + _FilterDatePageState createState() => _FilterDatePageState(); +} + +class _FilterDatePageState extends State { + DateTime selectedFromDate; + DateTime selectedToDate; + + @override + Widget build(BuildContext context) { + var screenSize; + return AppScaffold( + isShowAppBar: false, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery + .of(context) + .size + .height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) + ? " Filter Previous Out Patient" + : "Filter Nextweek Out Patient", + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + color: Colors.white, + child: InkWell( + onTap: () => + selectDate( + context, firstDate: getFirstDate( + widget.outPatientFilterType), + lastDate: getLastDate( + widget.outPatientFilterType)), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase + .of( + context) + .fromDate, + selectedFromDate != null + ? "${DateUtils + .convertStringToDateFormat( + selectedFromDate.toString(), + "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox(height: 10,), + Container( + color: Colors.white, + child: InkWell( + onTap: () => + selectDate( + context, isFromDate: false, + firstDate: getFirstDate( + widget.outPatientFilterType), + lastDate: getLastDate( + widget.outPatientFilterType)), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase + .of( + context) + .toDate, + selectedToDate != null + ? "${DateUtils + .convertStringToDateFormat( + selectedToDate.toString(), + "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery + .of(context) + .size + .height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + TranslationBase + .of(context) + .search, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + if (selectedFromDate == null || + selectedToDate == null) { + Helpers.showErrorToast( + "Please Select All The date Fields "); + } else { + String dateTo = DateUtils.convertDateToFormat( + selectedToDate, + 'yyyy-MM-dd'); + String dateFrom = DateUtils.convertDateToFormat( + selectedFromDate, + 'yyyy-MM-dd'); + + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + currentModel.to = dateTo; + currentModel.from= dateFrom; + widget.patientSearchViewModel.getOutPatient( + currentModel, isLocalBusy: true); + Navigator.of(context).pop(); + } + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ) + ); + } + + selectDate(BuildContext context, + {bool isFromDate = true, DateTime firstDate, lastDate}) async { + Helpers.hideKeyboard(context); + DateTime selectedDate = isFromDate + ? this.selectedFromDate ?? firstDate + : this.selectedToDate ?? lastDate; + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: firstDate, + lastDate: lastDate, + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null) { + if (isFromDate) { + setState(() { + this.selectedFromDate = picked; + }); + } else { + setState(() { + this.selectedToDate = picked; + }); + } + } + } + + getFirstDate(OutPatientFilterType outPatientFilterType) { + if (outPatientFilterType == OutPatientFilterType.Previous) { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month - 3, DateTime + .now() + .day); + } else { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, DateTime + .now() + .day + 1); + } + } + + getLastDate(OutPatientFilterType outPatientFilterType) { + if (outPatientFilterType == OutPatientFilterType.Previous) { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, (DateTime + .now() + .day - 1)); + } else { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, DateTime + .now() + .day + 7); + } + } + + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } +} diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 8a4a7b3d..f99f791b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; @@ -18,9 +19,12 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.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 'filter_date_page.dart'; + // ignore: must_be_immutable class OutPatientsScreen extends StatefulWidget { final patientSearchForm; @@ -57,9 +61,9 @@ class _OutPatientsScreenState extends State { int clinicId; AuthViewModel authProvider; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + List _times = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - int _activeLocation = 0; + int _activeLocation = 1; String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -70,21 +74,30 @@ class _OutPatientsScreenState extends State { PatientModel patient; + OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; @override Widget build(BuildContext context) { authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, + _times = [ + TranslationBase + .of(context) + .previous, + TranslationBase + .of(context) + .today, + TranslationBase + .of(context) + .nextWeek, ]; - final screenSize = MediaQuery.of(context).size; + final screenSize = MediaQuery + .of(context) + .size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -108,8 +121,8 @@ class _OutPatientsScreenState extends State { child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item + children: _times.map((item) { + bool _isActive = _times[_activeLocation] == item ? true : false; @@ -117,7 +130,8 @@ class _OutPatientsScreenState extends State { child: InkWell( onTap: () async { setState(() { - _activeLocation = _locations.indexOf(item); + _activeLocation = _times.indexOf(item); + outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; }); GifLoaderDialogUtils.showMyDialog(context); await model.getPatientBasedOnDate(item: item, @@ -181,17 +195,26 @@ class _OutPatientsScreenState extends State { AppTextFormField( // focusNode: focusProject, controller: _controller, - borderColor: Colors.white, + borderColor: Colors.white + , prefix: IconButton( icon: Icon( - DoctorApp.filter_1, + _activeLocation == 1 + ? DoctorApp.filter_1 + : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, padding: EdgeInsets.only( bottom: 30), + onPressed: _activeLocation == 1 ? null : () { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); + }, ), + onChanged: (String str) { model.searchData(str); }), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart deleted file mode 100644 index 31be0812..00000000 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ /dev/null @@ -1,1152 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.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_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/material.dart'; - -import '../../../routes.dart'; - -class PatientProfileScreen extends StatefulWidget { - @override - _PatientProfileScreenState createState() => _PatientProfileScreenState(); -} - -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { - PatiantInformtion patient; - - bool isFromSearch = false; - - bool isInpatient = false; - - bool isDischargedPatient = false; - bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; - int index = 0; - int _activeTab = 0; - @override - void initState() { - _tabController = TabController(length: 2, vsync: this); - super.initState(); - } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; - if (routeArgs.containsKey("isSearch")) { - isFromSearch = routeArgs['isSearch']; - } - if (routeArgs.containsKey("isInpatient")) { - isInpatient = routeArgs['isInpatient']; - } - if (routeArgs.containsKey("isDischargedPatient")) { - isDischargedPatient = routeArgs['isDischargedPatient']; - }if (routeArgs.containsKey("isSearchAndOut")) { - isSearchAndOut = routeArgs['isSearchAndOut']; - } - if (isInpatient) - _activeTab = 0; - else - _activeTab = 1; - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase - .of(context) - .patientProfile, - isShowAppBar: false, - //TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient?240:0, - ), - - Container( - height: !isSearchAndOut ? isDischargedPatient?MediaQuery - .of(context) - .size - .height * 0.64 : MediaQuery - .of(context) - .size - .height * 0.65 : MediaQuery - .of(context) - .size - .height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? Column( - children: [ - - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ) - : isInpatient - ? Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: true, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - "Order", - //"Text", - nameLine2: - "Sheet", - //TranslationBase.of(context).orders, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: - "Medical", - //Health - isInPatient: isInpatient, - nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], - ), - ) - : Column( - children: [ - Padding( - padding: const EdgeInsets - .symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => - Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase - .of(context) - .createNew}\n${TranslationBase - .of(context) - .episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == - 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = - model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase - .of(context) - .update}\n${TranslationBase - .of(context) - .episode}", - color: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - ], - ), - ], - ), - )); - } - - Widget tabsBar(BuildContext context, Size screenSize) { - List _tabs = [ - "Inpatient Info".toUpperCase(), - "Outpatient Info".toUpperCase(), - ]; - - return Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _tabs.map((item) { - bool _isActive = _tabs[_activeTab] == item ? true : false; - - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeTab = _tabs.indexOf(item); - }); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ), - ); - }).toList(), - ), - ); - } -} - -class AvatarWidget extends StatelessWidget { - final Widget avatarIcon; - - AvatarWidget(this.avatarIcon); - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(35.0)), - color: Color(0xffCCCCCC), - ), - child: avatarIcon, - ); - } -} diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart new file mode 100644 index 00000000..44641b4b --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -0,0 +1,319 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/profile_screen/profile_gird_for_InPatient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +class PatientProfileScreen extends StatefulWidget { + @override + _PatientProfileScreenState createState() => _PatientProfileScreenState(); +} + +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + bool isSearchAndOut = false; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; + int index = 0; + int _activeTab = 0; + @override + void initState() { + _tabController = TabController(length: 2, vsync: this); + super.initState(); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + } + if (routeArgs.containsKey("isSearchAndOut")) { + isSearchAndOut = routeArgs['isSearchAndOut']; + } + if (isInpatient) + _activeTab = 0; + else + _activeTab = 1; + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: false, + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + ), + Container( + height: !isSearchAndOut + ? isDischargedPatient + ? MediaQuery.of(context).size.height * 0.64 + : MediaQuery.of(context).size.height * 0.65 + : MediaQuery.of(context).size.height * 0.69, + child: ListView( + children: [ + Container( + child: isSearchAndOut + ? ProfileGridForSearch( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ) + : isInpatient + ? ProfileGridForInPatient( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + isDischargedPatient: + isDischargedPatient, + isFromSearch: isFromSearch, + ) + : ProfileGridForOther( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ), + ), + ], + ), + ), + ], + ), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), + ], + ), + ], + ), + )); + } + + Widget tabsBar(BuildContext context, Size screenSize) { + List _tabs = [ + "Inpatient Info".toUpperCase(), + "Outpatient Info".toUpperCase(), + ]; + + return Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart new file mode 100644 index 00000000..457fe04e --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -0,0 +1,275 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +// ignore: must_be_immutable +class ProfileGridForInPatient extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + final bool isDischargedPatient; + final bool isFromSearch; + String from; + String to; + + ProfileGridForInPatient( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", + nameLine2: + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: + "Medical", + //Health + isInPatient: isInpatient, + nameLine2: + "Report", + //Report + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart new file mode 100644 index 00000000..5b7112d6 --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -0,0 +1,309 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +// ignore: must_be_immutable +class ProfileGridForOther extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + String from; + String to; + + ProfileGridForOther( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding( + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase.of( + context) + .vital, + nameLine2: + TranslationBase.of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: LAB_RESULT, + nameLine1: + TranslationBase.of( + context) + .lab, + nameLine2: + TranslationBase.of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase.of( + context) + .radiology, + nameLine2: + TranslationBase.of( + context) + .service, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase.of( + context) + .orders, + nameLine2: + TranslationBase.of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: + TranslationBase.of( + context) + .patient, + nameLine2: "ECG", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PROCEDURE, + nameLine1: + TranslationBase.of( + context) + .orders, + nameLine2: + TranslationBase.of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase.of( + context) + .insurance, + nameLine2: + TranslationBase.of( + context) + .service, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase.of( + context) + .patientSick, + nameLine2: + TranslationBase.of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase.of( + context) + .patient, + nameLine2: + TranslationBase.of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase.of( + context) + .referral, + nameLine2: + TranslationBase.of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase.of( + context) + .admission, + nameLine2: + TranslationBase.of( + context) + .request, + icon: + 'patient/admission_req.png'), + ], + ), + ), + ], + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart new file mode 100644 index 00000000..ed3c4dfd --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -0,0 +1,164 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +class ProfileGridForSearch extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + String from; + String to; + + ProfileGridForSearch( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + ], + ), + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index b9312289..49ad8f4e 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.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'; diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index 8fed3cd8..cf5f0abf 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -48,6 +48,7 @@ class AppTextFormField extends FormField { }, textInputAction: textInputAction, onFieldSubmitted: onFieldSubmitted, + decoration: InputDecoration( hintText: hintText, suffixIcon: prefix, From f0457f4e99a69a543eb55d4c237eb5cc6b51bcbc Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 16:28:48 +0300 Subject: [PATCH 10/21] finish filter page --- .../viewModel/PatientSearchViewModel.dart | 8 +- .../out_patient/filter_date_page.dart | 15 +- .../profile/patient_profile_screen.dart | 1153 ----------------- 3 files changed, 13 insertions(+), 1163 deletions(-) delete mode 100644 lib/screens/patients/profile/patient_profile_screen.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 40074370..9ef94647 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -2,14 +2,9 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; - -import '../../locator.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patientInPatientService.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -61,7 +56,6 @@ class PatientSearchViewModel extends BaseViewModel{ } else { setState(ViewState.Error); } - setState(ViewState.Error); } else { filterData = _outPatientService.patientList; setState(ViewState.Idle); diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 73632fdd..034f6136 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -161,7 +163,7 @@ class _FilterDatePageState extends State { .search, padding: 10, color: Color(0xFF359846), - onPressed: () { + onPressed: () async { if (selectedFromDate == null || selectedToDate == null) { Helpers.showErrorToast( @@ -177,9 +179,16 @@ class _FilterDatePageState extends State { PatientSearchRequestModel currentModel = PatientSearchRequestModel(); currentModel.to = dateTo; currentModel.from= dateFrom; - widget.patientSearchViewModel.getOutPatient( + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientSearchViewModel.getOutPatient( currentModel, isLocalBusy: true); - Navigator.of(context).pop(); + GifLoaderDialogUtils.hideDialog(context); + if(widget.patientSearchViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientSearchViewModel.error); + }else { + Navigator.of(context).pop(); + } + } }, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart deleted file mode 100644 index 24f6448b..00000000 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ /dev/null @@ -1,1153 +0,0 @@ - -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.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_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/material.dart'; - -import '../../../routes.dart'; - -class PatientProfileScreen extends StatefulWidget { - @override - _PatientProfileScreenState createState() => _PatientProfileScreenState(); -} - -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { - PatiantInformtion patient; - - bool isFromSearch = false; - - bool isInpatient = false; - - bool isDischargedPatient = false; - bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; - int index = 0; - int _activeTab = 0; - @override - void initState() { - _tabController = TabController(length: 2, vsync: this); - super.initState(); - } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; - if (routeArgs.containsKey("isSearch")) { - isFromSearch = routeArgs['isSearch']; - } - if (routeArgs.containsKey("isInpatient")) { - isInpatient = routeArgs['isInpatient']; - } - if (routeArgs.containsKey("isDischargedPatient")) { - isDischargedPatient = routeArgs['isDischargedPatient']; - }if (routeArgs.containsKey("isSearchAndOut")) { - isSearchAndOut = routeArgs['isSearchAndOut']; - } - if (isInpatient) - _activeTab = 0; - else - _activeTab = 1; - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase - .of(context) - .patientProfile, - isShowAppBar: false, - //TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient?240:0, - ), - - Container( - height: !isSearchAndOut ? isDischargedPatient?MediaQuery - .of(context) - .size - .height * 0.64 : MediaQuery - .of(context) - .size - .height * 0.65 : MediaQuery - .of(context) - .size - .height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? Column( - children: [ - - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.01, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ) - : isInpatient - ? Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.01, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: true, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - "Order", - //"Text", - nameLine2: - "Sheet", - //TranslationBase.of(context).orders, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: - "Medical", - //Health - isInPatient: isInpatient, - nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], - ), - ) - : Column( - children: [ - Padding( - padding: const EdgeInsets - .symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.01, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase - .of( - context) - .admission, - nameLine2: - TranslationBase - .of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => - Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase - .of(context) - .createNew}\n${TranslationBase - .of(context) - .episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == - 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = - model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase - .of(context) - .update}\n${TranslationBase - .of(context) - .episode}", - color: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - ], - ), - ], - ), - )); - } - - Widget tabsBar(BuildContext context, Size screenSize) { - List _tabs = [ - "Inpatient Info".toUpperCase(), - "Outpatient Info".toUpperCase(), - ]; - - return Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _tabs.map((item) { - bool _isActive = _tabs[_activeTab] == item ? true : false; - - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeTab = _tabs.indexOf(item); - }); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ), - ); - }).toList(), - ), - ); - } -} - -class AvatarWidget extends StatelessWidget { - final Widget avatarIcon; - - AvatarWidget(this.avatarIcon); - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(35.0)), - color: Color(0xffCCCCCC), - ), - child: avatarIcon, - ); - } -} \ No newline at end of file From c86a3dabdab82e5328c46e2ab467628e4481eae5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 29 Apr 2021 16:32:25 +0300 Subject: [PATCH 11/21] page translation --- lib/config/localized_values.dart | 82 +++++++++++++- .../medical-file/medical_file_details.dart | 29 +++-- .../medical-file/medical_file_page.dart | 13 ++- .../insurance_approval_screen_patient.dart | 22 ++-- .../patients/insurance_approvals_details.dart | 104 +++++++++++++----- .../profile/lab_result/labs_home_page.dart | 69 +++++++----- .../radiology/radiology_home_page.dart | 69 +++++++----- .../prescription/add_prescription_form.dart | 36 ++++-- .../prescription_item_in_patient_page.dart | 14 +-- .../prescription/prescriptions_page.dart | 32 +++--- .../procedures/add-procedure-form.dart | 30 +++-- lib/screens/procedures/add_lab_orders.dart | 10 +- .../procedures/add_radiology_order.dart | 9 +- lib/screens/procedures/procedure_screen.dart | 33 ++++-- lib/util/translations_delegate_base.dart | 59 +++++++++- lib/widgets/shared/doctor_card_insurance.dart | 6 +- 16 files changed, 447 insertions(+), 170 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea99a982..c494dbe0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -384,10 +384,7 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': { - 'en': "Body Mass Index is", - 'ar': 'مؤشر كتلة الجسم هو' - }, + 'yourBodyMassIndex': {'en': "Body Mass Index is", 'ar': 'مؤشر كتلة الجسم هو'}, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, @@ -870,4 +867,81 @@ const Map> localizedValues = { }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, + "pleaseEnterProcedure": { + "en": "Please Enter Procedure", + "ar": "الرجاء إدخال الإجراء " + }, + "fillTheMandatoryProcedureDetails": { + "en": "Fill The Mandatory Procedure Details", + "ar": "املأ تفاصيل الإجراء الإلزامي" + }, + "atLeastThreeCharacters": { + "en": "At least three Characters", + "ar": "ثلاثة أحرف على الأقل " + }, + "searchProcedureHere": { + "en": "Search Procedure here...", + "ar": "إجراء البحث هنا ... " + }, + "noInsuranceApprovalFound": { + "en": "No Insurance Approval Found", + "ar": "لم يتم العثور على موافقة التأمين" + }, + "procedure": {"en": "Procedure", "ar": "عملية"}, + "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, + "processed": {"en": "processed", "ar": "معالجتها"}, + "direction": {"en": "Direction", "ar": "إشراف"}, + "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, + "medicationHasBeenAdded": { + "en": "Medication has been added", + "ar": "تمت إضافة الدواء" + }, + "newPrescriptionOrder": { + "en": "New Prescription Order", + "ar": "طلب وصفة طبية جديد " + }, + "pleaseFillAllFields": { + "en": "Please Fill All Fields", + "ar": "لو سمحت أملأ كل الحقول" + }, + "narcoticMedicineCanOnlyBePrescribedFromVida": { + "en": "Narcotic medicine can only be prescribed from VIDA", + "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " + }, + "only5DigitsAllowedForStrength": { + "en": "Only 5 Digits allowed for strength", + "ar": "يسمح فقط بـ 5 أرقام للقوة" + }, + "unit": {"en": "Unit", "ar": "وحدة"}, + "boxQuantity": {"en": "Box Quantity", "ar": "كمية الصندوق "}, + "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, + "applyForRadiologyOrder": { + "en": "Apply for Radiology Order", + "ar": "التقدم بطلب للحصول على طلب الأشعة " + }, + "applyForNewLabOrder": { + "en": "Apply for New Lab Order", + "ar": "تقدم بطلب جديد للمختبر الأشعة" + }, + "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب معمل"}, + "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشغة"}, + "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, + "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, + "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, + "health": {"en": "Health", "ar": "التقرير"}, + "summary": {"en": "Summary", "ar": "الصحي"}, + "applyForNewPrescriptionsOrder": { + "en": "Apply for New Prescriptions Order", + "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " + }, + "noPrescriptionsFound": { + "en": "No Prescriptions Found", + "ar": "لم يتم العثور على وصفات طبية" + }, + "noMedicalFileFound": { + "en": "No Medical File Found", + "ar": "لم يتم العثور على ملف طبي" + }, + "insurance22": {"en": "Insurance", "ar": "موافقات"}, + "approvals22": {"en": "Approvals", "ar": "التامين"}, }; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 828210e0..1c06fd0c 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -378,7 +378,10 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Condition: ', + TranslationBase.of( + context) + .condition + + ": ", fontSize: 12.5, ), Expanded( @@ -435,7 +438,10 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Type: ', + TranslationBase.of( + context) + .type + + ": ", fontSize: 15.5, ), Expanded( @@ -617,7 +623,10 @@ class _MedicalFileDetailsState extends State { Column( children: [ AppText( - 'Order Date: ', + TranslationBase.of( + context) + .orderDate + + ": ", ), AppText( DateUtils.getDateFormatted( @@ -807,9 +816,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText( - 'Exam Type: ', - ), + AppText(TranslationBase.of( + context) + .examType + + ": "), AppText( model .medicalFileList[ @@ -854,9 +864,10 @@ class _MedicalFileDetailsState extends State { ), Row( children: [ - AppText( - 'Abnormal: ', - ), + AppText(TranslationBase.of( + context) + .abnormal + + ": "), AppText( model .medicalFileList[ diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index b7587efb..b2590296 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,7 +31,11 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), + patient, + patientType.toString() ?? "0", + arrivalType, + isInpatient: isInpatient, + ), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( @@ -51,7 +55,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Health', + TranslationBase.of(context).health, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -61,7 +65,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Summary', + TranslationBase.of(context).summary, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -193,7 +197,8 @@ class _MedicalFilePageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Medical File Found'), + child: AppText(TranslationBase.of(context) + .noMedicalFileFound), ) ], ), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index ab3abbe9..2e4645ae 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -45,7 +45,11 @@ class _InsuranceApprovalScreenNewState builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), + patient, + patientType.toString() ?? "0", + patientType, + isInpatient: isInpatient, + ), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, @@ -67,7 +71,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +81,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -141,7 +145,8 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Insurance Approval Found'), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ), SizedBox( height: 150.0, @@ -168,7 +173,8 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context) + .insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -178,7 +184,8 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context) + .approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -238,7 +245,8 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Insurance Approval Found'), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ) ], ), diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 931f4051..e6284be7 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -67,7 +68,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +78,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -121,7 +122,9 @@ class _InsuranceApprovalsDetailsState extends State { .approvalStatusDescption != null ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127) : Color(0xffD02127), @@ -192,7 +195,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Clinic: ', + TranslationBase.of( + context) + .clinic + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -210,7 +216,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approval No: ', + TranslationBase.of( + context) + .approvalNo + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -244,7 +253,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Company Name :', + TranslationBase.of( + context) + .companyName + + ": ", color: Colors.grey[500], ), AppText('Sample') @@ -253,7 +265,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Receipt on: ', + TranslationBase.of( + context) + .receiptOn + + ": ", color: Colors.grey[500], ), Expanded( @@ -269,7 +284,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Exp on: ', + TranslationBase.of( + context) + .expiryDate + + ": ", color: Colors.grey[500], ), AppText( @@ -300,19 +318,22 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - 'Procedure', + TranslationBase.of(context) + .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Status', + TranslationBase.of(context) + .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Usage Status', + TranslationBase.of(context) + .usageStatus, fontWeight: FontWeight.w700, ), ) @@ -424,7 +445,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -434,7 +455,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -548,7 +569,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Clinic: ', + TranslationBase.of( + context) + .clinic + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -566,7 +590,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approval No: ', + TranslationBase.of( + context) + .approvalNo + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -583,7 +610,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Unused Count:', + TranslationBase.of( + context) + .unusedCount + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -600,7 +630,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Company Name :', + TranslationBase.of( + context) + .companyName + + ": ", color: Colors.grey[500], ), AppText('Sample') @@ -609,7 +642,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Receipt on: ', + TranslationBase.of( + context) + .receiptOn + + ": ", color: Colors.grey[500], ), Expanded( @@ -625,16 +661,23 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Exp on: ', + TranslationBase.of( + context) + .expiryDate + + ": ", color: Colors.grey[500], ), - if(model.insuranceApproval[indexInsurance].expiryDate!=null) - AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), + if (model + .insuranceApproval[ + indexInsurance] + .expiryDate != + null) + AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), ], ), ], @@ -657,19 +700,22 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - 'Procedure', + TranslationBase.of(context) + .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Status', + TranslationBase.of(context) + .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Usage Status', + TranslationBase.of(context) + .usageStatus, fontWeight: FontWeight.w700, ), ) diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 290f9569..c77e33d9 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -44,7 +44,11 @@ class _LabsHomePageState extends State { backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), + patient, + patient.patientType.toString() ?? '0', + patientType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -63,13 +67,13 @@ class _LabsHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Lab', + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -84,13 +88,13 @@ class _LabsHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Lab', + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -110,7 +114,7 @@ class _LabsHomePageState extends State { )), ); }, - label: 'Apply for New Lab Order', + label: TranslationBase.of(context).applyForNewLabOrder, ), ...List.generate( model.patientLabOrdersList.length, @@ -132,11 +136,13 @@ class _LabsHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.patientLabOrdersList[index].isLiveCareAppointment + color: model.patientLabOrdersList[index] + .isLiveCareAppointment ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), + : !model.patientLabOrdersList[index] + .isInOutPatient + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), bottomLeft: Radius.circular(8), @@ -146,17 +152,19 @@ class _LabsHomePageState extends State { quarterTurns: 3, child: Center( child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient + model.patientLabOrdersList[index] + .isLiveCareAppointment ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -168,19 +176,26 @@ class _LabsHomePageState extends State { context, FadePage( page: LaboratoryResultPage( - patientLabOrders: model.patientLabOrdersList[index], + patientLabOrders: + model.patientLabOrdersList[index], patient: patient, arrivalType: arrivalType, patientType: patientType, ), ), ), - doctorName: model.patientLabOrdersList[index].doctorName, - invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL, - branch: model.patientLabOrdersList[index].projectName, - clinic: model.patientLabOrdersList[index].clinicDescription, - appointmentDate: model.patientLabOrdersList[index].orderDate, + doctorName: + model.patientLabOrdersList[index].doctorName, + invoiceNO: + ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model + .patientLabOrdersList[index].doctorImageURL, + branch: + model.patientLabOrdersList[index].projectName, + clinic: model + .patientLabOrdersList[index].clinicDescription, + appointmentDate: + model.patientLabOrdersList[index].orderDate, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 81e0e6cf..294a8854 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -47,7 +47,11 @@ class _RadiologyHomePageState extends State { backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: isInpatient, + ), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -65,13 +69,13 @@ class _RadiologyHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Radiology', + TranslationBase.of(context).radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -86,13 +90,13 @@ class _RadiologyHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Radiology', + TranslationBase.of(context).radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -112,7 +116,7 @@ class _RadiologyHomePageState extends State { )), ); }, - label: 'Apply for Radiology Order', + label: TranslationBase.of(context).applyForRadiologyOrder, ), ...List.generate( model.radiologyList.length, @@ -134,32 +138,34 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment + color: model.radiologyList[index] + .isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), bottomLeft: Radius.circular(8), - ), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index].isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index].isInOutPatient + model.radiologyList[index] + .isLiveCareAppodynamicment ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + .liveCare + .toUpperCase() + : !model.radiologyList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -167,19 +173,26 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, - appointmentDate: model.radiologyList[index].orderDate?? - model.radiologyList[index].reportDate, + doctorName: + model.radiologyList[index].doctorName, + profileUrl: + model.radiologyList[index].doctorImageURL, + invoiceNO: + '${model.radiologyList[index].invoiceNo}', + branch: + '${model.radiologyList[index].projectName}', + clinic: model + .radiologyList[index].clinicDescription, + appointmentDate: + model.radiologyList[index].orderDate ?? + model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], + finalRadiology: + model.radiologyList[index], patient: patient, ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index c99bb063..baebe130 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -25,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_fiel import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { @@ -188,6 +190,7 @@ class _PrescriptionFormWidgetState extends State { Widget build(BuildContext context) { ListSelectDialog drugDialog; final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; @@ -258,7 +261,8 @@ class _PrescriptionFormWidgetState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - 'New Prescription Order', + TranslationBase.of(context) + .newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -284,7 +288,6 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -407,7 +410,8 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ AppText( - 'Order Type', + TranslationBase.of(context) + .orderType, fontWeight: FontWeight.w600, ), Radio( @@ -460,7 +464,10 @@ class _PrescriptionFormWidgetState extends State { if (strengthChar >= 5) { DrAppToastMsg .showErrorToast( - "Only 5 Digits allowed for strength"); + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, + ); } }, onSubmit: (_) { @@ -554,7 +561,9 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - 'UNIT', + TranslationBase.of( + context) + .unit, units != null ? units[ 'description'] @@ -1066,9 +1075,14 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - "Box Quantity", + TranslationBase.of( + context) + .boxQuantity, box != null - ? "Box Quantity: " + + ? TranslationBase.of( + context) + .boxQuantity + + ": " + model .boxQuintity .toString() @@ -1124,14 +1138,18 @@ class _PrescriptionFormWidgetState extends State { selectedDate == null || units == null) { DrAppToastMsg.showErrorToast( - "Please Fill All Fields"); + TranslationBase.of( + context) + .pleaseFillAllFields); return; } if (_selectedMedication .isNarcotic == true) { DrAppToastMsg.showErrorToast( - "Narcotic medicine can only be prescribed from VIDA"); + TranslationBase.of( + context) + .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index af0f66e5..b29a2169 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -271,7 +271,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Direction', + TranslationBase.of(context).direction, color: Colors.grey, ), Expanded( @@ -286,7 +286,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Route', + TranslationBase.of(context).route, color: Colors.grey, ), AppText(" " + @@ -301,7 +301,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Refill', + TranslationBase.of(context).refill, color: Colors.grey, ), Expanded( @@ -316,7 +316,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Start Date ', + TranslationBase.of(context).startDate, color: Colors.grey, ), Expanded( @@ -332,7 +332,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Stop Date', + TranslationBase.of(context).stopDate, color: Colors.grey, ), Expanded( @@ -377,7 +377,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Status', + TranslationBase.of(context).status, color: Colors.grey, ), AppText(" " + @@ -392,7 +392,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Processed', + TranslationBase.of(context).processed, color: Colors.grey, ), AppText(" " + diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index be212dc9..19620dda 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.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_scaffold_widget.dart'; @@ -28,16 +29,19 @@ class PrescriptionsPage extends StatelessWidget { bool isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - isSelectInpatient - ? model.getPrescriptionsInPatient(patient) - : model.getPrescriptions(patient, patientType: patientType), + onModelReady: (model) => isSelectInpatient + ? model.getPrescriptionsInPatient(patient) + : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType,isInpatient: isInpatient,), + patient, + patientType ?? '0', + arrivalType, + isInpatient: isInpatient, + ), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, @@ -55,13 +59,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order', + TranslationBase.of(context).orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Prescriptions', + TranslationBase.of(context).prescriptions, bold: true, fontSize: 22, ), @@ -76,13 +80,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order', + TranslationBase.of(context).orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Prescriptions', + TranslationBase.of(context).prescriptions, bold: true, fontSize: 22, ), @@ -96,7 +100,8 @@ class PrescriptionsPage extends StatelessWidget { addPrescriptionForm(context, model, patient, model.prescriptionList); }, - label: 'Apply for New Prescriptions Order', + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -140,7 +145,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Prescriptions Found'), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), @@ -209,8 +215,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Prescriptions Found In Patentiss'), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 7cc9818b..df748922 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -165,7 +165,8 @@ class _AddSelectedProcedureState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'Please Enter Procedure', + TranslationBase.of(context) + .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -187,7 +188,8 @@ class _AddSelectedProcedureState extends State { Container( width: MediaQuery.of(context).size.width * 0.85, child: AppTextFieldCustom( - hintText: 'Search Procedure here...', + hintText: TranslationBase.of(context) + .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -199,11 +201,15 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { - if(procedureName.text.isNotEmpty && procedureName.text.length>=3) - model.getProcedureCategory( - categoryName: procedureName.text); + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + categoryName: procedureName.text); else - DrAppToastMsg.showErrorToast('At least three Characters'); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); }, ), ), @@ -212,11 +218,15 @@ class _AddSelectedProcedureState extends State { ), InkWell( onTap: () { - if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) model.getProcedureCategory( categoryName: procedureName.text); else - DrAppToastMsg.showErrorToast('At least three Characters'); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); }, child: Icon( Icons.search, @@ -419,7 +429,9 @@ class _AddSelectedProcedureState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); return; } diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index b7bc2835..4a20dbaa 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -9,6 +9,7 @@ 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/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/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -160,7 +161,7 @@ class _AddSelectedLabOrderState extends State { Row( children: [ AppText( - 'New Lab Order', + TranslationBase.of(context).applyForNewLabOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -218,7 +219,8 @@ class _AddSelectedLabOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: "Add Lab Order", //TranslationBase.of(context) + title: TranslationBase.of(context) + .addLabOrder, //TranslationBase.of(context) fontWeight: FontWeight.w700, //.addSelectedProcedures, color: Color(0xff359846), @@ -227,7 +229,9 @@ class _AddSelectedLabOrderState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); return; } diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 4c1c8468..3f19e7f9 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -9,6 +9,7 @@ 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/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/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -161,7 +162,7 @@ class _AddSelectedRadiologyOrderState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'New Radiology Order', + TranslationBase.of(context).newRadiologyOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -216,15 +217,15 @@ class _AddSelectedRadiologyOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: 'Add Radiology Order', + title: TranslationBase.of(context).addRadiologyOrder, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { //print(entityList.toString()); onPressed: if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .fillTheMandatoryProcedureDetails); return; } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 51122999..7e18055d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.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-profile-header-new-design-app-bar.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:flutter/material.dart'; - import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { @@ -32,15 +32,21 @@ class ProcedureScreen extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType,), + onModelReady: (model) => model.getProcedure( + mrn: patient.patientId, + patientType: patientType, + ), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,), + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -57,13 +63,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order Test or', + TranslationBase.of(context).orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Procedure', + TranslationBase.of(context).procedure, bold: true, fontSize: 22, ), @@ -78,13 +84,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order Test or', + TranslationBase.of(context).orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Procedure', + TranslationBase.of(context).procedure, bold: true, fontSize: 22, ), @@ -135,7 +141,7 @@ class ProcedureScreen extends StatelessWidget { height: 10, ), AppText( - 'Add More Procedure', + TranslationBase.of(context).addMoreProcedure, color: Colors.grey[600], fontWeight: FontWeight.w600, ) @@ -183,8 +189,9 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) - + if (model.state == ViewState.ErrorLocal || + (model.procedureList.isNotEmpty && + model.procedureList[0].entityList.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -195,7 +202,9 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '), + child: AppText(model.procedureList.isEmpty + ? model.error + : 'No Procedure Found '), ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6602722c..c86ba9e3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,9 +100,11 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -1176,7 +1178,8 @@ class TranslationBase { localizedValues['SpecialResult'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -1247,6 +1250,56 @@ class TranslationBase { String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => + localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get procedure => localizedValues["procedure"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get processed => localizedValues["processed"][locale.languageCode]; + String get direction => localizedValues["direction"][locale.languageCode]; + String get refill => localizedValues["refill"][locale.languageCode]; + String get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + [locale.languageCode]; + String get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + String get unit => localizedValues["unit"][locale.languageCode]; + String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get addRadiologyOrder => + localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => + localizedValues["newRadiologyOrder"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get examType => localizedValues["examType"][locale.languageCode]; + String get health => localizedValues["health"][locale.languageCode]; + String get summary => localizedValues["summary"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => + localizedValues["noMedicalFileFound"][locale.languageCode]; + String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get approvals22 => localizedValues["approvals22"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index a163ef24..2b0aae7c 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -59,7 +59,8 @@ class DoctorCardInsurance extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: approvalStatus == "Approved" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -79,7 +80,8 @@ class DoctorCardInsurance extends StatelessWidget { children: [ AppText( "$approvalStatus", - color: approvalStatus == "Approved" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), From 51e9df740144d091d25e4a8af7f1785649db389a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 29 Apr 2021 16:36:49 +0300 Subject: [PATCH 12/21] page translation --- lib/config/localized_values.dart | 5 +---- lib/util/translations_delegate_base.dart | 12 ++++++++---- pubspec.lock | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dbce6d1a..d5999b21 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -384,10 +384,7 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': { - 'en': "Body Mass Index is", - 'ar': 'مؤشر كتلة الجسم هو' - }, + 'yourBodyMassIndex': {'en': "Body Mass Index is", 'ar': 'مؤشر كتلة الجسم هو'}, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 67764fc4..cc6513d0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,9 +100,11 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -1176,7 +1178,8 @@ class TranslationBase { localizedValues['SpecialResult'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -1298,7 +1301,8 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..e9386145 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From fe581ae7ce8675133413210185a14928d751bc42 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 16:38:30 +0300 Subject: [PATCH 13/21] remove button height --- lib/widgets/shared/buttons/app_buttons_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index e63acba2..66aaac09 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -49,7 +49,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - height: MediaQuery.of(context).size.height * 0.075, + // height: 60,//MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( From ed3449bcf4e5d05f5d4780d36ccbf1db2c739a89 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 29 Apr 2021 16:43:31 +0300 Subject: [PATCH 14/21] fix the doctor card in lab result and radiology --- ios/Podfile.lock | 2 +- .../profile/lab_result/labs_home_page.dart | 10 ++++-- .../radiology/radiology_home_page.dart | 7 ++-- lib/widgets/patients/PatientCard.dart | 34 ------------------- 4 files changed, 13 insertions(+), 40 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a365fcf4..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 290f9569..dfba4578 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/lab_result/laboratory_result_page.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class LabsHomePage extends StatefulWidget { @override @@ -37,6 +39,7 @@ class _LabsHomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( @@ -131,15 +134,16 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) color: model.patientLabOrdersList[index].isLiveCareAppointment ? Colors.red[900] : !model.patientLabOrdersList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), + bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) ), ), child: RotatedBox( diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 81e0e6cf..d96a908a 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -39,6 +39,7 @@ class _RadiologyHomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), @@ -140,8 +141,10 @@ class _RadiologyHomePageState extends State { ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), + topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), + bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) ), ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index fd60b21d..aa6f114f 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -398,39 +398,5 @@ class PatientCard extends StatelessWidget { ])); } - convertDateFormat2(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } } From 7337dc4f879439e3ee4f0102abd9af3d8df3a38e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:16:11 +0300 Subject: [PATCH 15/21] date picker --- lib/core/viewModel/PatientSearchViewModel.dart | 16 ++++++++++++---- .../patients/out_patient/filter_date_page.dart | 9 ++++++--- .../patients/out_patient/out_patient_screen.dart | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 9ef94647..7fbd7d1f 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -16,6 +16,9 @@ class PatientSearchViewModel extends BaseViewModel{ List filterData = []; + DateTime selectedFromDate; + DateTime selectedToDate; + searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { @@ -83,14 +86,19 @@ class PatientSearchViewModel extends BaseViewModel{ String dateTo; String dateFrom; if (item == 'Previous') { + + selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, + DateTime.now().day); + selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day-1); dateTo = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day-1), + selectedToDate, 'yyyy-MM-dd'); dateFrom = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month-3, - DateTime.now().day), + selectedFromDate, 'yyyy-MM-dd'); + + } else if (item == 'Next Week') { diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 034f6136..a8f7904d 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,6 +16,7 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; + const FilterDatePage( {Key key, this.outPatientFilterType, this.patientSearchViewModel}) : super(key: key); @@ -30,6 +31,8 @@ class _FilterDatePageState extends State { @override Widget build(BuildContext context) { + DateTime selectedFromDate = widget.patientSearchViewModel.selectedFromDate; + DateTime selectedToDate= widget.patientSearchViewModel.selectedToDate; var screenSize; return AppScaffold( isShowAppBar: false, @@ -235,9 +238,9 @@ class _FilterDatePageState extends State { return DateTime( DateTime .now() - .year, DateTime + .year -20, DateTime .now() - .month - 3, DateTime + .month, DateTime .now() .day); } else { @@ -257,7 +260,7 @@ class _FilterDatePageState extends State { return DateTime( DateTime .now() - .year, DateTime + .year +20, DateTime .now() .month, (DateTime .now() diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index f99f791b..953e7722 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -199,7 +199,7 @@ class _OutPatientsScreenState extends State { , prefix: IconButton( icon: Icon( - _activeLocation == 1 + _activeLocation !=0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, @@ -208,7 +208,7 @@ class _OutPatientsScreenState extends State { padding: EdgeInsets.only( bottom: 30), - onPressed: _activeLocation == 1 ? null : () { + onPressed: _activeLocation !=0 ? null : () { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); From 4d87c6fb7571d2d92a7ac1b290c2bb137ec82ff0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:24:31 +0300 Subject: [PATCH 16/21] date fix --- .../out_patient/filter_date_page.dart | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index a8f7904d..541a70eb 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -26,13 +26,15 @@ class FilterDatePage extends StatefulWidget { } class _FilterDatePageState extends State { - DateTime selectedFromDate; - DateTime selectedToDate; + @override + void initState() { + // TODO: implement initState + super.initState(); + } @override Widget build(BuildContext context) { - DateTime selectedFromDate = widget.patientSearchViewModel.selectedFromDate; - DateTime selectedToDate= widget.patientSearchViewModel.selectedToDate; + var screenSize; return AppScaffold( isShowAppBar: false, @@ -80,10 +82,10 @@ class _FilterDatePageState extends State { .of( context) .fromDate, - selectedFromDate != null + widget.patientSearchViewModel.selectedFromDate != null ? "${DateUtils .convertStringToDateFormat( - selectedFromDate.toString(), + widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -113,10 +115,10 @@ class _FilterDatePageState extends State { .of( context) .toDate, - selectedToDate != null + widget.patientSearchViewModel.selectedToDate != null ? "${DateUtils .convertStringToDateFormat( - selectedToDate.toString(), + widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -167,16 +169,16 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (selectedFromDate == null || - selectedToDate == null) { + if (widget.patientSearchViewModel.selectedFromDate == null || + widget.patientSearchViewModel.selectedToDate == null) { Helpers.showErrorToast( "Please Select All The date Fields "); } else { String dateTo = DateUtils.convertDateToFormat( - selectedToDate, + widget.patientSearchViewModel.selectedToDate, 'yyyy-MM-dd'); String dateFrom = DateUtils.convertDateToFormat( - selectedFromDate, + widget.patientSearchViewModel.selectedFromDate, 'yyyy-MM-dd'); PatientSearchRequestModel currentModel = PatientSearchRequestModel(); @@ -211,8 +213,8 @@ class _FilterDatePageState extends State { {bool isFromDate = true, DateTime firstDate, lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate - ? this.selectedFromDate ?? firstDate - : this.selectedToDate ?? lastDate; + ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate + : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, @@ -223,11 +225,11 @@ class _FilterDatePageState extends State { if (picked != null) { if (isFromDate) { setState(() { - this.selectedFromDate = picked; + this.widget.patientSearchViewModel.selectedFromDate = picked; }); } else { setState(() { - this.selectedToDate = picked; + this.widget.patientSearchViewModel.selectedToDate = picked; }); } } From f4020af4f82d62b3c4ed1b1975375cc1902de92c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:32:15 +0300 Subject: [PATCH 17/21] date fix --- lib/screens/patients/out_patient/filter_date_page.dart | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 541a70eb..e95cb425 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -259,14 +259,8 @@ class _FilterDatePageState extends State { getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime( - DateTime - .now() - .year +20, DateTime - .now() - .month, (DateTime - .now() - .day - 1)); + return DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day-1); } else { return DateTime( DateTime From 01bd55366a489eae25d2d03eded616e15f855482 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:44:28 +0300 Subject: [PATCH 18/21] date difference --- .../out_patient/filter_date_page.dart | 54 ++++++++++++------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index e95cb425..f4577008 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -169,31 +169,45 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == null || - widget.patientSearchViewModel.selectedToDate == null) { + if (widget.patientSearchViewModel.selectedFromDate == + null || + widget.patientSearchViewModel.selectedToDate == + null) { Helpers.showErrorToast( "Please Select All The date Fields "); } else { - String dateTo = DateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, - 'yyyy-MM-dd'); - String dateFrom = DateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, - 'yyyy-MM-dd'); + Duration difference = widget + .patientSearchViewModel.selectedToDate + .difference( + widget.patientSearchViewModel.selectedFromDate); + if (difference.inDays > 30) { + Helpers.showErrorToast( + "The difference between from date and end date must be less"); + } else { + String dateTo = DateUtils.convertDateToFormat( + widget.patientSearchViewModel.selectedToDate, + 'yyyy-MM-dd'); + String dateFrom = DateUtils.convertDateToFormat( + widget.patientSearchViewModel.selectedFromDate, + 'yyyy-MM-dd'); - PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.to = dateTo; - currentModel.from= dateFrom; - GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel.getOutPatient( - currentModel, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - if(widget.patientSearchViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientSearchViewModel.error); - }else { - Navigator.of(context).pop(); - } + PatientSearchRequestModel currentModel = + PatientSearchRequestModel(); + currentModel.to = dateTo; + currentModel.from = dateFrom; + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientSearchViewModel + .getOutPatient(currentModel, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + if (widget.patientSearchViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientSearchViewModel.error); + } else { + Navigator.of(context).pop(); + } + } } }, ), From eebaf01570765b52602a00673743f51f4f7a437a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 29 Apr 2021 17:54:09 +0300 Subject: [PATCH 19/21] fix diff msg --- lib/screens/patients/out_patient/filter_date_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index f4577008..193c1ec2 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -180,9 +180,9 @@ class _FilterDatePageState extends State { .patientSearchViewModel.selectedToDate .difference( widget.patientSearchViewModel.selectedFromDate); - if (difference.inDays > 30) { + if (difference.inDays > 90) { Helpers.showErrorToast( - "The difference between from date and end date must be less"); + "The difference between from date and end date must be less than 3 months"); } else { String dateTo = DateUtils.convertDateToFormat( widget.patientSearchViewModel.selectedToDate, From 27a3dd1eb485701a3e4823ce5bdd2dad4ac34ac2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Fri, 30 Apr 2021 13:23:59 +0300 Subject: [PATCH 20/21] fix the filter page --- lib/client/base_app_client.dart | 2 +- .../viewModel/PatientSearchViewModel.dart | 3 +- lib/core/viewModel/base_view_model.dart | 14 +- .../out_patient/filter_date_page.dart | 5 + .../out_patient/out_patient_screen.dart | 10 +- .../patient_profile_screen.dart | 2 + ...ent-profile-header-new-design-app-bar.dart | 13 +- ..._key_checkbox_search_allergies_widget.dart | 597 +++++++++--------- 8 files changed, 338 insertions(+), 308 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 177b95ee..83dfad00 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -71,7 +71,7 @@ class BaseAppClient { (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { body['PatientOutSA'] = true; } - + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 7fbd7d1f..8192b1a8 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -49,7 +49,8 @@ class PatientSearchViewModel extends BaseViewModel{ } else { setState(ViewState.Busy); } - + await getDoctorProfile(isGetProfile: true); + patientSearchRequestModel.doctorID = doctorProfile.doctorID; await _outPatientService.getOutPatient( patientSearchRequestModel); if (_outPatientService.hasError) { diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index d8591660..43e83c9b 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -22,7 +22,17 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future getDoctorProfile() async { + Future getDoctorProfile({bool isGetProfile = false}) async { + if(isGetProfile) + { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + } if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { @@ -35,5 +45,5 @@ class BaseViewModel extends ChangeNotifier { } else { return doctorProfile; } - } +} } diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 193c1ec2..e4f28ac7 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -240,6 +240,11 @@ class _FilterDatePageState extends State { if (isFromDate) { setState(() { this.widget.patientSearchViewModel.selectedFromDate = picked; + var date = picked.add(Duration(days: 30)); + if(date.isBefore(lastDate)){ + this.widget.patientSearchViewModel.selectedToDate = date; + }else + this.widget.patientSearchViewModel.selectedToDate = lastDate; }); } else { setState(() { diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 953e7722..4d0ce94a 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -132,7 +132,10 @@ class _OutPatientsScreenState extends State { setState(() { _activeLocation = _times.indexOf(item); outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; + _controller.text=""; }); + model.searchData(""); + FocusScope.of(context).requestFocus(new FocusNode()); GifLoaderDialogUtils.showMyDialog(context); await model.getPatientBasedOnDate(item: item, selectedPatientType: widget.selectedPatientType, @@ -222,6 +225,7 @@ class _OutPatientsScreenState extends State { SizedBox( height: 10.0, ), + Expanded( child: Container( child: model.filterData.isEmpty @@ -236,7 +240,9 @@ class _OutPatientsScreenState extends State { shrinkWrap: true, itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { - return Padding( + if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43)) + return + Padding( padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], @@ -264,6 +270,8 @@ class _OutPatientsScreenState extends State { // isFromSearch: widget.isSearch, ), ); + else + return SizedBox(); })), ), ], diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 44641b4b..aa2b5276 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -94,6 +94,7 @@ class _PatientProfileScreenState extends State Column( children: [ PatientProfileHeaderNewDesignAppBar( + patient, arrivalType ?? '0', patientType, @@ -104,6 +105,7 @@ class _PatientProfileScreenState extends State : isDischargedPatient ? 240 : 0, + isDischargedPatient:isDischargedPatient ), Container( height: !isSearchAndOut 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 0ba5c8f2..3d7638c2 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 @@ -18,9 +18,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final String arrivalType; final double height; final bool isInpatient; + final bool isDischargedPatient; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false}); @override Widget build(BuildContext context) { @@ -302,10 +303,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, ), + if(isDischargedPatient) AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, - fontWeight: FontWeight.w700), + fontWeight: FontWeight.w700) + else + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), ], ), ], diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index e91236e8..7a1fc3f5 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -62,119 +62,91 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - child: Expanded( - child: Column( - children: [ - Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 0.70, - child: Center( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - children: [ - AppTextFieldCustom( - // height: - // MediaQuery.of(context).size.height * 0.070, - hintText: - TranslationBase.of(context).selectAllergy, - isTextFieldHasSuffix: true, - hasBorder: false, - // controller: filteredSearchController, - onChanged: (value) { - filterSearchResults(value); - }, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - )), - ), - DividerWithSpacesAround(), - 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.removeAllergy( - items[index]); - } else { - MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[ - index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: - true, - isExpanded: - true); - widget.addAllergy( - mySelectedAllergy); - } - }); - }), - InkWell( - onTap: () { + child: Column( + children: [ + Expanded( + child: Container( + height: MediaQuery.of(context).size.height * 0.70, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + AppTextFieldCustom( + // height: + // MediaQuery.of(context).size.height * 0.070, + hintText: + TranslationBase.of(context).selectAllergy, + isTextFieldHasSuffix: true, + hasBorder: false, + // controller: filteredSearchController, + onChanged: (value) { + filterSearchResults(value); + }, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + )), + ), + DividerWithSpacesAround(), + 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( @@ -182,9 +154,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState widget.removeAllergy( items[index]); } else { - // TODO add Allergy - - MySelectedAllergy mySelectedAllergy = + MySelectedAllergy + mySelectedAllergy = new MySelectedAllergy( selectedAllergy: items[ @@ -192,208 +163,234 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState selectedAllergySeverity: _selectedAllergySeverity, remark: null, - isChecked: true, + isChecked: + true, isExpanded: true); widget.addAllergy( mySelectedAllergy); } }); - }, - 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( + }), + InkWell( onTap: () { - if (mySelectedAllergy != - null) { - setState(() { - mySelectedAllergy - .isExpanded = - mySelectedAllergy - .isExpanded - ? false - : true; - }); - } + setState(() { + if (widget + .isServiceSelected( + items[index])) { + widget.removeAllergy( + items[index]); + } else { + + MySelectedAllergy mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[ + index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: + true); + widget.addAllergy( + mySelectedAllergy); + } + }); }, - child: Icon((mySelectedAllergy != - null - ? mySelectedAllergy - .isExpanded - : false) - ? EvaIcons - .arrowIosUpwardOutline - : EvaIcons - .arrowIosDownwardOutline)) - ], - ), - bodyWidget: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: Column( - children: [ - AppTextFieldCustom( - onClick: 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, - isTextFieldHasSuffix: true, - hintText: - TranslationBase.of( - context) - .selectSeverity, - enabled: false, - maxLines: 2, - minLines: 2, - controller: - severityController, - ), - SizedBox( - height: 5, - ), - if (isSubmitted && - mySelectedAllergy != - null && - mySelectedAllergy - .selectedAllergySeverity == - null) - Row( - children: [ - CustomValidationError(), - ], - mainAxisAlignment: - MainAxisAlignment - .start, + 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, ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, - right: 0, - top: 15), - child: NewTextFields( - hintText: - TranslationBase.of( - context) - .remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: - FontWeight.w600, - maxLines: 25, - minLines: 3, - 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, + 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: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: Column( + children: [ + AppTextFieldCustom( + onClick: 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, + isTextFieldHasSuffix: true, + hintText: + TranslationBase.of( + context) + .selectSeverity, + enabled: false, + maxLines: 2, + minLines: 2, + controller: + severityController, + ), + SizedBox( + height: 5, + ), + if (isSubmitted && + mySelectedAllergy != + null && + mySelectedAllergy + .selectedAllergySeverity == + null) + Row( + children: [ + CustomValidationError(), + ], + mainAxisAlignment: + MainAxisAlignment + .start, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, + right: 0, + top: 15), + child: NewTextFields( + hintText: + TranslationBase.of( + context) + .remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: + FontWeight.w600, + maxLines: 25, + minLines: 3, + 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, - ); - }, - ), + ), + isExpand: mySelectedAllergy != null + ? mySelectedAllergy.isExpanded + : false, + ); + }, ), ), ), - ], - ))), - ), - ), - SizedBox( - height: 10, + ), + ], + ))), ), - ], - ), + ), + SizedBox( + height: 10, + ), + ], ), ); } From 2978aeecb24b8f9085a399f4618aedefe1a1a05b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Fri, 30 Apr 2021 13:44:27 +0300 Subject: [PATCH 21/21] fix the tab bar --- .../referral/patient_referral_screen.dart | 88 +++++++++++++++---- 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 1206c9c3..6b7f448b 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,9 +1,11 @@ import 'dart:ui'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -14,13 +16,22 @@ class PatientReferralScreen extends StatefulWidget { _PatientReferralScreen createState() => _PatientReferralScreen(); } -class _PatientReferralScreen extends State - with SingleTickerProviderStateMixin { +class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { + TabController _tabController; + int index=0; + @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + _handleTabSelection() { + setState(() { + index = _tabController.index; + }); } @override @@ -29,7 +40,7 @@ class _PatientReferralScreen extends State _tabController.dispose(); } - @override + @override Widget build(BuildContext context) { return AppScaffold( @@ -39,12 +50,10 @@ class _PatientReferralScreen extends State extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( - preferredSize: Size.fromHeight(60.0), + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( - height: 60.0, - // margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 1, // 0.92, + height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -54,30 +63,71 @@ class _PatientReferralScreen extends State color: Colors.white), child: Center( child: TabBar( - isScrollable: true, + isScrollable: false, controller: _tabController, - indicatorColor: Colors.red[800], - indicatorWeight: 5.0, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.50, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( - child: - AppText(TranslationBase.of(context).referral), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 0 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), + index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).myReferredPatient, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 0 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), ), ), Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.50, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( - child: AppText( - TranslationBase.of(context).myReferredPatient), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 1 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), + index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).referral, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 1 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), ), ), + ], ), ), @@ -91,8 +141,8 @@ class _PatientReferralScreen extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - MyReferralInPatientScreen(), ReferredPatientScreen(), + MyReferralInPatientScreen(), // MyReferredPatient(), ], ),