diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea99a982..ebeabbd1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -447,7 +447,7 @@ const Map> localizedValues = { 'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة' }, - 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, + 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'المريض حامل'}, 'treatmentLine': { 'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج' @@ -870,4 +870,6 @@ const Map> localizedValues = { }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, + "severe": {"en": "Severe", "ar": "الشدة"}, + "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, }; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index bdbf125e..c97f8426 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -163,7 +163,7 @@ class AdmissionRequestService extends LookupService { hasError = false; Map body = Map(); - body['patientMRN'] = patientMrn; + body['PatientMRN'] = patientMrn; await baseAppClient.post( GET_DIET_TYPES, diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index cd02f538..59b13fe8 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -23,7 +23,7 @@ class VitalSignsViewModel extends BaseViewModel { String hartRat = "0"; String respirationBeatPerMinute = "0"; String bloodPressure = "0 / 0"; - String oxygenation = "0 - 0"; + String oxygenation = "0"; String painScore = "-"; String painLocation = "-"; String painCharacter = "-"; @@ -93,11 +93,11 @@ class VitalSignsViewModel extends BaseViewModel { bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } - if (oxygenation == "0 - 0" || + if (oxygenation == "0" || oxygenation == null || oxygenation == 'null') { oxygenation = - "${element.sAO2.toString()} - ${element.fIO2.toString()}"; + "${element.sAO2.toString()}";/* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { painScore = element.painScore.toString() != 'null' diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index dd93be70..d23397da 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -44,6 +44,7 @@ class _AdmissionRequestThirdScreenState String clinicError; String doctorError; String sickLeaveCommentError; + String dietTypeError; String medicalHistoryError; String surgicalHistoryError; @@ -78,8 +79,6 @@ class _AdmissionRequestThirdScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientProfileHeaderNewDesign( - // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -87,15 +86,15 @@ class _AdmissionRequestThirdScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -109,7 +108,7 @@ class _AdmissionRequestThirdScreenState AppText( TranslationBase.of(context) .specialityAndDoctorDetail, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), @@ -278,6 +277,7 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).dietType, isTextFieldHasSuffix: true, + validationError: dietTypeError, dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, @@ -426,6 +426,11 @@ class _AdmissionRequestThirdScreenState }else { sickLeaveCommentError = null; } + if(_selectedDietType == null){ + dietTypeError = TranslationBase.of(context).fieldRequired; + }else { + dietTypeError = null; + } if(_postMedicalHistoryController.text == ""){ medicalHistoryError = TranslationBase.of(context).fieldRequired; }else { diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 71a29a1e..120b6adf 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -76,15 +76,15 @@ class _AdmissionRequestThirdScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -96,7 +96,7 @@ class _AdmissionRequestThirdScreenState children: [ AppText( TranslationBase.of(context).diagnosisDetail, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 05a43460..90131c03 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -91,8 +91,6 @@ class _AdmissionRequestSecondScreenState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientProfileHeaderNewDesign( - // patient, patientType, arrivalType), Container( margin: EdgeInsets.all(16.0), child: Column( @@ -100,15 +98,15 @@ class _AdmissionRequestSecondScreenState children: [ AppText( "${TranslationBase.of(context).admission}", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( - "${TranslationBase.of(context).request}", - fontFamily: 'Poppins', + TranslationBase.of(context).request, fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -122,7 +120,7 @@ class _AdmissionRequestSecondScreenState AppText( TranslationBase.of(context) .postPlansEstimatedCost, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), @@ -170,7 +168,7 @@ class _AdmissionRequestSecondScreenState ), AppText( TranslationBase.of(context).otherInformation, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, ), diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index b6699b22..6026c9e9 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -45,7 +46,7 @@ class LabResultChartAndDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart new file mode 100644 index 00000000..24f6448b --- /dev/null +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -0,0 +1,1153 @@ + +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../../routes.dart'; + +class PatientProfileScreen extends StatefulWidget { + @override + _PatientProfileScreenState createState() => _PatientProfileScreenState(); +} + +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + bool isSearchAndOut = false; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; + int index = 0; + int _activeTab = 0; + @override + void initState() { + _tabController = TabController(length: 2, vsync: this); + super.initState(); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + }if (routeArgs.containsKey("isSearchAndOut")) { + isSearchAndOut = routeArgs['isSearchAndOut']; + } + if (isInpatient) + _activeTab = 0; + else + _activeTab = 1; + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase + .of(context) + .patientProfile, + isShowAppBar: false, + //TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient?240:0, + ), + + Container( + height: !isSearchAndOut ? isDischargedPatient?MediaQuery + .of(context) + .size + .height * 0.64 : MediaQuery + .of(context) + .size + .height * 0.65 : MediaQuery + .of(context) + .size + .height * 0.69, + child: ListView( + children: [ + Container( + child: isSearchAndOut + ? Column( + children: [ + + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.01, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: LAB_RESULT, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: "ECG", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ORDER_PROCEDURE, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), + ], + ), + ), + ], + ) + : isInpatient + ? Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.01, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", + nameLine2: + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: + "Medical", + //Health + isInPatient: isInpatient, + nameLine2: + "Report", + //Report + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + ], + ), + ) + : Column( + children: [ + Padding( + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.01, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: LAB_RESULT, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: "ECG", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ORDER_PROCEDURE, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => + Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase + .of(context) + .createNew}\n${TranslationBase + .of(context) + .episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase + .of(context) + .update}\n${TranslationBase + .of(context) + .episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), + ], + ), + ], + ), + )); + } + + Widget tabsBar(BuildContext context, Size screenSize) { + List _tabs = [ + "Inpatient Info".toUpperCase(), + "Outpatient Info".toUpperCase(), + ]; + + return Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 0b41e0a2..a6f36784 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -57,15 +57,15 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${patient.firstName ?? patient.patientDetails.firstName}'s", - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).vitalSign, - fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), ) ], ), @@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, ), @@ -544,8 +544,8 @@ class VitalSignDetailsScreen extends StatelessWidget { .oxygenation, imagePath: "${assetBasePath}oxg.png", - lastVal: mode.oxygenation, - unit: "%", + lastVal: "${mode.oxygenation}%", + unit: "", ), ), InkWell( @@ -576,198 +576,11 @@ class VitalSignDetailsScreen extends StatelessWidget { imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: "", + unit: TranslationBase.of(context).severe, ), ), ], ), - /*RoundedContainer( - width: MediaQuery.of(context).size.width / 2, - margin: EdgeInsets.symmetric( - horizontal: 0.0, vertical: 16), - child: Container( - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(top: 8), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Expanded( - child: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painScore}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Location", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painLocation}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Character", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painCharacter}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "Duration", - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painDuration}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).painManagement, - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.isPainDone}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).frequency, - fontSize: SizeConfig.textMultiplier * 1.5, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${mode.painFrequency}", - fontSize: SizeConfig.textMultiplier * 1.3, - color: Colors.grey.shade700, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ), - ), - Container( - child: Image.asset( - "${assetBasePath}painScale.png", - width: 40, - height: 40, - )) - ], - ), - ), - Container( - child: Column( - children: [ - Align( - alignment: - Alignment.topRight, - child: Icon( - EvaIcons.eye, - ), - ), - Align( - alignment: - Alignment.topLeft, - child: Container( - margin: EdgeInsets.only( - left: 5, right: 5), - child: AppText( - "${TranslationBase.of(context).painScale}", - fontFamily: 'Poppins', - fontSize: SizeConfig - .textMultiplier * - 1.3, - fontWeight: - FontWeight.bold, - ), - ), - ), - ], - ), - ), - ], - ), - ), - ),*/ ], ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index fbea0452..20d5b439 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -52,6 +52,7 @@ class VitalSignItem extends StatelessWidget { fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.4, fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), margin: 0, ), Expanded( @@ -62,7 +63,7 @@ class VitalSignItem extends StatelessWidget { fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.2, fontWeight: FontWeight.w700, - color: Color(0xFFB8382C), + color: Color(0xFFD02127), margin: 0, ), ], @@ -98,7 +99,7 @@ class VitalSignItem extends StatelessWidget { margin: EdgeInsets.only(left: 5, right: 5), child: AppText( "$des", - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.3, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index f59f6c23..2d4abec8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -58,7 +58,7 @@ class VitalSingChartAndDetials extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 27256525..0ac2f18b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -63,7 +63,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Graph Details", + TranslationBase.of(context).graphDetails, fontSize: SizeConfig.textMultiplier * 2.3, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6602722c..56c2f710 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1247,6 +1247,8 @@ class TranslationBase { String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get severe => localizedValues["severe"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 66d33fe7..9a027e36 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,9 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientProfileButton extends StatelessWidget { final String nameLine1; @@ -42,6 +44,8 @@ class PatientProfileButton extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), padding: EdgeInsets.fromLTRB(10, 10, 10, 5), @@ -63,11 +67,11 @@ class PatientProfileButton extends StatelessWidget { url + icon, width: 50, height: 50, - )) + ),) ], )), Container( - alignment: Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index 5e934167..76a7f57e 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -30,7 +31,7 @@ class AppExpandableNotifier extends StatelessWidget { header: Padding( padding: EdgeInsets.all(10), child: Text( - "See Graph Details", + "${TranslationBase.of(context).graphDetails}", style: TextStyle(fontWeight: FontWeight.bold), )), collapsed: Text(''), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index eab11a57..e63acba2 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -48,71 +48,74 @@ class AppButton extends StatefulWidget { class _AppButtonState extends State { @override Widget build(BuildContext context) { - return IgnorePointer( - ignoring: widget.loading ||widget.disabled, - child: RawMaterialButton( - fillColor: widget.disabled - ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: (widget.hPadding > 0 || widget.vPadding > 0) - ? EdgeInsets.symmetric( - vertical: widget.vPadding, horizontal: widget.hPadding) - : EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Container(width: 25, height: 25, child: widget.icon), - if (widget.iconData != null) - Icon( - widget.iconData, - color: Colors.white, - ), - if (widget.icon != null || widget.iconData != null) - SizedBox( - width: 5.0, - ), - widget.loading - ? Padding( - padding: EdgeInsets.all(2.6), - child: SizedBox( - height: 19.0, - width: 19.0, - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + return Container( + height: MediaQuery.of(context).size.height * 0.075, + child: IgnorePointer( + ignoring: widget.loading ||widget.disabled, + child: RawMaterialButton( + fillColor: widget.disabled + ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: (widget.hPadding > 0 || widget.vPadding > 0) + ? EdgeInsets.symmetric( + vertical: widget.vPadding, horizontal: widget.hPadding) + : EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Container(width: 25, height: 25, child: widget.icon), + if (widget.iconData != null) + Icon( + widget.iconData, + color: Colors.white, + ), + if (widget.icon != null || widget.iconData != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[300], + ), ), ), + ) + : Container( + child: AppText( + widget.title, + color: widget.fontColor, + fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontWeight: widget.fontWeight, + ), ), - ) - : Container( - child: AppText( - widget.title, - color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, - fontWeight: widget.fontWeight, - ), - ), - ], + ], + ), ), + onPressed: widget.disabled ? (){} : widget.onPressed, + shape: RoundedRectangleBorder( + side: BorderSide( + color: + widget.hasBorder ? widget.borderColor : widget.disabled + ? Colors.grey : widget.color ?? Color(0xFFB8382C), + width: 0.8, + ), + borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), - onPressed: widget.disabled ? (){} : widget.onPressed, - shape: RoundedRectangleBorder( - side: BorderSide( - color: - widget.hasBorder ? widget.borderColor : widget.disabled - ? Colors.grey : widget.color ?? Color(0xFFB8382C), - width: 0.8, - ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), ); } diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 224907d9..9db662d2 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -4,20 +4,61 @@ import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { - final double height; - final String buttonTitle; - final Function onPressed; + final GestureTapCallback onPressed; + final String title; + final IconData iconData; + final Widget icon; + final Color color; + final double fontSize; + final double padding; + final Color fontColor; + final bool loading; + final bool disabled; + final FontWeight fontWeight; + final bool hasBorder; + final Color borderColor; + final double radius; + final double vPadding; + final double hPadding; - ButtonBottomSheet({@required this.height, @required this.buttonTitle, @required this.onPressed}); + ButtonBottomSheet({@required this.onPressed, + this.title, + this.iconData, + this.icon, + this.color, + this.fontSize = 2, + this.padding = 13, + this.loading = false, + this.disabled = false, + this.fontColor = Colors.white, + this.fontWeight = FontWeight.normal, + this.vPadding = 0, + this.hPadding = 0, + this.radius = 8.0, + this.hasBorder = false, + this.borderColor,}); @override Widget build(BuildContext context) { return Container( - height: height ?? null, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( - title: buttonTitle, + title: title, onPressed: onPressed, + fontWeight: fontWeight, + color: color, + fontSize: fontSize, + padding: padding, + disabled: disabled, + radius: radius, + hasBorder: hasBorder, + fontColor: fontColor, + icon: icon, + iconData: iconData, + hPadding: hPadding, + vPadding: vPadding, + borderColor: borderColor, + loading: loading, ), ); } diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 88b95936..12eaaa7c 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_field_error.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; @@ -50,10 +52,12 @@ class AppTextFieldCustom extends StatefulWidget { class _AppTextFieldCustomState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Column( children: [ Container( - height: widget.height != 0 ? widget.height + 8 : null, + height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -72,7 +76,7 @@ class _AppTextFieldCustomState extends State { child: Container( padding: widget.dropDownText == null ? EdgeInsets.symmetric(vertical: 0) - : EdgeInsets.symmetric(vertical: 8), + : EdgeInsets.symmetric(vertical: 0), // 8.0 child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -82,40 +86,45 @@ class _AppTextFieldCustomState extends State { widget.dropDownText != null) AppText( widget.hintText, - fontFamily: 'Poppins', + color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.4, fontWeight: FontWeight.w700, ), widget.dropDownText == null - ? TextField( - textAlign: TextAlign.left, - decoration: - TextFieldsUtils.textFieldSelectorDecoration( - widget.hintText, null, true), - style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, - fontFamily: 'Poppins', - color: Colors.grey.shade800, - ), - controller: widget.controller, - keyboardType: widget.inputType, - enabled: widget.enabled, - minLines: widget.minLines, - maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], - onChanged: (value) { - if (widget.onChanged != null) { - widget.onChanged(value); + ? Container( + height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, + child: TextField( + textAlign: projectViewModel.isArabic + ? TextAlign.right + : TextAlign.left, + decoration: + TextFieldsUtils.textFieldSelectorDecoration( + widget.hintText, null, true), + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.7, + fontFamily: 'Poppins', + color: Color(0xFF575757), + ), + controller: widget.controller, + keyboardType: widget.inputType, + enabled: widget.enabled, + minLines: widget.minLines, + maxLines: widget.maxLines, + inputFormatters: widget.inputFormatters != null + ? widget.inputFormatters + : [], + onChanged: (value) { setState(() {}); - } - }, - ) + if (widget.onChanged != null) { + widget.onChanged(value); + } + }, + ), + ) : AppText( widget.dropDownText, fontFamily: 'Poppins', - color: Colors.grey.shade800, + color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.7, ), ], diff --git a/pubspec.lock b/pubspec.lock index d338a618..9d52ce65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: