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 98393a63..06768cbc 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 662111d0..9fa9c35c 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': 'نتائج التحاليل'}, @@ -124,10 +124,10 @@ const Map> localizedValues = { 'ar': 'ليس لديك اي ملاحظة تقدم ' }, 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, - 'generalResult': {'en': 'General Result :', 'ar': 'النتيجة العامة'}, + 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'}, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'value': {'en': 'Value', 'ar': 'القيمة'}, - 'range': {'en': 'range', 'ar': 'النطاق'}, + 'range': {'en': 'Range', 'ar': 'النطاق'}, 'enterId': {'en': 'Enter ID', 'ar': 'الهوية'}, 'pleaseEnterYourID': { 'en': 'Please enter your ID', @@ -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/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 3f457956..43851649 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -88,6 +88,11 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); + List get labResultListsCoustom { + + return labResultLists; + } + getLaboratoryResult( {String projectID, int clinicID, 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/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6af34f4d..8af1144f 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -1,4 +1,9 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; @@ -6,11 +11,18 @@ import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/service/labs_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; +import 'package:doctor_app_flutter/core/service/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:flutter/cupertino.dart'; class ProcedureViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; bool hasError = false; ProcedureService _procedureService = locator(); List get procedureList => @@ -20,6 +32,24 @@ class ProcedureViewModel extends BaseViewModel { List get categoriesList => _procedureService.categoriesList; List get categoryList => _procedureService.categoryList; + RadiologyService _radiologyService = locator(); + LabsService _labsService = locator(); + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); + List get finalRadiologyList => + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; + List get labOrdersResultsList => + _labsService.labOrdersResultsList; + + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); + + List get patientLabOrdersList => + filterType == FilterType.Clinic + ? _patientLabOrdersListClinic + : _patientLabOrdersListHospital; Future getProcedure({int mrn}) async { hasError = false; @@ -101,4 +131,229 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); //await getProcedure(mrn: mrn); } + + void getPatientRadOrders(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _radiologyService.getPatientRadOrders(patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else { + _radiologyService.finalRadiologyList.forEach((element) { + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (finalRadiologyListClinic.length != 0) { + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); + } + + // FinalRadiologyList list sort via project + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (finalRadiologyListHospital.length != 0) { + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); + } + }); + + setState(ViewState.Idle); + } + } + + String get radImageURL => _radiologyService.url; + + getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _radiologyService.getRadImageURL( + invoiceNo: invoiceNo, + lineItem: lineItem, + projectId: projectId, + patient: patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + List get patientLabSpecialResult => + _labsService.patientLabSpecialResult; + + List get labResultList => _labsService.labResultList; + + List labResultLists = List(); + + List get labResultListsCoustom { + return labResultLists; + } + + void getLabs(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersList(patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.patientLabOrdersList.forEach((element) { + List patientLabOrdersClinic = + _patientLabOrdersListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + _patientLabOrdersListClinic[_patientLabOrdersListClinic + .indexOf(patientLabOrdersClinic[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListClinic.add(PatientLabOrdersList( + filterName: element.clinicDescription, + patientDoctorAppointment: element)); + } + + // doctor list sort via project + List patientLabOrdersHospital = + _patientLabOrdersListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (patientLabOrdersHospital.length != 0) { + _patientLabOrdersListHospital[_patientLabOrdersListHospital + .indexOf(patientLabOrdersHospital[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListHospital.add(PatientLabOrdersList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + setState(ViewState.Idle); + } + } + + getLaboratoryResult( + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID, + patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult( + {PatientLabOrders patientLabOrder, PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder, patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.labResultList.forEach((element) { + List patientLabOrdersClinic = labResultLists + .where( + (elementClinic) => elementClinic.filterName == element.testCode) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + var value = + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .where((e) => + e.sampleCollectedOn == element.sampleCollectedOn && + e.resultValue == element.resultValue) + .toList(); + if (value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); + } else { + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); + } + }); + setState(ViewState.Idle); + } + } + + getPatientLabOrdersResults( + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, + procedure: procedure, + patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + bool isShouldClear = false; + if (_labsService.labOrdersResultsList.length == 1) { + labOrdersResultsList.forEach((element) { + if (element.resultValue.contains('/') || + element.resultValue.contains('*') || + element.resultValue.isEmpty) isShouldClear = true; + }); + } + if (isShouldClear) _labsService.labOrdersResultsList.clear(); + setState(ViewState.Idle); + } + } + + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService.hasError) { + error = _labsService.error; + } else + DrAppToastMsg.showSuccesToast(mes); + } } diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 3a194970..4370b47f 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -70,10 +70,17 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { + getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId,patient: patient); + invoiceNo: invoiceNo, + lineItem: lineItem, + projectId: projectId, + patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba76c031..ffb12ee1 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,11 +1,16 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @@ -13,7 +18,9 @@ class ECGPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -21,28 +28,97 @@ class ECGPage extends StatelessWidget { patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: 'ECG', - body: ListView.builder( - itemCount: model.patientMuseResultsModelList.length, - itemBuilder: (context, index) => InkWell( + isShowAppBar: false, + backgroundColor: Color(0xffF8F8F8), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Texts('Service',style: "caption2",color: Colors.black,), + Texts('ECG',bold: true,fontSize: 22,), + SizedBox(height: 12,), + ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { await launch( model.patientMuseResultsModelList[index].imageURL); }, child: Container( width: double.infinity, - margin: EdgeInsets.all(5), + height: 110, + margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( - border: Border.all(color: Colors.grey,width: 2) + border: Border.all(color: Colors.white,width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8) ), - child: Center( - child: Texts( - "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', + style: TextStyle( + fontWeight: FontWeight.w600, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + ], + ), + ), + ], + ), + SizedBox(height: 15,), + Align( + alignment: Alignment.topRight, + child: Icon(Icons.arrow_circle_up_rounded), + ) + ], ), ), )), + + ], + ), + ), + ), ), ); } 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/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 57b4614d..c20a48ae 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -13,11 +13,10 @@ import 'package:provider/provider.dart'; class LabResultWidget extends StatelessWidget { - final String filterName ; final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + LabResultWidget({Key key, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -29,38 +28,88 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ - Texts(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - ), + Expanded( + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - ); - }, - child: Texts( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), ), + Expanded( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), + ), + ) ], ), - Table( - border: TableBorder.symmetric( - inside: BorderSide( - width: 2.0, color: Colors.grey[300]), - ), - children: fullData(patientLabResultList,context), - ), + SizedBox(height: 7,), + Divider(color: Colors.black,thickness: 1,), + SizedBox(height: 12,), + ...List.generate(patientLabResultList.length, (index) => Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${patientLabResultList[index].testCode}\n'+ + patientLabResultList[index].description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + patientLabResultList[index].referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ) + ], + ), + Divider(), + ], + )) + // Table( + // border: TableBorder.symmetric( + // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), + // ), + // children: fullData(patientLabResultList,context), + // ), ], ), ); @@ -71,54 +120,22 @@ class LabResultWidget extends StatelessWidget { 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: Texts( - TranslationBase.of(context).description, - color: Colors.white, - ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - height: 60, ), ), Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Texts(TranslationBase.of(context).value, color: Colors.white), - ), - height: 60), + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - ), - ), - child: Center( - child: Texts(TranslationBase.of(context).range, color: Colors.white), - ), - height: 60), + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), ), ], ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 398479c4..ddbbcd45 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -3,18 +3,21 @@ import 'package:doctor_app_flutter/core/viewModel/labs_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'laboratory_result_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; final PatiantInformtion patient; - - LaboratoryResultPage({Key key, this.patientLabOrders, this.patient}); + final String patientType; + final String arrivalType; + LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -31,22 +34,35 @@ class _LaboratoryResultPageState extends State { orderNo: widget.patientLabOrders.orderNo, patient: widget.patient), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labResults, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( - body: ListView.builder( - itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () async { + body: SingleChildScrollView( + child: Column( + children: [ + PatientProfileHeaderWhitAppointment(patient: widget.patient, + patientType: widget.patientType??"0", + arrivalType: widget.arrivalType??"0", + orderNo: widget.patientLabOrders.orderNo, + appointmentDate:widget.patientLabOrders.orderDate, + doctorName: widget.patientLabOrders.doctorName, + profileUrl: widget.patientLabOrders.doctorImageURL, + invoiceNO: widget.patientLabOrders.invoiceNo, + ), + ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( + onTap: () async { + + }, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + )), - }, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, + ], ), - itemCount: model.patientLabSpecialResult.length, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 25663fa6..a2c8411d 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -34,7 +34,6 @@ class LaboratoryResultWidget extends StatefulWidget { } class _LaboratoryResultWidgetState extends State { - bool _isShowMore = true; bool _isShowMoreGeneral = true; ProjectViewModel projectViewModel; @@ -42,8 +41,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -53,33 +51,6 @@ class _LaboratoryResultWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).invoiceNo), - Texts(widget.billNo), - ], - ), - ), - ), - ], - ), - ), SizedBox( height: 12, ), @@ -106,20 +77,17 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded( - child: Texts(TranslationBase.of(context) - .generalResult)), + Expanded(child: Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: Texts(TranslationBase.of(context).generalResult,bold: true,))), Container( width: 25, height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), child: Icon( _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.white, + color: Colors.grey[800], size: 22, ), ) @@ -142,22 +110,10 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - model.labResultLists.length, - (index) => LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, - patient:widget.patient, - ), - ) - ], + child: LabResultWidget( + patientLabOrder: widget.patientLabOrder, + patientLabResultList: model.labResultList, + patient:widget.patient, ), ), ), @@ -167,63 +123,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 10, ), - InkWell( - onTap: () { - setState(() { - _isShowMore = !_isShowMore; - }); - }, - child: Container( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Row( - children: [ - Expanded( - child: Texts( - TranslationBase.of(context).specialResult)), - Container( - width: 25, - height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), - child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 22, - ), - ) - ], - ), - ), - ), - if (_isShowMore) - AnimatedContainer( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - )), - duration: Duration(milliseconds: 7000), - child: Container( - width: double.infinity, - child: Html( - data: widget.details ?? - TranslationBase.of(context).noDataAvailable, - )), - ), + ], ), ], diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index c0118e5f..bbf60821 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,10 +1,14 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -16,98 +20,129 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabsHomePage extends StatelessWidget { + String patientType; + String arrivalType; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + print(arrivalType); + return BaseView( onModelReady: (model) => model.getLabs(patient), - builder: (context, LabsViewModel model, widget) => AppScaffold( + builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labOrders, + isShowAppBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( widthFactor: 1.0, - child: Center( - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient, + patient.patientType.toString() ?? '0', patientType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Lab', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Result', + bold: true, + fontSize: 22, ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) => - model.setFilterType(value), - ), - ), - ), - ) ], ), - ...List.generate( - model.patientLabOrdersList.length, - (index) => AppExpandableNotifier( - title: model.patientLabOrdersList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, + ), + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + addSelectedLabOrder(context, model, patient); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), - ), - isInOutPatient: labOrder.isInOutPatient, - name: labOrder.doctorName, - billNo: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - subName: labOrder.projectName, - isLiveCareAppointment: - labOrder.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - labOrder.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - labOrder.orderDate), - ); - }).toList(), + SizedBox( + height: 10, + ), + Texts( + 'Apply for New Lab Order', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], + ), + ), ), ), - ) - ], - ), + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .patientLabOrdersList[index].patientLabOrdersList + .map((labOrder) { + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, + arrivalType: arrivalType, + patientType: patientType, + ), + ), + ), + doctorName: labOrder.doctorName, + invoiceNO: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + branch: labOrder.projectName, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + ); + }).toList(), + ), + ) + ], ), ), ), 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/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index dedb5bd5..8d27e704 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -15,8 +16,9 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - - RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); + final String patientType; + final String arrivalType; + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -27,54 +29,61 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, - isShowAppBar: true, + + isShowAppBar: false, baseViewModel: model, body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.center, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.start, - fontSize: 17, - ), + PatientProfileHeaderWhitAppointment(patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + orderNo: finalRadiology.orderNo.toString(), + appointmentDate:finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), ), SizedBox( height: MediaQuery.of(context).size.height * 0.2, - ) - ], - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.14, - // color: Colors.grey[100], - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Divider(), - if (model.radImageURL.isNotEmpty) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - - onTap: () { - launch(model.radImageURL); - }, - title: TranslationBase.of(context).openRad, - ), + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 5,), + Texts(TranslationBase.of(context).generalResult), + SizedBox(height: 5,), + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + color: Colors.grey, + ), + SizedBox(height: 25,), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + color: Colors.red, + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ], ), + ), ], ), - )), + ), + ), ); } } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index cce155d2..a0f44cb7 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,11 +1,15 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,53 +24,90 @@ class RadiologyHomePage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - return BaseView( + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + ProcedureViewModel model2 = ProcedureViewModel(); + return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient), builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).radiology, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), + PatientProfileHeaderNewDesign( + patient, patient.patientType.toString() ?? '0', patientType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Radiology', + style: "caption2", + color: Colors.black, + fontSize: 13, ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + Texts( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), + ), + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + addSelectedRadiologyOrder(context, model, patient); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 10, + ), + Texts( + 'Apply for Radiology Order', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], ), ), ), - ) - ], - ), + ), + ), ...List.generate( model.finalRadiologyList.length, (index) => AppExpandableNotifier( @@ -88,18 +129,12 @@ class RadiologyHomePage extends StatelessWidget { ), ), child: DoctorCard( - isInOutPatient: radiology.isInOutPatient, - isLiveCareAppointment: - radiology.isLiveCareAppointment, - name: radiology.doctorName, + doctorName: radiology.doctorName, profileUrl: radiology.doctorImageURL, - billNo: '${radiology.invoiceNo}', - subName: '${radiology.projectName}', - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - radiology.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - radiology.orderDate), + invoiceNO: '${radiology.invoiceNo}', + branch: '${radiology.projectName}', + appointmentDate: radiology.orderDate, + orderNo: radiology.orderNo.toString(), ), ); }).toList(), 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/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 0ca9b49e..a7e10f25 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -225,6 +225,7 @@ class _PrescriptionFormWidgetState extends State { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.45, + color: Color(0xffF8F8F8), child: Padding( padding: EdgeInsets.symmetric( horizontal: 12.0, vertical: 10.0), @@ -232,9 +233,26 @@ class _PrescriptionFormWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, + Row( + children: [ + AppText( + 'New Prescription Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.32, + ), + InkWell( + child: Icon( + Icons.close, + size: 23.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ], ), SizedBox( height: spaceBetweenTextFileds, @@ -248,6 +266,7 @@ class _PrescriptionFormWidgetState extends State { Container( height: MediaQuery.of(context).size.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -340,17 +359,17 @@ class _PrescriptionFormWidgetState extends State { itemID: _selectedMedication .itemId); }, - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication - .description + - ('${_selectedMedication.genericName}') - : null, - true, - ), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .description + + ('${_selectedMedication.genericName}') + : null, + false, + suffixIcon: + Icon(Icons.search)), enabled: false, ), ), @@ -361,7 +380,10 @@ class _PrescriptionFormWidgetState extends State { Container( child: Row( children: [ - AppText('Order Type'), + AppText( + 'Order Type', + fontWeight: FontWeight.w600, + ), Radio( activeColor: Color(0xFFB9382C), value: 1, @@ -445,6 +467,7 @@ class _PrescriptionFormWidgetState extends State { width: 10.0, ), Container( + color: Colors.white, width: MediaQuery.of(context) .size .width * @@ -489,7 +512,7 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - 'UNIT Type', + 'UNIT', units != null ? units['description'] : null, @@ -504,6 +527,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.itemMedicineListRoute != null ? () { @@ -553,6 +577,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.itemMedicineList != null ? () { @@ -620,6 +645,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.medicationDoseTimeList != null @@ -667,6 +693,7 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, width: double.infinity, + color: Colors.white, child: Row( children: [ Container( @@ -692,7 +719,7 @@ class _PrescriptionFormWidgetState extends State { indication != null ? indication['name'] : null, - true), + false), enabled: true, readOnly: true, ), @@ -703,6 +730,7 @@ class _PrescriptionFormWidgetState extends State { .size .width * 0.65, + color: Colors.white, child: InkWell( onTap: indicationList != null ? () { @@ -722,7 +750,7 @@ class _PrescriptionFormWidgetState extends State { indication != null ? indication['name'] : null, - true), + false), enabled: true, readOnly: true, ), @@ -734,22 +762,21 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: () => selectDate(context, widget.model), child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .date, - selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), @@ -757,6 +784,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.medicationDurationList != null @@ -825,6 +853,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -857,7 +886,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( "UOM", uom != null ? uom : null, - true), + false), //enabled: false, readOnly: true, ), @@ -866,6 +895,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -901,7 +931,7 @@ class _PrescriptionFormWidgetState extends State { ? "Box Quantity: " + model.boxQuintity.toString() : null, - true), + false), //enabled: false, readOnly: true, ), @@ -932,8 +962,10 @@ class _PrescriptionFormWidgetState extends State { alignment: WrapAlignment.center, children: [ AppButton( + color: Color(0xff359846), title: TranslationBase.of(context) .addMedication, + fontWeight: FontWeight.w600, onPressed: () { // formKey.currentState.save(); // Navigator.pop(context); @@ -1093,11 +1125,11 @@ class _PrescriptionFormWidgetState extends State { borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -1105,13 +1137,22 @@ class _PrescriptionFormWidgetState extends State { ? suffixIcon != null ? suffixIcon : Icon( - Icons.arrow_drop_down, - color: Colors.black, + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), ) : null, hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, ), ); } diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 67e957a2..031ee85f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -30,6 +30,50 @@ class PrescriptionItemsPage extends StatelessWidget { child: Container( child: Column( children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: Texts('Name ',bold: true,)), + Row( + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 45, + width: 45, + ), + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Route: Monthly'), + Texts('Does: 2 Time a day with 1 hour gap'), + SizedBox(height: 12,), + Texts('Note: 2 Time a day with 1 hour gap'), + ], + ),) + + + ], + ) + ], + ), + ), + ), + if (!prescriptions.isInOutPatient) ...List.generate( model.prescriptionReportList.length, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d595ff0b..9f7e7f2f 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,101 +22,90 @@ class PrescriptionsPage extends StatelessWidget { 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']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPrescriptions(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + isShowAppBar: false, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Prescriptions',bold: true,fontSize: 22,), + ], + ), + ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for New Prescriptions Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], ), ), ), ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), + ), + ...List.generate(model.prescriptionsList.length, (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: model.prescriptionsList[index], + patient: patient, ), ), + ), + child: DoctorCard( + doctorName: model.prescriptionsList[index].doctorName, + profileUrl: model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + appointmentDate: DateUtils.getDateTimeFromServerFormat(model.prescriptionsList[index].appointmentDate,), + orderNo: model.prescriptionsList[index].appointmentNo.toString(), + invoiceNO:model.prescriptionsList[index].appointmentNo.toString(), + ) - ], - ), - ...List.generate( - model.prescriptionsOrderList.length, - (index) => AppExpandableNotifier( - title: model - .prescriptionsOrderList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .prescriptionsOrderList[index].prescriptionsList - .map((prescriptions) { - return InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: prescriptions, - patient: patient, - ), - ), - ), - child: DoctorCard( - name: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - rat: - prescriptions.actualDoctorRate.toDouble(), - subName: prescriptions.name, - isInOutPatient: prescriptions.isInOutPatient, - isLiveCareAppointment: - prescriptions.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils - .getMonthDayYearDateFormattedAr( - DateUtils.convertStringToDate( - prescriptions - .appointmentDate)) - : DateUtils.getMonthDayYearDateFormatted( - DateUtils.convertStringToDate( - prescriptions.appointmentDate)), - ), - ); - }).toList(), - )), - ) + + )) + ], ), ), diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart new file mode 100644 index 00000000..d72ffa65 --- /dev/null +++ b/lib/screens/procedures/add_lab_orders.dart @@ -0,0 +1,319 @@ +import 'package:doctor_app_flutter/client/base_app_client.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/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_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/dr_app_toast_msg.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_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +import 'entity_list_checkbox_search_widget.dart'; +import 'entity_list_procedure_widget.dart'; + +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, + List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + + procedureValadteRequestModel.patientMRN = patient.appointmentNo; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; +} + +postProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), + ); + controls.add( + Controls(code: "ordertype", controlValue: "0"), + ); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + + postProcedureReqModel.procedures = controlsProcedure; + await model.valadteProcedure(procedureValadteRequestModel); + if (model.state == ViewState.Idle) { + if (model.valadteProcedureList[0].entityList.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getLabs(patient); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getLabs(patient); + } else if (model.state == ViewState.Idle) { + helpers.showErrorToast( + model.valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { + helpers.showErrorToast(model.error); + } +} + +void addSelectedLabOrder( + context, ProcedureViewModel model, PatiantInformtion patient) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return AddSelectedLabOrder( + model: model, + patient: patient, + ); + }); +} + +class AddSelectedLabOrder extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + + const AddSelectedLabOrder({Key key, this.model, this.patient}) + : super(key: key); + @override + _AddSelectedLabOrderState createState() => + _AddSelectedLabOrderState(patient: patient, model: model); +} + +class _AddSelectedLabOrderState extends State { + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + _AddSelectedLabOrderState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + List entityList = List(); + List entityListProcedure = List(); + + dynamic selectedCategory; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + onModelReady: (model) => model.getProcedureCategory( + categoryName: "Laboratory", categoryID: "02"), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'New Lab Order', + fontWeight: FontWeight.w900, + fontSize: 18.0, + ), + SizedBox( + height: 10.0, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addSelectedProcedures, + color: Color(0xff359846), + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } + + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }), + ), + ); + } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(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, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart new file mode 100644 index 00000000..d3ae723d --- /dev/null +++ b/lib/screens/procedures/add_radiology_order.dart @@ -0,0 +1,319 @@ +import 'package:doctor_app_flutter/client/base_app_client.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/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_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/dr_app_toast_msg.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_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +import 'entity_list_checkbox_search_widget.dart'; +import 'entity_list_procedure_widget.dart'; + +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, + List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + + procedureValadteRequestModel.patientMRN = patient.appointmentNo; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; +} + +postProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), + ); + controls.add( + Controls(code: "ordertype", controlValue: "0"), + ); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + + postProcedureReqModel.procedures = controlsProcedure; + await model.valadteProcedure(procedureValadteRequestModel); + if (model.state == ViewState.Idle) { + if (model.valadteProcedureList[0].entityList.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getPatientRadOrders(patient); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getPatientRadOrders(patient); + } else if (model.state == ViewState.Idle) { + helpers.showErrorToast( + model.valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { + helpers.showErrorToast(model.error); + } +} + +void addSelectedRadiologyOrder( + context, ProcedureViewModel model, PatiantInformtion patient) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return AddSelectedRadiologyOrder( + model: model, + patient: patient, + ); + }); +} + +class AddSelectedRadiologyOrder extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + + const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) + : super(key: key); + @override + _AddSelectedRadiologyOrderState createState() => + _AddSelectedRadiologyOrderState(patient: patient, model: model); +} + +class _AddSelectedRadiologyOrderState extends State { + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + _AddSelectedRadiologyOrderState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + List entityList = List(); + List entityListProcedure = List(); + + dynamic selectedCategory; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + onModelReady: (model) => model.getProcedureCategory( + categoryName: "Radiology", categoryID: "03"), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'New Radiology Order', + fontWeight: FontWeight.w900, + fontSize: 18.0, + ), + SizedBox( + height: 10.0, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addSelectedProcedures, + color: Color(0xff359846), + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } + + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }), + ), + ); + } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(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, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index b36f11c4..3426e4cd 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -69,7 +69,7 @@ class _EntityListCheckboxSearchWidgetState NetworkBaseView( baseViewModel: widget.model, child: Container( - height: MediaQuery.of(context).size.height * 0.45, + height: MediaQuery.of(context).size.height * 0.55, child: Center( child: Container( margin: EdgeInsets.only(top: 15), @@ -120,61 +120,70 @@ class _EntityListCheckboxSearchWidgetState historyInfo.procedureName, variant: "bodyText", bold: true, - color: Colors.black), + color: Color(0xff575757)), ), ), ], ), children: [ Container( - child: Row( - children: [ - AppText(TranslationBase.of(context) - .orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12), + child: Row( + children: [ + AppText( + TranslationBase.of(context) + .orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); - historyInfo.type = - value.toString(); - }, - ), - Text('routine'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + historyInfo.type = + value.toString(); + }, + ), + Text('routine'), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); - historyInfo.type = - value.toString(); - }, - ), - Text(TranslationBase.of(context) - .urgent), - ], + historyInfo.type = + value.toString(); + }, + ), + Text(TranslationBase.of(context) + .urgent), + ], + ), ), ), SizedBox( height: 15.0, ), - TextFields( - hintText: - TranslationBase.of(context).remarks, - //controller: remarksController, - onChanged: (value) { - historyInfo.remarks = value; - }, - minLines: 3, - maxLines: 5, + Padding( + padding: EdgeInsets.symmetric( + horizontal: 12), + child: TextFields( + hintText: TranslationBase.of(context) + .remarks, + //controller: remarksController, + onChanged: (value) { + historyInfo.remarks = value; + }, + minLines: 3, + maxLines: 5, + ), ), ], ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index a03e1348..902a5022 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -34,7 +34,7 @@ class _ProcedureScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getProcedure(mrn: 0), + onModelReady: (model) => model.getProcedure(mrn: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 9396c2f0..ef292220 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -256,9 +256,9 @@ class DateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime) { + static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return getMonth(dateTime.month) + + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + @@ -267,6 +267,24 @@ class DateUtils { return ""; } + /// get data formatted like 26 Apr 2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+ + " " + + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like 10:45 PM + /// [dateTime] convert DateTime to data formatted + static String getHour(DateTime dateTime) { + return DateFormat('hh:mm a').format(dateTime); + } + static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index da9e5f75..7ff65bb1 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -648,8 +648,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/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index f3882e23..5660fde6 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.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:hexcolor/hexcolor.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -22,224 +22,434 @@ class DoctorReplyWidget extends StatefulWidget { class _DoctorReplyWidgetState extends State { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, - decoration: BoxDecoration( - color: HexColor('#FFFFFF'), - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - SizedBox(height: 18,), - Container( - margin: EdgeInsets.only(right: 15), - child: Row( + return Container( + child: CardWithBgWidget( + bgColor: + widget.reply.status == 1 + ? Color(0xffc4aa54) + : Colors.red[700], + hasBorder: false, + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.infoStatus!=null ? widget.reply.infoStatus :'', + style: TextStyle( + color: widget.reply.status != null + ? widget.reply.status == 1 + ? Color(0xffc4aa54) + : widget.reply.status == 2 + ? Colors.green[700] + : Colors.red[700] + : Colors.grey[500], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 2.0 * SizeConfig.textMultiplier)), + ], + ), + ), + AppText( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + DateUtils.getMonth( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + Row( + children: [ + Expanded( + child: AppText( + Helpers.capitalize( widget.reply.patientName), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + ), + SizedBox( + width: 4, + ), + widget.reply.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], + ), + SizedBox( + height: 20, + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox(width: 5,), - //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[200], - ]), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), - ), - width: 80, - height: 80, - child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + widget.reply.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), - SizedBox(width: 15,), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.reply.patientName, - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), + ], + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - '${widget.reply.patientID}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).mobileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - widget.reply.mobileNumber, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), + children: [ + + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), + new TextSpan( + text: widget.reply.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - SizedBox( - height: 5, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 70, - height: 20, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(60.0)), - color: Colors.green[600] - ), - child: Center( - child: AppText( - widget.reply.requestTime, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Colors.white, - ), - ), - ), - Container( - - child: AppText( - '${Helpers.getDate(widget.reply.requestDate)}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - color: Colors.black, - ), + ), + Container( + width: MediaQuery.of(context).size.width*0.45, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), - ], + children: [ + new TextSpan( + text: TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), ), - - ], - ), + ) + ], ), - ) - ], - ), - ), - !widget.isShowMore ? SizedBox(height: 18,) : - AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Divider(color: Colors.grey), - SizedBox(height: 5,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.remarks, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), ], ), - SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).doctorResponse + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.doctorResponse, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).doctorResponse + " : ", + style: + TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: widget.reply.remarks, + style: TextStyle( + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontSize: 15)), + ], ), - ], - ),SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).infoStatus + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.infoStatus, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), - ], - ) - ], - ), + ), + ), + ],) + ], ), - ], - ), + SizedBox( + height: 20, + ), + ], ), - ), - Positioned( - right: 5, - top: 20, - child: InkWell( - onTap: (){ - setState(() { - widget.isShowMore = !widget.isShowMore; - }); - }, - child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), - ) - ], - + // onTap: onTap, + )), + ), ); + // Stack( + // children: [ + // Container( + // margin: EdgeInsets.symmetric(vertical: 10.0), + // width: double.infinity, + // decoration: BoxDecoration( + // color: HexColor('#FFFFFF'), + // borderRadius: BorderRadius.all( + // Radius.circular(20.0), + // ), + // ), + // child: Container( + // margin: EdgeInsets.all(5), + // child: Column( + // children: [ + // SizedBox(height: 18,), + // Container( + // margin: EdgeInsets.only(right: 15), + // child: Row( + // children: [ + // SizedBox(width: 5,), + // //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), + // Container( + // decoration: BoxDecoration( + // gradient: LinearGradient( + // begin: Alignment(-1, -1), + // end: Alignment(1, 1), + // colors: [ + // Colors.grey[100], + // Colors.grey[200], + // ]), + // boxShadow: [ + // BoxShadow( + // color: Color.fromRGBO(0, 0, 0, 0.08), + // offset: Offset(0.0, 5.0), + // blurRadius: 16.0) + // ], + // borderRadius: BorderRadius.all(Radius.circular(50.0)), + // ), + // width: 80, + // height: 80, + // child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + // + // SizedBox(width: 15,), + // Expanded( + // child: Container( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // widget.reply.patientName, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // SizedBox( + // height: 5, + // ), + // + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).fileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // '${widget.reply.patientID}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).mobileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // widget.reply.mobileNumber, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Container( + // width: 70, + // height: 20, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(60.0)), + // color: Colors.green[600] + // ), + // child: Center( + // child: AppText( + // widget.reply.requestTime, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // color: Colors.white, + // ), + // ), + // ), + // Container( + // + // child: AppText( + // '${Helpers.getDate(widget.reply.requestDate)}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // color: Colors.black, + // ), + // ), + // ], + // ), + // + // ], + // ), + // ), + // ) + // + // ], + // ), + // ), + // + // !widget.isShowMore ? SizedBox(height: 18,) : + // AnimatedContainer( + // duration: Duration(milliseconds: 200), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Divider(color: Colors.grey), + // SizedBox(height: 5,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).remarks + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.remarks, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).doctorResponse + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.doctorResponse, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ),SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).infoStatus + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.infoStatus, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ) + // ], + // ), + // ), + // + // ], + // ), + // ), + // ), + // Positioned( + // right: 5, + // top: 20, + // child: InkWell( + // onTap: (){ + // setState(() { + // widget.isShowMore = !widget.isShowMore; + // }); + // }, + // child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + // ) + // ], + // + // ); } } 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/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart new file mode 100644 index 00000000..61de70e1 --- /dev/null +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -0,0 +1,462 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +import 'large_avatar.dart'; + +class PatientProfileHeaderWhitAppointment extends StatelessWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + + PatientProfileHeaderWhitAppointment( + {this.patient, + this.patientType, + this.arrivalType, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + //height: 300, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + 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), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border( + bottom:BorderSide(color: Colors.grey[400],width: 2.5), + left: BorderSide(color: Colors.grey[400],width: 2.5), + ) + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${TranslationBase.of(context).dr}.$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (orderNo != null) + Row( + children: [ + Texts( + 'Order No:', + color: Colors.grey[800], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[800], + ), + Texts( + invoiceNO, + ) + ], + ), + Row( + children: [ + Texts( + 'Result Date:', + color: Colors.grey[800], + ), + Expanded( + child: Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), + ) + ], + ) + ]), + ), + ), + + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index 4f2c4271..59929075 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -216,7 +216,7 @@ class _TextsState extends State { fontSize:widget.fontSize?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, - fontWeight: _getFontWeight(), + fontWeight: widget.fontWeight ?? _getFontWeight(), decoration: widget.textDecoration //TextDecoration.lineThrough )), 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/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart index 984d4350..60a3528d 100644 --- a/lib/widgets/shared/app_button.dart +++ b/lib/widgets/shared/app_button.dart @@ -2,18 +2,22 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class Button extends StatefulWidget { + final String title; + final Widget icon; + final VoidCallback onTap; + final bool loading; + final Color color; + Button({ Key key, - this.title: "", + this.title = "", this.icon, this.onTap, - this.loading: false, + this.loading= false, + this.color, }) : super(key: key); - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; + @override _ButtonState createState() => _ButtonState(); @@ -86,7 +90,8 @@ class _ButtonState extends State