diff --git a/assets/images/patient/vital_signs/Obese_BMI-r.png b/assets/images/patient/vital_signs/Obese_BMI-r.png new file mode 100644 index 00000000..50b32822 Binary files /dev/null and b/assets/images/patient/vital_signs/Obese_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/Obese_BMI.png b/assets/images/patient/vital_signs/Obese_BMI.png new file mode 100644 index 00000000..540d4bcc Binary files /dev/null and b/assets/images/patient/vital_signs/Obese_BMI.png differ diff --git a/assets/images/patient/vital_signs/blood_pressure.png b/assets/images/patient/vital_signs/blood_pressure.png new file mode 100644 index 00000000..96701875 Binary files /dev/null and b/assets/images/patient/vital_signs/blood_pressure.png differ diff --git a/assets/images/patient/vital_signs/health_BMI-r.png b/assets/images/patient/vital_signs/health_BMI-r.png new file mode 100644 index 00000000..96189d34 Binary files /dev/null and b/assets/images/patient/vital_signs/health_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/health_BMI.png b/assets/images/patient/vital_signs/health_BMI.png new file mode 100644 index 00000000..c87a0424 Binary files /dev/null and b/assets/images/patient/vital_signs/health_BMI.png differ diff --git a/assets/images/patient/vital_signs/heart_rate.png b/assets/images/patient/vital_signs/heart_rate.png new file mode 100644 index 00000000..76017194 Binary files /dev/null and b/assets/images/patient/vital_signs/heart_rate.png differ diff --git a/assets/images/patient/vital_signs/height.png b/assets/images/patient/vital_signs/height.png new file mode 100644 index 00000000..e176c456 Binary files /dev/null and b/assets/images/patient/vital_signs/height.png differ diff --git a/assets/images/patient/vital_signs/ovrweight_BMI-r.png b/assets/images/patient/vital_signs/ovrweight_BMI-r.png new file mode 100644 index 00000000..ff24fc61 Binary files /dev/null and b/assets/images/patient/vital_signs/ovrweight_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/ovrweight_BMI.png b/assets/images/patient/vital_signs/ovrweight_BMI.png new file mode 100644 index 00000000..da8e67bb Binary files /dev/null and b/assets/images/patient/vital_signs/ovrweight_BMI.png differ diff --git a/assets/images/patient/vital_signs/respiration_rate.png b/assets/images/patient/vital_signs/respiration_rate.png new file mode 100644 index 00000000..ff695dec Binary files /dev/null and b/assets/images/patient/vital_signs/respiration_rate.png differ diff --git a/assets/images/patient/vital_signs/temperature.png b/assets/images/patient/vital_signs/temperature.png new file mode 100644 index 00000000..9953a130 Binary files /dev/null and b/assets/images/patient/vital_signs/temperature.png differ diff --git a/assets/images/patient/vital_signs/underweight_BMI-r.png b/assets/images/patient/vital_signs/underweight_BMI-r.png new file mode 100644 index 00000000..2f633b45 Binary files /dev/null and b/assets/images/patient/vital_signs/underweight_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/underweight_BMI.png b/assets/images/patient/vital_signs/underweight_BMI.png new file mode 100644 index 00000000..83b0260a Binary files /dev/null and b/assets/images/patient/vital_signs/underweight_BMI.png differ diff --git a/assets/images/patient/vital_signs/weight.png b/assets/images/patient/vital_signs/weight.png new file mode 100644 index 00000000..4a3bd2cc Binary files /dev/null and b/assets/images/patient/vital_signs/weight.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..0f615af5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f30a86e5..aa57f29a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -84,7 +84,7 @@ const Map> localizedValues = { 'speciality': {'en': 'Speciality', 'ar': 'التخصص'}, 'errorMessage': {'en': 'Something went wrong', 'ar': 'حدث خطأ ما'}, 'patientProfile': {'en': 'Patient Profile', 'ar': 'ملف المريض'}, - 'vitalSign': {'en': 'Vital Sign', 'ar': 'المؤشرات الحيوية'}, + 'vitalSign': {'en': 'Vital Signs', 'ar': 'المؤشرات الحيوية'}, 'vital': {'en': 'Vital', 'ar': 'الحيوية'}, 'signs': {'en': 'Signs', 'ar': 'المؤشرات'}, 'labOrder': {'en': 'Lab Order', 'ar': 'نتائج التحاليل'}, @@ -377,6 +377,11 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, + 'yourBodyMassIndex': {'en': "Your Body Mass Index is", 'ar': 'مؤشر كتلة جسمك هو'}, + 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, + 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, + 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, + 'bmiObese': {'en': "Obese", 'ar': 'سمين'}, 'method': {'en': "Method", 'ar': 'الطريقة'}, 'pulseBeats': {'en': 'Pulse(beats/minute)', 'ar': ' (دقة/دقيقة)النبض'}, 'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'}, @@ -608,7 +613,7 @@ const Map> localizedValues = { "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, - 'heart': {'en': 'Heart', 'ar': 'قلب'}, + 'heart': {'en': 'Heart rate', 'ar': 'معدل ضربات القلب'}, 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 2def78db..0a51f7f5 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -99,6 +99,19 @@ class VitalSignsViewModel extends BaseViewModel { } } + int getBMIStatus() { + var bodyMassIndex = double.parse(bodyMax); + if (bodyMassIndex <= 18.5) { + return 1; + } else if (bodyMassIndex <= 25.0) { + return 2; + } else if (bodyMassIndex <= 30) { + return 3; + } else { + return 4; + } + } + String getTempratureMethod(int temperatureCelciusMethod) { // temperatureCelciusMethod ( vital sign response field )- master 2005 if (temperatureCelciusMethod == 1) { 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 0c1f0de2..1cf69da8 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 @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; @@ -6,11 +5,12 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -47,12 +47,15 @@ class _AdmissionRequestThirdScreenState Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: (){ @@ -62,27 +65,57 @@ class _AdmissionRequestThirdScreenState } }, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), + margin: EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, + AppText( + "${TranslationBase.of(context).admission}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, ), + AppText( + "${TranslationBase.of(context).request}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + margin: EdgeInsets.symmetric( + vertical: 0, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ AppText( TranslationBase.of(context) .specialityAndDoctorDetail, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.070, + hintText: "test field", + isDropDown: true, + controller: _sickLeaveCommentsController, ), SizedBox( height: 10, diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 85c93e2f..70c9f5b9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -96,7 +96,7 @@ class PatientProfileScreen extends StatelessWidget { if (int.parse(patientType) == 7 || int.parse(patientType) == 6) Positioned( - top: 195, + top: 175, left: 20, right: 20, child: Row( diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 3cab440c..e6cccf48 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -33,7 +33,7 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 70), // color: Colors.white, // height: MediaQuery.of(context).size.height, child: Column( 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 2b4877e8..3dd45782 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 @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/transitions/fade_page.dart'; @@ -29,191 +30,378 @@ class VitalSignDetailsScreen extends StatelessWidget { String from = routeArgs['from']; String to = routeArgs['to']; String imageBasePath = 'assets/images/'; + String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to), builder: (_, mode, widget) => AppScaffold( - isShowAppBar: true, + isShowAppBar: false, baseViewModel: mode, appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 - ? Container( - child: ListView( - children: [ - Row( - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context).height, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).height, - imagePath: "${imageBasePath}vital_height.png", - lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm, - ), - ), + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), + 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, ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context).weight, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).weight, - imagePath: "${imageBasePath}vital_weight.png", - unit: TranslationBase.of(context).kg, - lastVal: mode.weightKg, - ), + AppText( + TranslationBase.of(context).vitalSign, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.21, + width: double.infinity, + padding: EdgeInsets.all(12.0), + margin: EdgeInsets.symmetric(horizontal: 16.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w700, ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 1 + ? '${assetBasePath}underweight_BMI.png' + : '${assetBasePath}underweight_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiUnderWeight}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + AppText( + "(1-10)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 2 + ? '${assetBasePath}health_BMI.png' + : '${assetBasePath}health_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiHealthy}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(11-20)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 3 + ? '${assetBasePath}ovrweight_BMI.png' + : '${assetBasePath}ovrweight_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiOverWeight}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(21-30)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + 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.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(31-40>)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + ], + )), + ], + ) ], ), - Row( - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.BodyMeasurements, - pageTitle: TranslationBase.of(context) - .bodyMeasurements, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).body, - imagePath: "${imageBasePath}vital_body_mass.png", - lastVal: mode.bodyMax, - unit: TranslationBase.of(context).mass, + ), + Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 8.0), + child : GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 4, + mainAxisSpacing: 4, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context) + .height, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).height, + imagePath: + "${assetBasePath}height.png", + lastVal: mode.heightCm, + unit: TranslationBase.of(context).cm, + ), + ), ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: TranslationBase.of(context) - .temperature, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: Container( + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context) + .weight, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( - des: TranslationBase.of(context).temperature, - imagePath: - "${imageBasePath}vital_temperature.png", - lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC, + des: TranslationBase.of(context).weight, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg, + lastVal: mode.weightKg, ), ), - ), - ], - ), - Row( - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context).heart, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).heart, - imagePath: "${imageBasePath}vital_heart_rate.png", - lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.Temperature, + pageTitle: + TranslationBase.of(context) + .temperature, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: + TranslationBase.of(context).temperature, + imagePath: + "${assetBasePath}temperature.png", + lastVal: mode.temperatureCelcius, + unit: TranslationBase.of(context).tempC, + ), + ), ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: TranslationBase.of(context) - .respirationRate, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).respirationRate, - imagePath: "${imageBasePath}vital_respiration.png", - lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context).respirationSigns, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context) + .heart, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context).heart, + imagePath: + "${assetBasePath}heart_rate.png", + lastVal: mode.hartRat, + unit: TranslationBase.of(context).bpm, + ), ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context) - .bloodPressure, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure, - imagePath: - "${imageBasePath}vital_blood-pressure.png", - lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.Respiration, + pageTitle: + TranslationBase.of(context) + .respirationRate, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .respirationRate, + imagePath: + "${assetBasePath}respiration_rate.png", + lastVal: mode.respirationBeatPerMinute, + 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, + ), + ), + ) + : null, + child: VitalSignItem( + des: + TranslationBase.of(context).bloodPressure, + imagePath: + "${assetBasePath}blood_pressure.png", + lastVal: mode.bloodPressure, + unit: TranslationBase.of(context).sysDias, + ), + ), + ], + ), ), - ], - ), + ), + ], ) : Center( child: AppText( 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 33b25e82..e99e7bad 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -1,9 +1,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class VitalSignItem extends StatelessWidget { + final String des; + final String lastVal; + final String unit; + final String imagePath; + final double height; + final double width; + const VitalSignItem( {Key key, @required this.des, @@ -14,77 +22,71 @@ class VitalSignItem extends StatelessWidget { @required this.imagePath}) : super(key: key); - final String des; - final String lastVal; - final String unit; - final String imagePath; - final double height; - final double width; - @override Widget build(BuildContext context) { return RoundedContainer( - margin: 0.025 * SizeConfig.realScreenWidth, - height: 0.15 * SizeConfig.realScreenHeight, - width: 0.45 * SizeConfig.realScreenWidth, + // margin: 0.025 * SizeConfig.realScreenWidth, + // height: 0.15 * SizeConfig.realScreenHeight, + // width: 0.45 * SizeConfig.realScreenWidth, child: Container( padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - height: 0.10 * SizeConfig.realScreenHeight, - child: Row( - children: [ - Expanded( - flex: 2, - child: Align( - alignment: Alignment.topLeft, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - des, - style: TextStyle( - fontSize: 1.7 * SizeConfig.textMultiplier, - color: HexColor('#B8382C'), - fontWeight: FontWeight.bold, - ), + Expanded( + child: Container( + padding: EdgeInsets.only(top: 8), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 8, right: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + "$lastVal", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w800, + margin: 0, + ), + AppText( + "$unit", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.3, + fontWeight: FontWeight.w700, + color: HexColor('#B8382C'), + margin: 0, + ), + ], ), ), ), - ), - Expanded( - flex: 1, - child: Container( + Container( child: Image.asset( imagePath, width: 40, height: 40, - )), - ) - ], + )) + ], + ), ), ), - Expanded( - child: Container( - width: double.infinity, - child: Align( - alignment: Alignment.topRight, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: RichText( - text: TextSpan( - style: TextStyle(color: Colors.black), - children: [ - TextSpan(text: "$lastVal "), - TextSpan( - text: unit, - style: TextStyle( - color: HexColor('#B8382C'), - ), - ), - ]), - ), + Container( + width: double.infinity, + child: Align( + alignment: Alignment.topLeft, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: AppText( + "$des", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.w600, ), ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 331b2812..df880f9a 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -645,8 +645,13 @@ class TranslationBase { String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + + String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; + String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 6e9008e7..14afa5b6 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -313,12 +313,14 @@ class PatientReferralItemWidget extends StatelessWidget { ), Row( children: [ - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2.5, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Expanded( + child: AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), ), SizedBox( width: 4, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 5979b8e1..b50a191b 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -26,7 +26,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 220, + height: 200, child: Container( padding: EdgeInsets.only( left: 10, right: 10, bottom: 10), diff --git a/lib/widgets/shared/app-textfield-custom.dart b/lib/widgets/shared/app-textfield-custom.dart new file mode 100644 index 00000000..15c8865a --- /dev/null +++ b/lib/widgets/shared/app-textfield-custom.dart @@ -0,0 +1,140 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/material.dart'; + +import 'app_texts_widget.dart'; + +class AppTextFieldCustom extends StatefulWidget { + final double height; + final Function onClick; + final String hintText; + final TextEditingController controller; + final bool isDropDown; + final Icon suffixIcon; + final Color dropDownColor; + + AppTextFieldCustom( + {this.height = 0, + this.onClick, + this.hintText, + this.controller, + this.isDropDown = false, + this.suffixIcon, + this.dropDownColor}); + + @override + _AppTextFieldCustomState createState() => _AppTextFieldCustomState(); +} + +class _AppTextFieldCustomState extends State { + @override + Widget build(BuildContext context) { + return Container( + height: widget.height != 0 ? widget.height : null, + decoration: + containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)), + padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + child: InkWell( + onTap: widget.onClick ?? null, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.controller.text != "") + AppText( + widget.hintText, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w600, + ), + TextField( + textAlign: TextAlign.left, + decoration: textFieldSelectorDecoration( + widget.hintText, null, true), + style: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + controller: widget.controller, + ), + ], + ), + ), + widget.isDropDown + ? widget.suffixIcon != null + ? widget.suffixIcon + : Icon( + Icons.arrow_drop_down, + color: widget.dropDownColor != null + ? widget.dropDownColor + : Colors.black, + ) + : Container(), + ], + ), + ), + ); + } + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, + {double borderWidth = -1}) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: borderWidth == -1 ? 2.0 : borderWidth, + )), + ); + } + + static InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon, Color dropDownColor}) { + return InputDecoration( + isDense: true, + contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + border: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + /*focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ),*/ + hintText: selectedText != null ? selectedText : hintText, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + /*suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: dropDownColor != null ? dropDownColor : Colors.black, + ) + : null,*/ + // labelText: + // labelStyle: + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index b564ffda..3aae565e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,6 +107,7 @@ flutter: - assets/images/dashboard/ - assets/images/login/ - assets/images/patient/ + - assets/images/patient/vital_signs/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware.