diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 51b33a46..fdd8f424 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -14,7 +14,8 @@ + android:roundIcon="@mipmap/ic_launcher_round" + android:label="Doctors app"> + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..036d09bc --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4b..11e35ed2 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..a032e3d4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..4d0b9bac Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-ldpi/ic_launcher.png b/android/app/src/main/res/mipmap-ldpi/ic_launcher.png new file mode 100644 index 00000000..675dfb3a Binary files /dev/null and b/android/app/src/main/res/mipmap-ldpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b79..13a8a4aa 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..12301f4a Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..bf0d6d1d Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d43914..caf1fc21 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..d3ae924e Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..e7d996be Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d3..f0ba70b5 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..9133b963 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..9605dda8 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372ee..0fce1189 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..67f0120e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..de8b067e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 00000000..ab983282 --- /dev/null +++ b/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #ffffff + \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fab..e83c3bf5 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1,128 @@ { - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" + "images":[ + { + "idiom":"iphone", + "size":"20x20", + "scale":"2x", + "filename":"Icon-App-20x20@2x.png" + }, + { + "idiom":"iphone", + "size":"20x20", + "scale":"3x", + "filename":"Icon-App-20x20@3x.png" + }, + { + "idiom":"iphone", + "size":"29x29", + "scale":"1x", + "filename":"Icon-App-29x29@1x.png" + }, + { + "idiom":"iphone", + "size":"29x29", + "scale":"2x", + "filename":"Icon-App-29x29@2x.png" + }, + { + "idiom":"iphone", + "size":"29x29", + "scale":"3x", + "filename":"Icon-App-29x29@3x.png" + }, + { + "idiom":"iphone", + "size":"40x40", + "scale":"2x", + "filename":"Icon-App-40x40@2x.png" + }, + { + "idiom":"iphone", + "size":"40x40", + "scale":"3x", + "filename":"Icon-App-40x40@3x.png" + }, + { + "idiom":"iphone", + "size":"60x60", + "scale":"2x", + "filename":"Icon-App-60x60@2x.png" + }, + { + "idiom":"iphone", + "size":"60x60", + "scale":"3x", + "filename":"Icon-App-60x60@3x.png" + }, + { + "idiom":"iphone", + "size":"76x76", + "scale":"2x", + "filename":"Icon-App-76x76@2x.png" + }, + { + "idiom":"ipad", + "size":"20x20", + "scale":"1x", + "filename":"Icon-App-20x20@1x.png" + }, + { + "idiom":"ipad", + "size":"20x20", + "scale":"2x", + "filename":"Icon-App-20x20@2x.png" + }, + { + "idiom":"ipad", + "size":"29x29", + "scale":"1x", + "filename":"Icon-App-29x29@1x.png" + }, + { + "idiom":"ipad", + "size":"29x29", + "scale":"2x", + "filename":"Icon-App-29x29@2x.png" + }, + { + "idiom":"ipad", + "size":"40x40", + "scale":"1x", + "filename":"Icon-App-40x40@1x.png" + }, + { + "idiom":"ipad", + "size":"40x40", + "scale":"2x", + "filename":"Icon-App-40x40@2x.png" + }, + { + "idiom":"ipad", + "size":"76x76", + "scale":"1x", + "filename":"Icon-App-76x76@1x.png" + }, + { + "idiom":"ipad", + "size":"76x76", + "scale":"2x", + "filename":"Icon-App-76x76@2x.png" + }, + { + "idiom":"ipad", + "size":"83.5x83.5", + "scale":"2x", + "filename":"Icon-App-83.5x83.5@2x.png" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "scale" : "1x", + "filename" : "ItunesArtwork@2x.png" + } + ], + "info":{ + "version":1, + "author":"easyappicon" } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } } diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada47..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03..a506606c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd96..002322b4 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0..c4197e69 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde1211..61d2e737 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7..3c9f4819 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306..5b6d4029 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd96..002322b4 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f..049de742 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b860..f47f5fa2 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b860..f47f5fa2 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164..1f53454b 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d3..9a3d0236 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e..cbec330f 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585..832249a6 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png new file mode 100644 index 00000000..b51b90aa Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index b7624453..538aed37 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -121,7 +121,7 @@ const GET_DASHBOARD = const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; + 'Services/DoctorApplication.svc/REST/PatientArrivalList​'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; @@ -143,6 +143,9 @@ const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; +const GET_PATIENT_ARRIVAL_LIST = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; + ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = @@ -244,6 +247,7 @@ const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 240f235f..980a2e9b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -824,5 +824,8 @@ const Map> localizedValues = { "accepted": {"en": "Accepted", "ar": "وافقت"}, "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, - "replied": {"en": "Replied", "ar": " تم الرد"}, + "replied": {"en": "Replied", "ar": " تم الرد"},"typeHereToReply": { + "en": "Type here to reply", + "ar": "اكتب هنا للرد" + }, }; diff --git a/lib/core/service/doctor_reply_service.dart b/lib/core/service/doctor_reply_service.dart index 5025037d..44fb2287 100644 --- a/lib/core/service/doctor_reply_service.dart +++ b/lib/core/service/doctor_reply_service.dart @@ -2,7 +2,10 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/hospitals_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/doctor/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; class DoctorReplyService extends BaseService { @@ -11,7 +14,11 @@ class DoctorReplyService extends BaseService { RequestDoctorReply _requestDoctorReply = RequestDoctorReply(); + List _listMyReferralPatientModel = []; + List get listMyReferralPatientModel => _listMyReferralPatientModel; + Future getDoctorReply() async { + hasError = false; await baseAppClient.post(GT_MY_PATIENT_QUESTION, onSuccess: (dynamic response, int statusCode) { _listDoctorWorkingHoursTable.clear(); @@ -24,4 +31,32 @@ class DoctorReplyService extends BaseService { super.error = error; }, body: _requestDoctorReply.toJson(),); } + + Future replay( + String referredDoctorRemarks, MyReferralPatientModel model) async { + RequestMyReferralPatientModel _requestMyReferralPatient = + RequestMyReferralPatientModel(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = + RequestAddReferredDoctorRemarks(); + + _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo; + _requestAddReferredDoctorRemarks.patientID = model.patientID; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = + referredDoctorRemarks; + _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; + _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; + await baseAppClient.post( + ADD_REFERRED_DOCTOR_REMARKS, + body: _requestAddReferredDoctorRemarks.toJson(), + onSuccess: (dynamic body, int statusCode) { + model.referredDoctorRemarks = referredDoctorRemarks; + listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] = + model; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } } diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 3136b549..787aecae 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -156,7 +156,7 @@ class PatientReferralService extends LookupService { hasError = false; DoctorProfileModel doctorProfile = await getDoctorProfile(); Map body = Map(); - body['ClinicID'] = 0; + // body['ClinicID'] = 0; body['DoctorID'] = doctorProfile.doctorID; await baseAppClient.post( diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart index 9c1f5a60..9d60c4ac 100644 --- a/lib/core/service/radiology_service.dart +++ b/lib/core/service/radiology_service.dart @@ -14,7 +14,7 @@ class RadiologyService extends BaseService { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; - body['LineIt emNo'] = lineItem; + body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; await baseAppClient.postPatient(GET_RAD_IMAGE_URL, diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 29d3b125..f010bf60 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -19,4 +20,14 @@ class DoctorReplayViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { + setState(ViewState.BusyLocal); + await _doctorReplyService.replay(referredDoctorRemarks, model); + if (_doctorReplyService.hasError) { + error = _doctorReplyService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 9e8aa8ab..8714aaf8 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -196,14 +196,14 @@ class _DashboardScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors.black, - fontWeight: FontWeight.bold, - ), + AppText(item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 1.6, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: + TextAlign.center), ], ); }).toList(); @@ -1004,7 +1004,7 @@ class _DashboardScreenState extends State { top: 10, left: 10, right: 0), child: Icon( DoctorApp.search, - size: 35, + size: 32, color: Colors.white, )), Container( @@ -1014,6 +1014,7 @@ class _DashboardScreenState extends State { .searchmedicinepatient, color: Colors.white, textAlign: TextAlign.start, + fontSize: 14, )) ], ), @@ -1385,7 +1386,7 @@ class DashboardItem extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.16 + ? MediaQuery.of(context).size.height * 0.18 : MediaQuery.of(context).size.height * 0.36, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart new file mode 100644 index 00000000..35718793 --- /dev/null +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -0,0 +1,330 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class DoctorReplayChat extends StatelessWidget { + + final ListGtMyPatientsQuestions reply; + TextEditingController msgController = TextEditingController(); + + DoctorReplayChat( + {Key key, this.reply, + }); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + color: Color(0XFFF2F2F2), + child: Stack( + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 150, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: reply.patientName + .toString(), + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(FontAwesomeIcons.times, + size: 30, + color: Color(0xFF2B353E))) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () { + // TODO: move to doctor profile + }, + child: RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + 'Tap here to view patient profile' + .toString(), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 12)), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox(height: 30,), + Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Color(0xFF2B353E), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + 1 == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + Column( + children: [ + AppText( + "07 Jan 2021", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + AppText( + "07:00 PM", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + "This procedure should be taken only when the patient is below 99o", + fontSize: 15, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + SizedBox(height: 30,), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white,// Color(0xFF2B353E), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + 1 == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + Column( + children: [ + AppText( + "07 Jan 2021", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + AppText( + "07:00 PM", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + "This procedure should be taken only when the patient is below 99o", + fontSize: 15, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ) + ], + ), + ), + ], + ), + ), + bottomSheet: Container( + child:TextFields( + hasLabelText: msgController.text != '' + ? true + : false, + showLabelText: false, + hintText: TranslationBase + .of(context) + .typeHereToReply, + fontSize: 13.5, + suffixIcon: FontAwesomeIcons.arrowRight, + suffixIconColor: Colors.green, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 50, + minLines: 3, + controller: msgController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + height: MediaQuery.of(context).size.height * 0.1, + ), + )); + } +} diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index b57bd1a2..62d46d5e 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -18,7 +19,9 @@ class DoctorReplyScreen extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDoctorReply(), + onModelReady: (model) { + model.getDoctorReply(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).replay2, @@ -35,7 +38,15 @@ class DoctorReplyScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: model.listDoctorWorkingHoursTable.map((reply) { - return DoctorReplyWidget(reply: reply); + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat(reply: reply))); + }, + child: DoctorReplyWidget(reply: reply)); }).toList(), ) ], diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 72d75f89..6b54dec7 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -48,7 +48,7 @@ class RadiologyDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - + margin: EdgeInsets.all(8), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), @@ -62,17 +62,19 @@ class RadiologyDetailsPage extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: Texts( - '${finalRadiology.reportData}', + '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, fontSize: 17, color: Colors.grey, ), ), SizedBox(height: 25,), + if(model.radImageURL.isNotEmpty) Center( child: Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( + color: Colors.red, onTap: () { launch(model.radImageURL); diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 3c2197f3..a4510907 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -73,7 +73,7 @@ class MyReferralDetailScreen extends StatelessWidget { Expanded( child: AppText( (Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, fontFamily: 'Poppins', @@ -139,12 +139,15 @@ class MyReferralDetailScreen extends StatelessWidget { referredOn: pendingReferral.referredOn, patientInfo: pendingReferral, ), - SizedBox( - child: ProfileMedicalInfoWidgetSearch( - patient: model.patientArrivalList[0], - patientType: "7", - from: null, - to: null, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SizedBox( + child: ProfileMedicalInfoWidgetSearch( + patient: model.patientArrivalList[0], + patientType: "7", + from: null, + to: null, + ), ), ), ], @@ -206,16 +209,38 @@ class MyReferralDetailScreen extends StatelessWidget { ), ], ) - : Container( - child: Center( - child: AppText( - TranslationBase.of(context).patientNoDetailErrMsg, - color: HexColor("#B8382B"), - fontWeight: FontWeight.bold, - fontSize: 16, - ), + : Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText("" , + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + ), + ]), ), - ), + Container( + child: Center( + child: AppText( + TranslationBase.of(context).patientNoDetailErrMsg, + color: HexColor("#B8382B"), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index adea0247..16084342 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -39,11 +39,11 @@ class _PatientReferralScreen extends State extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), + preferredSize: Size.fromHeight(60.0), child: Center( child: Container( height: 60.0, - margin: EdgeInsets.only(top: 10.0), + // margin: EdgeInsets.only(top: 10.0), width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 2f0eafcb..e87a7a39 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,4 +1,7 @@ +import 'package:date_time_picker/date_time_picker.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; @@ -12,6 +15,11 @@ class LineChartCurved extends StatelessWidget { List xAxixs = List(); List yAxixs = List(); + // DateFormat format = DateFormat("yyyy-MM-dd"); + DateFormat yearFormat = DateFormat("yyyy/MMM"); + DateFormat monthFormat = DateFormat("MMM"); + bool isDatesSameYear = true; + @override Widget build(BuildContext context) { getXaxix(); @@ -23,36 +31,42 @@ class LineChartCurved extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(18)), // color: Colors.white, ), - child: Stack( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox( - height: 4, - ), - Text( - title, - style: TextStyle( - color: Colors.black, - fontSize: 15, - letterSpacing: 2), - textAlign: TextAlign.center, - ), - SizedBox(height: 10,), - Expanded( - child: Padding( - padding: const EdgeInsets.only(right: 18.0, left: 16.0), - child: LineChart( - sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), - ), + const SizedBox( + height: 4, + ), + Container( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + textAlign: TextAlign.center, ), + ], + ), + ), + SizedBox( + height: 16, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), ), - const SizedBox( - height: 10, - ), - ], + ), + ), + const SizedBox( + height: 10, ), ], ), @@ -68,8 +82,9 @@ class LineChartCurved extends StatelessWidget { } } } + getYaxix() { - int indexess= (timeSeries.length*0.30).toInt(); + int indexess = (timeSeries.length * 0.30).toInt(); for (int index = 0; index < timeSeries.length; index++) { int mIndex = indexess * index; if (mIndex < timeSeries.length) { @@ -83,7 +98,6 @@ class LineChartCurved extends StatelessWidget { lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, - ), touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, @@ -97,12 +111,23 @@ class LineChartCurved extends StatelessWidget { color: Colors.black, fontSize: 10, ), - rotateAngle:-65, + rotateAngle: -65, //rotateAngle:-65, margin: 22, getTitles: (value) { - if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + DateTime dateTime = timeSeries[value.toInt()].time; + if (isDatesSameYear) { + return monthFormat.format(dateTime); + } else { + return yearFormat.format(dateTime); + } + } else { + return ''; + } + /*if (timeSeries.length < 15) { if (timeSeries.length > value.toInt()) { + DateTime dateTime = timeSeries[value.toInt()].time; return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; } else return ''; @@ -114,7 +139,7 @@ class LineChartCurved extends StatelessWidget { if (xAxixs.contains(value.toInt())) { return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; } - } + }*/ return ''; }, ), @@ -163,7 +188,7 @@ class LineChartCurved extends StatelessWidget { ), minX: 0, maxX: (timeSeries.length - 1).toDouble(), - maxY: getMaxY()+0.3, + maxY: getMaxY() + 0.3, minY: getMinY(), lineBarsData: getData(context), ); @@ -176,7 +201,7 @@ class LineChartCurved extends StatelessWidget { if (resultValueDouble > max) max = resultValueDouble; }); - return max.roundToDouble() ; + return max.roundToDouble(); } double getMinY() { @@ -192,14 +217,22 @@ class LineChartCurved extends StatelessWidget { List getData(context) { List spots = List(); + isDatesSameYear = true; + int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + if (isDatesSameYear == false || + (previousDateYear != 0 && + previousDateYear != timeSeries[index].time.year)) { + isDatesSameYear = false; + } + previousDateYear = timeSeries[index].time.year; } final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Theme.of(context).primaryColor], + colors: [Colors.red]/*[Theme.of(context).primaryColor]*/, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index e816c145..5eea8f3d 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -26,71 +27,77 @@ class LineChartCurvedBloodPressure extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(18)), // color: Colors.white, ), - child: Stack( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox( - height: 15, - ), - Text( - title, - style: TextStyle( - color: Colors.black, fontSize: 15, letterSpacing: 2), - textAlign: TextAlign.center, - ), - SizedBox( - height: 10, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), - child: LineChart( - sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), - ), + const SizedBox( + height: 4, + ), + Container( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + textAlign: TextAlign.center, ), + ], + ), + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), ), - SizedBox( - height: 10, - ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, children: [ - Row( - children: [ - Container( - width: 20, - height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Theme.of(context).primaryColor), - ), - SizedBox(width: 5,), - AppText(TranslationBase.of(context).systolicLng) - ], + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), ), - SizedBox(width: 15,), - Row( - children: [ - Container( - width: 20, - height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.grey), - ), - SizedBox(width: 5,), - AppText(TranslationBase.of(context).diastolicLng) - ], + SizedBox(width: 5,), + AppText(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox(width: 15,), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.grey), ), + SizedBox(width: 5,), + AppText(TranslationBase.of(context).diastolicLng) ], - ) + ), ], - ), + ) ], ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 693507bb..98238c58 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -1,3 +1,4 @@ +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/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; @@ -17,7 +18,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget { final String viewKey2; VitalSignBloodPressureWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2}); + {Key key, + this.vitalList, + this.title1, + this.title2, + this.viewKey1, + this.title3, + this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -28,21 +35,96 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - decoration: BoxDecoration( + /*decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), - ), - margin: EdgeInsets.all(20), + ),*/ + margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60, + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + widget.title2, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + widget.title3, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ), + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), + border: TableBorder( + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -54,36 +136,7 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; - tableRow.add(TableRow(children: [ - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ), - child: Center( - child: AppText( - TranslationBase.of(context).date, - color: Colors.white, - ), - ), - height: 60, - ), - ), - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - - ), - child: Center( - child: AppText(widget.title2, color: Colors.white), - ), - height: 60), - ), + /* tableRow.add(TableRow(children: [ Container( child: Container( decoration: BoxDecoration( @@ -98,22 +151,24 @@ class _VitalSignDetailsWidgetState extends State { ), height: 60), ), - ])); + ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(10), color: Colors.white, - child: Center( - child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', - textAlign: TextAlign.center, - ), + child: AppText( + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), @@ -121,11 +176,13 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(10), color: Colors.white, - child: Center( - child: AppText( - '${vital.toJson()[widget.viewKey1]}', - textAlign: TextAlign.center, - ), + child: AppText( + '${vital.toJson()[widget.viewKey1]}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), @@ -133,11 +190,13 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(10), color: Colors.white, - child: Center( - child: AppText( - '${vital.toJson()[widget.viewKey2]}', - textAlign: TextAlign.center, - ), + child: AppText( + '${vital.toJson()[widget.viewKey2]}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), 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 51ad3829..23eff3a9 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 @@ -39,7 +39,7 @@ class VitalSignDetailsScreen extends StatelessWidget { builder: (_, mode, widget) => AppScaffold( isShowAppBar: false, baseViewModel: mode, - /* appBar: PatientProfileHeaderWhitAppointmentAppBar( + /* appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -72,7 +72,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), Container( - height: MediaQuery.of(context).size.height * 0.21, + height: MediaQuery.of(context).size.height * 0.23, width: double.infinity, padding: EdgeInsets.all(12.0), margin: EdgeInsets.symmetric(horizontal: 16.0), @@ -140,7 +140,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', height: - MediaQuery.of(context).size.height * 0.10, + MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -176,7 +176,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', height: - MediaQuery.of(context).size.height * 0.10, + MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -203,72 +203,75 @@ class VitalSignDetailsScreen extends StatelessWidget { )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 4 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 4 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - AppText( - "${TranslationBase.of(context).bmiObese}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - AppText( - "(30-34.9)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - ], - )), + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiObese}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(30-34.9)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + ], + )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 5 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 5 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - AppText( - "${TranslationBase.of(context).bmiObeseExtreme}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - AppText( - "(35<)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - ], - )), + ), + const SizedBox( + height: 4, + ), + FittedBox( + fit: BoxFit.fitWidth, + child: AppText( + "${TranslationBase.of(context).bmiObeseExtreme}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ), + AppText( + "(35<)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ], + )), ], ) ], @@ -277,7 +280,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 8.0), - child : GridView.count( + child: GridView.count( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 4, @@ -288,24 +291,25 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context) - .height, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context).height, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).height, - imagePath: - "${assetBasePath}height.png", + imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, unit: TranslationBase.of(context).cm, ), @@ -314,18 +318,20 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context) - .weight, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context).weight, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( des: TranslationBase.of(context).weight, @@ -337,26 +343,25 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.Temperature, - pageTitle: - TranslationBase.of(context) - .temperature, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context) + .temperature, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: Container( child: VitalSignItem( - des: - TranslationBase.of(context).temperature, - imagePath: - "${assetBasePath}temperature.png", + des: TranslationBase.of(context).temperature, + imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, unit: TranslationBase.of(context).tempC, ), @@ -365,23 +370,24 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context) - .heart, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context).heart, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( des: TranslationBase.of(context).heart, - imagePath: - "${assetBasePath}heart_rate.png", + imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, unit: TranslationBase.of(context).bpm, ), @@ -389,52 +395,50 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.Respiration, - pageTitle: - TranslationBase.of(context) - .respirationRate, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context) + .respirationRate, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .respirationRate, - imagePath: - "${assetBasePath}respiration_rate.png", + des: TranslationBase.of(context).respirationRate, + imagePath: "${assetBasePath}respiration_rate.png", lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context) - .respirationSigns, + unit: + TranslationBase.of(context).respirationSigns, ), ), InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.BloodPressure, - pageTitle: - TranslationBase.of(context) - .bloodPressure, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context) + .bloodPressure, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( - des: - TranslationBase.of(context).bloodPressure, - imagePath: - "${assetBasePath}blood_pressure.png", + des: TranslationBase.of(context).bloodPressure, + imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, unit: TranslationBase.of(context).sysDias, ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index 11a24e42..4941ed87 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -1,3 +1,4 @@ +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/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; @@ -27,21 +28,74 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - decoration: BoxDecoration( + /*decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), - ), - margin: EdgeInsets.all(20), + ),*/ + margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60, + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + widget.title2, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ) + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), + border: TableBorder( + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -53,67 +107,40 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; - tableRow.add(TableRow(children: [ - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ), - child: Center( - child: AppText( - TranslationBase.of(context).date, - color: Colors.white, - ), - ), - height: 60, - ), - ), - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ), - child: Center( - child: AppText(widget.title2, color: Colors.white), - ), - height: 60), - ) - ])); + /* tableRow.add(TableRow(children: [ + + ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( child: Container( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(8), color: Colors.white, - child: Center( - child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', - textAlign: TextAlign.center, - ), + child: AppText( + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), Container( child: Container( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(8), color: Colors.white, - child: Center( - child: AppText( - '${vital.toJson()[widget.viewKey]}', - textAlign: TextAlign.center, - ), + child: AppText( + '${vital.toJson()[widget.viewKey]}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index bd828138..349120f4 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,10 +1,15 @@ +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/lookups/patient_lookup.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.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 'package:provider/provider.dart'; @@ -12,8 +17,17 @@ class VitalSignItemDetailsScreen extends StatelessWidget { final vitalSignDetails pageKey; final String pageTitle; List VSchart; - - VitalSignItemDetailsScreen({this.vitalList, this.pageKey, this.pageTitle}); + PatiantInformtion patient; + String patientType; + String arrivalType; + + VitalSignItemDetailsScreen( + {this.vitalList, + this.pageKey, + this.pageTitle, + this.patient, + this.patientType, + this.arrivalType}); final List vitalList; @@ -31,7 +45,6 @@ class VitalSignItemDetailsScreen extends StatelessWidget { 'title2Ar': 'الكتلة', 'viewKey': 'BodyMassIndex', }, - ]; break; @@ -87,7 +100,6 @@ class VitalSignItemDetailsScreen extends StatelessWidget { 'title3Ar': 'الإنبساط', 'viewKey': 'BloodPressure', }, - ]; break; @@ -161,35 +173,79 @@ class VitalSignItemDetailsScreen extends StatelessWidget { } return AppScaffold( appBarTitle: pageTitle, + backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - body: ListView( - children: VSchart.map((chartInfo) { - var vitalListTemp = vitalList.where( - (element) => element.toJson()[chartInfo['viewKey']] != null, - ); - - if(vitalListTemp.length != 0 && chartInfo['viewKey']=='BloodPressure'){ - return VitalSingChartBloodPressure( - vitalList: vitalList, - name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], - title1: chartInfo['title1'], - title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], - title3:projectViewModel.isArabic?chartInfo['title3Ar']: chartInfo['title3'], - viewKey1: 'BloodPressureHigher', - viewKey2: 'BloodPressureLower', - - ); - } - - return vitalListTemp.length != 0 - ? VitalSingChartAndDetials( - vitalList: vitalList, - name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], - title1: chartInfo['title1'], - title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], - viewKey: chartInfo['viewKey']) - : Container(); - }).toList(), + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${patient.firstName ?? patient.patientDetails.firstName}'s", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + TranslationBase.of(context).vitalSign, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + child: ListView( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + children: VSchart.map((chartInfo) { + var vitalListTemp = vitalList.where( + (element) => element.toJson()[chartInfo['viewKey']] != null, + ); + + if (vitalListTemp.length != 0 && + chartInfo['viewKey'] == 'BloodPressure') { + return VitalSingChartBloodPressure( + vitalList: vitalList, + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], + title1: chartInfo['title1'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], + title3: projectViewModel.isArabic + ? chartInfo['title3Ar'] + : chartInfo['title3'], + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', + ); + } + + return vitalListTemp.length != 0 + ? VitalSingChartAndDetials( + vitalList: vitalList, + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], + title1: chartInfo['title1'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], + viewKey: chartInfo['viewKey']) + : Container(); + }).toList(), + ), + ), + ], + ), ), ); } 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 fbc0f3e1..a48afcf3 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 @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart'; @@ -32,9 +33,52 @@ class VitalSingChartAndDetials extends StatelessWidget { @override Widget build(BuildContext context) { generateData(); - return timeSeriesData.length != 0 ? Column( - children: [ - AppExpandableNotifier( + return timeSeriesData.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Graph Details", + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + SizedBox(height: 8,), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), + ), + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -43,26 +87,31 @@ class VitalSingChartAndDetials extends StatelessWidget { title2: title2, viewKey: viewKey, ), - ), - ], - ) : Container( - width: double.infinity, - height: MediaQuery.of(context).size.height, - child: Center( - child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), - ), - ); + ),*/ + ], + ), + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + child: Center( + child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + ), + ); } generateData() { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( - (element) { - DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn); - if(element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) + (element) { + DateTime elementDate = + DateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey] != null && + element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); 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 dd9f940f..934a88b8 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 @@ -1,9 +1,11 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; @@ -36,26 +38,72 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { generateData(); - return Column( - children: [ - AppExpandableNotifier( - // isExpand: true, - headerWid: LineChartCurvedBloodPressure( - title: name, - timeSeries1: timeSeriesData1, - timeSeries2: timeSeriesData2, - indexes: timeSeriesData1.length ~/ 5.5, + return Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), ), - bodyWid: VitalSignBloodPressureWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - title3: title3, - viewKey1: viewKey1, - viewKey2: viewKey2, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Graph Details", + fontSize: SizeConfig.textMultiplier * 2.3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + SizedBox(height: 8,), + VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ], + ), ), - ), - ], + /*AppExpandableNotifier( + // isExpand: true, + headerWid: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + bodyWid: VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ),*/ + ], + ), ); } diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d023dbc2..4fd632cf 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -25,116 +25,113 @@ class ProcedureCard extends StatelessWidget { borderRadius: BorderRadius.circular(15), color: Colors.white, ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: MediaQuery.of(context).size.height * .20, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10), - ), - color: entityList.orderType == 1 - ? Colors.red[500] - : Colors.black, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), ), + color: entityList.orderType == 1 + ? Colors.red[500] + : Colors.black, ), - Expanded( - child: Container( - padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - entityList.orderType == 0 - ? 'Routine' - : 'Urgent', - color: entityList.orderType == 0 - ? Colors.black - : Colors.red[800], - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 5, - ), - Texts( - entityList.procedureName, - bold: true, - fontSize: 14, - ), - ], - ), - ), - SizedBox( - width: 5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.end, + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, + entityList.orderType == 0 + ? 'Routine' + : 'Urgent', + color: entityList.orderType == 0 + ? Colors.black + : Colors.red[800], fontWeight: FontWeight.w600, - fontSize: 14, + ), + SizedBox( + height: 5, ), Texts( - '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], + entityList.procedureName, + bold: true, fontSize: 14, ), ], ), - ], - ), - Row( - children: [ - Texts( - TranslationBase.of(context).orderNo, - color: Colors.grey, - fontSize: 12, - ), - Texts( - entityList.orderNo.toString(), - color: Colors.grey, - fontSize: 12, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - entityList.remarks ?? '', - fontSize: 12, - ), - Icon(Icons.edit) - ], - ) - ], - ), - onTap: onTap, + ), + SizedBox( + width: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + Texts( + '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).orderNo, + color: Colors.grey, + fontSize: 12, + ), + Texts( + entityList.orderNo.toString(), + color: Colors.grey, + fontSize: 12, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + entityList.remarks ?? '', + fontSize: 12, + ), + Icon(Icons.edit) + ], + ) + ], ), + onTap: onTap, ), ), - ], - ), + ), + ], ), ), ); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index ca658661..3c46cd3f 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -7,6 +7,7 @@ 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-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -27,8 +28,8 @@ class ProcedureScreen extends StatelessWidget { onModelReady: (model) => model.getProcedure(mrn: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).orderProcedure, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -37,8 +38,6 @@ class ProcedureScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, arrivalType ?? '0', patientType), SizedBox( height: 12, ), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 1297a673..5c0ad3f4 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -230,76 +230,77 @@ class AddSickLeavScreen extends StatelessWidget { )); }).toList(), ) - : new Builder(builder: (context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patient, - fontWeight: FontWeight.bold, - ), - AppText( - TranslationBase.of(context).sickLeave, - fontSize: 24, - fontWeight: FontWeight.bold, - ), - ], - )), - Container( - width: SizeConfig.screenWidth, - margin: EdgeInsets.only( - left: 20, right: 20, top: 20, bottom: 20), - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HexColor('#EAEAEA')), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: Container( - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: - BorderRadius.circular(10)), - padding: EdgeInsets.all(3), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - color: Colors.white, - ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - )), - Padding( - child: AppText( - TranslationBase.of(context) - .noSickLeaveApplied, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 16, - textAlign: TextAlign.center, - color: HexColor('#7E7E7E')), - padding: EdgeInsets.all(10), - ), - ], - )), - SizedBox( - height: SizeConfig.screenHeight * .6, - ) - ], - ); - }), + : SizedBox() + // : new Builder(builder: (context) { + // return Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.all(10), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).patient, + // fontWeight: FontWeight.bold, + // ), + // AppText( + // TranslationBase.of(context).sickLeave, + // fontSize: 24, + // fontWeight: FontWeight.bold, + // ), + // ], + // )), + // Container( + // width: SizeConfig.screenWidth, + // margin: EdgeInsets.only( + // left: 20, right: 20, top: 20, bottom: 20), + // padding: EdgeInsets.all(20), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + // color: HexColor('#EAEAEA')), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Container( + // child: Container( + // decoration: BoxDecoration( + // color: Colors.grey, + // borderRadius: + // BorderRadius.circular(10)), + // padding: EdgeInsets.all(3), + // child: IconButton( + // icon: Icon( + // Icons.add, + // size: 35, + // color: Colors.white, + // ), + // onPressed: () { + // openSickLeave( + // context, + // false, + // ); + // }), + // )), + // Padding( + // child: AppText( + // TranslationBase.of(context) + // .noSickLeaveApplied, + // fontWeight: FontWeight.bold, + // fontFamily: 'Poppins', + // fontSize: 16, + // textAlign: TextAlign.center, + // color: HexColor('#7E7E7E')), + // padding: EdgeInsets.all(10), + // ), + // ], + // )), + // SizedBox( + // height: SizeConfig.screenHeight * .6, + // ) + // ], + // ); + // }), ])))); } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 52ec7094..f64147dc 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -30,6 +30,7 @@ class ShowSickLeaveScreen extends StatelessWidget { model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).sickleave, body: SingleChildScrollView( child: Column( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 389c35f3..243f742e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1200,10 +1200,11 @@ class TranslationBase { String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; - String get accepted => localizedValues['accepetd'][locale.languageCode]; + String get accepted => localizedValues['accepted'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; + String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index c28cc8d3..fca0e0b4 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -78,10 +78,18 @@ class MyScheduleWidget extends StatelessWidget { SizedBox( height: 5, ), - AppText( - work.from + ' - ' + work.to, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, + Container( + width: MediaQuery.of(context).size.width*0.55, + child: Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + work.from + ' - ' + work.to, + fontSize: 15, + fontWeight: FontWeight.w300, + ), + ), + ), ) ], ), 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 195f6447..6e0192a8 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 @@ -44,7 +44,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred onPressed: () => Navigator.pop(context), ), AppText( - patient.firstName!=null? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)):'', + patient.firstName != null ? + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 78e13217..274d2264 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -369,7 +369,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre '${TranslationBase.of(context).dr}$doctorName', color: Colors.black, fontWeight: FontWeight.w600, - fontSize: 14, + fontSize: 12, ), if (orderNo != null && !isPrescriptions) Row( @@ -377,10 +377,10 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre Texts( 'Order No: ', color: Colors.grey[800], - fontSize: 14 + fontSize: 12 ), Texts( - orderNo ?? '',fontSize: 14 + orderNo ?? '',fontSize: 12 ) ], ), @@ -390,11 +390,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre Texts( 'Invoice: ', color: Colors.grey[800], - fontSize: 14 + fontSize: 12 ), Texts( invoiceNO, - fontSize: 14 + fontSize: 12 ) ], ), @@ -404,11 +404,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre Texts( 'Branch: ', color: Colors.grey[800], - fontSize: 14 + fontSize: 12 ), Texts( branch?? '', - fontSize: 14 + fontSize: 12 ) ], ), @@ -418,11 +418,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre Texts( 'Clinic: ', color: Colors.grey[800], - fontSize: 14 + fontSize: 12 ), Texts( clinic?? '', - fontSize: 14 + fontSize: 12 ) ], ), @@ -432,7 +432,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre child: Texts( !isPrescriptions? 'Result Date: ': 'Prescriptions Date ', color: Colors.grey[800], - fontSize: 14, + fontSize: 12, ), ), Texts( @@ -495,5 +495,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre } @override - Size get preferredSize => Size(double.maxFinite,280); + Size get preferredSize => Size(double.maxFinite,290); } diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart new file mode 100644 index 00000000..24a69a0b --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -0,0 +1,61 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ExpandableSOAPWidget extends StatelessWidget { + final bool isExpanded; + final Widget child; + final Function onTap; + final headerTitle; + + const ExpandableSOAPWidget( + {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts(headerTitle, + variant: isExpanded ? "bodyText" : '', + bold: isExpanded ? true : false, + fontSize: 20, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: onTap, + child: Icon( + isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline)) + ], + ), + bodyWidget: child, + isExpand: isExpanded, + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index a5bcf434..dab907b2 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -1,9 +1,9 @@ -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.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.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'; class StepsWidget extends StatelessWidget { @@ -20,7 +20,7 @@ class StepsWidget extends StatelessWidget { ? Stack( children: [ Container( - height: 120, + height: 150, width: MediaQuery.of(context).size.width, color: Colors.transparent, child: Center( @@ -32,7 +32,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: index == 0 ? 15 : 30, + top: 45, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -40,152 +40,155 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: index == 0 ? 70 : 50, - height: index == 0 ? 70 : 50, + width: 50, + height:50, decoration: BoxDecoration( border: index == 0 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 - ? null - : Border.all( - color: Colors.black, width: 0.75), + ? null + : Border.all( + color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 - ? Colors.white + ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '1', - variant: index == 0 ? "heading2" : "", - bold: true, - color: index == 0 - ? Colors.black - : index > 0 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 0 ? 5 : 10, + height:5 ), - AppText( - "SUBJECTIVE", - fontWeight: FontWeight.bold, - fontSize: 14, + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + "Subjective", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel(selectedStepId: index, stepId: 0,), + + ], ), ], ), ), ), Positioned( - top: index == 1 ? 15 : 30, - left: MediaQuery.of(context).size.width * 0.28, + top: 45, + left: MediaQuery + .of(context) + .size + .width * 0.28, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: index == 1 ? 70 : 50, - height: index == 1 ? 70 : 50, + width: 50, + height: 50, decoration: BoxDecoration( border: index == 1 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 - ? Colors.white + ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '2', - variant: index == 1 ? "heading2" : '', - bold: true, - color: index == 1 - ? Colors.black - : index > 1 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 1 ? 5 : 10, + height:5, ), - AppText( - "OBJECTIVE", - fontWeight: FontWeight.bold, - fontSize:14, + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + "Objective", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + + StatusLabel(selectedStepId: index, stepId: 1,), + + ], ), ], ), ), ), Positioned( - top: index == 2 ? 15 : 30, - left: MediaQuery.of(context).size.width * 0.52, + top: 45, + left: MediaQuery + .of(context) + .size + .width * 0.52, child: InkWell( onTap: () { - if(index >= 3) - changeCurrentTab(2); + if (index >= 3) + changeCurrentTab(2); }, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: index == 2 ? 70 : 50, - height: index == 2 ? 70 : 50, + width:50, + height:50, decoration: BoxDecoration( border: index == 2 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 - ? Colors.white + ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '3', - variant: index == 2 ? "heading2" : '', - bold: true, - color: index == 2 - ? Colors.black - : index > 2 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 2 ? 5 : 10, + height:5, ), - AppText( - "ASSESSMENT", - fontWeight: FontWeight.bold, - fontSize:14, + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + "Assessment", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + StatusLabel(selectedStepId: index, stepId: 2,), + ], ), ], ), ), ), Positioned( - top: index == 3 ? 15 : 30, + top: 45, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -193,45 +196,42 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: index == 3 ? 70 : 50, - height: index == 3 ? 70 : 50, + width:50, + height:50, decoration: BoxDecoration( border: index == 3 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 - ? Colors.white + ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '4', - variant: index == 3 ? "heading2" : '', - bold: true, - color: index == 3 - ? Colors.black - : index > 3 - ? Colors.white - : Colors.grey, - ), - ) + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) + ), ), SizedBox( - height: index == 3 ? 5 : 10, + height:5, ), Center( - child: AppText( - "PLAN", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize:14, - ), + child: Column( + children: [ + AppText( + "Plan", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: 14, + ), + StatusLabel(selectedStepId: index, stepId: 3,), + ], + ), ), ], ), @@ -242,8 +242,11 @@ class StepsWidget extends StatelessWidget { : Stack( children: [ Container( - height: 120, - width: MediaQuery.of(context).size.width, + height: 150, + width: MediaQuery + .of(context) + .size + .width, color: Colors.transparent, child: Center( child: Divider( @@ -254,7 +257,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: index == 0 ? 15 : 30, + top: 45, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -262,37 +265,29 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: index == 0 ? 70 : 50, - height: index == 0 ? 70 : 50, + width: 50, + height:50, decoration: BoxDecoration( border: index == 0 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 - ? null - : Border.all( - color: Colors.black, width: 0.75), + ? null + : Border.all( + color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 - ? Colors.white + ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '1', - variant: index == 0 ? "heading2" : "", - bold: true, - color: index == 0 - ? Colors.black - : index > 0 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 0 ? 5 : 10, + height:5 ), AppText( "شخصي", @@ -304,45 +299,40 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: index == 1 ? 15 : 30, - right: MediaQuery.of(context).size.width * 0.28, + top: 45, + right: MediaQuery + .of(context) + .size + .width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: index == 1 ? 70 : 50, - height: index == 1 ? 70 : 50, + width: 50, + height: 50, decoration: BoxDecoration( border: index == 1 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 - ? Colors.white + ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '2', - variant: index == 1 ? "heading2" : '', - bold: true, - color: index == 1 - ? Colors.black - : index > 1 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 1 ? 5 : 10, + height:5 ), AppText( "هدف", @@ -354,45 +344,40 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: index == 2 ? 15 : 30, - right: MediaQuery.of(context).size.width * 0.52, + top: 50, + right: MediaQuery + .of(context) + .size + .width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: index == 2 ? 70 : 50, - height: index == 2 ? 70 : 50, + width:50, + height:50, decoration: BoxDecoration( border: index == 2 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 - ? Colors.white + ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '3', - variant: index == 2 ? "heading2" : '', - bold: true, - color: index == 2 - ? Colors.black - : index > 2 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 2 ? 5 : 10, + height:5, ), Padding( @@ -408,7 +393,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: index == 3 ? 15 : 30, + top: 45, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -416,37 +401,29 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: index == 3 ? 70 : 50, - height: index == 3 ? 70 : 50, + width:50, + height:50, decoration: BoxDecoration( border: index == 3 - ? Border.all(color: Color(0xFFB9382C), width: 2) + ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 - ? Colors.white + ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFFB9382C) - : Color(0xFFCCCCCC), + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), ), child: Center( - child: Texts( - '4', - variant: index == 3 ? "heading2" : '', - bold: true, - color: index == 3 - ? Colors.black - : index > 3 - ? Colors.white - : Colors.grey, - ), + child: Icon(FontAwesomeIcons.check, size: 25, + color: Colors.white,) ), ), SizedBox( - height: index == 3 ? 5 : 10, + height:5, ), Container( margin: EdgeInsets.only(right:index == 3? 15:0), @@ -454,13 +431,49 @@ class StepsWidget extends StatelessWidget { "خطة", fontWeight: FontWeight.bold, fontSize:14, - ), + ), ), ], ), ), ), ], - ); + ); + } +} + +class StatusLabel extends StatelessWidget { + const StatusLabel({ + Key key, this.stepId, this.selectedStepId, + }) : super(key: key); + + final int stepId; + final int selectedStepId; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 3), + decoration: BoxDecoration( + color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < + selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), + borderRadius: BorderRadius.all( + Radius.circular(5.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + child: AppText( + stepId == selectedStepId ? "inProgress" : stepId < selectedStepId + ? "Completed" + : " Locked ", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: 10, + color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < + selectedStepId ? Color(0xFF359846) : Color(0xFF969696), + ), + ); } } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart new file mode 100644 index 00000000..90211413 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart @@ -0,0 +1,149 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class UpdateChiefComplaints extends StatelessWidget { + const UpdateChiefComplaints({ + Key key, + @required this.formKey, + @required this.complaintsController, + @required this.illnessController, + @required this.medicationController, + }) : super(key: key); + + final GlobalKey formKey; + final TextEditingController complaintsController; + final TextEditingController illnessController; + final TextEditingController medicationController; + + @override + Widget build(BuildContext context) { + return Form( + key: formKey, + child: Column(children: [ + SizedBox( + height: 20, + ), + + Container( + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + child: NewTextFields( + hintText: TranslationBase.of(context).addChiefComplaints, + controller: complaintsController, + ), + ), + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hasLabelText: complaintsController.text != '' + ? true + : false, + hintText: TranslationBase + .of(context) + .addChiefComplaints, + fontSize: 13.5, + // hintColor: Colors.black, + showLabelText: true, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: complaintsController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else if (value.length < 25) + return TranslationBase + .of(context) + .chiefComplaintLength; + //""; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hasLabelText: + illnessController.text != '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: illnessController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hasLabelText: medicationController.text != '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .currentMedications, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 23, + minLines: 10, + controller: medicationController, + validator: (value) { + if (value == null || value == "") + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + ]), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 3bc89a7f..140fec54 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -17,17 +16,17 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../expandable_SOAP_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -220,6 +219,9 @@ class _UpdateSubjectivePageState extends State { }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -232,243 +234,103 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase.of(context).chiefComplaints.toUpperCase(), - variant: isChiefExpand ? "bodyText" : '', - bold: isChiefExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isChiefExpand = !isChiefExpand; - }); - }, - child: Icon( - isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) - ], - ), - bodyWidget: Form( - key: formKey, - child: Column(children: [ - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hasLabelText: complaintsController.text != '' - ? true - : false, - hintText: TranslationBase.of(context) - .addChiefComplaints, - fontSize: 13.5, - // hintColor: Colors.black, - showLabelText: true, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: complaintsController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else if (value.length < 25) - return TranslationBase - .of(context) - .chiefComplaintLength; - //""; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hasLabelText: illnessController.text != '' - ? true - : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: illnessController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget(medicationController: medicationController,), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hasLabelText: medicationController.text != '' - ? true - : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .currentMedications, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 23, - minLines: 10, - controller: medicationController, - validator: (value) { - if (value == null || value == "") - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - - ]), - ), - isExpand: isChiefExpand, - ), - - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .chiefComplaints + .toUpperCase(), + onTap: () { + setState(() { + isChiefExpand = !isChiefExpand; + }); + }, + child: UpdateChiefComplaints(formKey: formKey, complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController), + isExpanded: isChiefExpand, ), SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .histories - .toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( + + + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .histories + .toUpperCase(), + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( children: [ UpdateHistoryWidget(myHistoryList: widget.myHistoryList) ], ), - isExpand: isHistoryExpand, + isExpanded: isHistoryExpand, ), SizedBox( height: 30, ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .allergiesSoap - .toUpperCase(), - variant: isAllergiesExpand ? "bodyText" : '', - bold: isAllergiesExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Icon(isAllergiesExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget:Column( + + + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .allergiesSoap + .toUpperCase(), + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( children: [ - UpdateAllergiesWidget(myAllergiesList: widget.myAllergiesList,), + UpdateAllergiesWidget(myAllergiesList: widget + .myAllergiesList,), SizedBox( height: 30, ), ], - ) - , - isExpand: isAllergiesExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + ), + isExpanded: isAllergiesExpand, ), SizedBox( - height: 30, + height:MediaQuery.of(context).size.height * 0.2, ), - AppButton( - title: TranslationBase.of(context).next, + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + height: MediaQuery + .of(context) + .size + .height * 0.15, + width: double.infinity, + + child: Column( + children: [ + SizedBox( + height: 15, + ), + Container(child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase + .of(context) + .next, loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( @@ -477,11 +339,13 @@ class _UpdateSubjectivePageState extends State { myHistoryList: widget.myHistoryList); }, ), - ], + ), + ),), + SizedBox( + height: 15, ), - ), - ), - ), + ], + ),), ), ); } @@ -624,12 +488,15 @@ class _UpdateSubjectivePageState extends State { numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work - postChiefComplaintRequestModel.editedBy=''; + postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { await model.patchChiefComplaint(postChiefComplaintRequestModel); } } - } } + + + + diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 5c646121..95d03cec 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -6,8 +6,6 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; @@ -17,11 +15,13 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../patient-profile-header-new-design.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } @@ -65,30 +65,39 @@ class _UpdateSoapIndexState extends State builder: (_, model, w) => AppScaffold( // baseViewModel: model, isLoading: _isLoading, - appBarTitle: TranslationBase.of(context).healthRecordInformation, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - decoration: - BoxDecoration(boxShadow: [], color: Colors.white), + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign(patient, '7', '7'), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), FractionallySizedBox( child: SingleChildScrollView( child: Container( + color: Theme.of(context).scaffoldBackgroundColor, height: MediaQuery.of(context).size.height * 0.75, child: Column( children: [ Container( margin: EdgeInsets.only( - left: - MediaQuery.of(context).size.width * 0.05, - right: - MediaQuery.of(context).size.width * 0.05), + left: MediaQuery.of(context).size.width * + 0.05, + right: MediaQuery.of(context).size.width * + 0.05), child: StepsWidget( index: _currentIndex, changeCurrentTab: changePageViewIndex, @@ -96,6 +105,7 @@ class _UpdateSoapIndexState extends State ), Expanded( child: PageView( + physics: NeverScrollableScrollPhysics(), controller: _controller, onPageChanged: (index) { @@ -106,32 +116,32 @@ class _UpdateSoapIndexState extends State scrollDirection: Axis.horizontal, children: [ UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - mySelectedExamination: - mySelectedExamination, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + mySelectedExamination: + mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - mySelectedAssessmentList: - mySelectedAssessment, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + mySelectedAssessmentList: + mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - patientInfo: patient, + changePageViewIndex: changePageViewIndex, + patientInfo: patient, patientProgressNote: patientProgressNote, - changeLoadingState:changeLoadingState + changeLoadingState: changeLoadingState ) ], diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 9cb1ab21..9ba055fc 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -105,9 +105,11 @@ class DoctorCard extends StatelessWidget { Texts( 'order No:', color: Colors.grey[500], + fontSize: 14, ), Texts( orderNo ?? '', + fontSize: 14, ) ], ), @@ -116,10 +118,12 @@ class DoctorCard extends StatelessWidget { children: [ Texts( 'Invoice:', + fontSize: 14, color: Colors.grey[500], ), Texts( invoiceNO, + fontSize: 14, ) ], ), @@ -129,9 +133,11 @@ class DoctorCard extends StatelessWidget { Texts( 'Clinic: ', color: Colors.grey[500], + fontSize: 14, ), Texts( clinic, + fontSize: 14, ) ], ), @@ -140,10 +146,12 @@ class DoctorCard extends StatelessWidget { children: [ Texts( 'Branch: ', + fontSize: 14, color: Colors.grey[500], ), Texts( branch, + fontSize: 14, ) ], ) diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index e87f4663..bd127bd1 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -1,14 +1,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/large_avatar.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; - -import 'StarRating.dart'; import 'Text.dart'; class DoctorCardInsurance extends StatelessWidget { @@ -41,141 +36,157 @@ class DoctorCardInsurance extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( + width: double.maxFinite, + height: 160, margin: EdgeInsets.all(10), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: approvalStatus == "Approved" - ? Color(0xff359846) - : Color(0xffD02127), - width: 3.5), - top: BorderSide(color: Colors.white, width: 0.5), - bottom: BorderSide(color: Colors.white, width: 0.5), - right: BorderSide(color: Colors.white, width: 0.5), - ), + borderRadius: BorderRadius.circular(15), color: Colors.white, ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: InkWell( - onTap: onTap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - "$approvalStatus", - color: approvalStatus == "Approved" - ? Color(0xff359846) - : Color(0xffD02127), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(25.0), - ), - color: Color(0xff2E303A)), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Texts( - '$patientOut'.replaceAll(" ", ""), - color: Colors.white, - fontSize: 13.0, - ), - ), - ) - ], - ), - Row( - children: [ - Expanded( - child: Texts( - doctorName, - bold: true, - )), - ], + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: 160, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + color: approvalStatus == "Approved" ? Color(0xff359846) : Color(0xffD02127), ), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - child: LargeAvatar( - name: doctorName, - url: profileUrl, - ), - width: 55, - height: 55, - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - Texts( - 'order No:', - color: Colors.grey[500], - ), - Texts( - orderNo ?? '', - ) - ], + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + "$approvalStatus", + color: approvalStatus == "Approved" + ? Color(0xff359846) + : Color(0xffD02127), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(25.0), + ), + color: Color(0xff2E303A)), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Texts( + '$patientOut', + color: Colors.white, + fontSize: 13.0, ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - Texts( - 'Invoice:', - color: Colors.grey[500], - ), - Texts( - invoiceNO, - ) - ], - ), - if (isPrescriptions) - Row( - children: [ - Texts( - 'Clinic: ', - color: Colors.grey[500], - ), - Expanded( - child: Texts( - clinic, - ), - ) - ], - ), - if (branch != null) - Row( - children: [ - Texts( - 'Approval No: ', - color: Colors.grey[500], - ), - Texts( - branch, - ) - ], - ) - ]), - ), + ), + ) + ], + ), + Row( + children: [ + Expanded( + child: Texts( + doctorName, + bold: true, + )), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 55, + height: 55, + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + Texts( + 'order No:', + color: Colors.grey[500], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[500], + ), + Texts( + invoiceNO, + ) + ], + ), + if (isPrescriptions) + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[500], + ), + Expanded( + child: Texts( + clinic, + ), + ) + ], + ), + if (branch != null) + Row( + children: [ + Texts( + 'Approval No: ', + color: Colors.grey[500], + ), + Texts( + branch, + ) + ], + ) + ]), + ), + ), + Icon( + EvaIcons.eye, + size: 38.0, + ) + ], + ), + ], ), - Icon( - EvaIcons.eye, - size: 38.0, - ) - ], + ), ), - ], - ), + ), + ], ), ), ); diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index fefea780..248123a6 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -35,13 +35,13 @@ class _DrawerItemState extends State { color: widget.color ?? Colors.black87, size: SizeConfig.imageSizeMultiplier * 5, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width *0.45, - child: Expanded( + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.45, child: AppText( widget.title, marginLeft: 5, @@ -52,15 +52,15 @@ class _DrawerItemState extends State { fontWeight: FontWeight.bold, ), ), - ), - AppText( - widget.subTitle, - visibility: !widget.subTitle.isNullOrEmpty(), - color: widget.color ?? Colors.black, - marginLeft: 5, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ], + AppText( + widget.subTitle, + visibility: !widget.subTitle.isNullOrEmpty(), + color: widget.color ?? Colors.black, + marginLeft: 5, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ], + ), ), ], )); diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/new_text_Field.dart new file mode 100644 index 00000000..dc361abd --- /dev/null +++ b/lib/widgets/shared/new_text_Field.dart @@ -0,0 +1,229 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor, + this.isEnabled = true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + style: Theme.of(context).textTheme.body2.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: + TextStyle(color: Theme.of(context).textTheme.bodyText1.color), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context).errorColor.withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context).errorColor.withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +}