diff --git a/assets/images/booked.png b/assets/images/booked.png new file mode 100644 index 00000000..e07b7d35 Binary files /dev/null and b/assets/images/booked.png differ diff --git a/assets/images/edit.png b/assets/images/edit.png new file mode 100644 index 00000000..73a48877 Binary files /dev/null and b/assets/images/edit.png differ diff --git a/assets/images/livecare.png b/assets/images/livecare.png new file mode 100644 index 00000000..b1fd3f06 Binary files /dev/null and b/assets/images/livecare.png differ diff --git a/assets/images/walkin.png b/assets/images/walkin.png new file mode 100644 index 00000000..81f112f5 Binary files /dev/null and b/assets/images/walkin.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..98393a63 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,7 +4,7 @@ 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://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"; @@ -234,6 +234,7 @@ const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; + ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTIONS_ALL_ORDERS = @@ -246,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; - var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f30a86e5..662111d0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -277,7 +277,7 @@ const Map> localizedValues = { "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."}, - "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}, + "sick-leave-days": {"en": "Leave Days: ", "ar": " :أيام الإجازة"}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'date': {'en': 'Date', 'ar': 'التاريخ'}, @@ -302,8 +302,8 @@ const Map> localizedValues = { "ar": "يرجى ادخال هذا الحقل" }, 'no-sickleve-applied': { - 'en': "No sick leave applied", - 'ar': 'لم تطبق إجازة مرضية' + 'en': "No sick leave available, apply Now", + 'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن' }, 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, @@ -394,7 +394,7 @@ const Map> localizedValues = { 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, 'to': {'en': "To", 'ar': 'إلى'}, - 'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'}, + 'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'}, 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, 'pleaseEnterDate': { 'en': 'Please enter leave start date', @@ -785,7 +785,30 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + "searchWithOther": { + "en": "Search With Other Criteria", + "ar": "البحث بمعايير أخرى" + }, + "hideOtherCriteria": { + "en": "Hide Other Criteria", + "ar": "إخفاء المعايير الأخرى" + }, + "applyForReschedule": { + "en": "Apply for leave or reschedule", + "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" + }, + "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, + "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, - - + "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, + "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, + "sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"}, + "addSickLeaveRequest": { + "en": "Add Sick Leave Request", + "ar": "إضافة طلب إجازة مرضية" + }, + "extendSickLeaveRequest": { + "en": "Extend Sick Leave Request", + "ar": "تمديد طلب الإجازة المرضية" + }, }; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index e93bab49..77fddfe5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -3,7 +3,9 @@ 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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -19,6 +21,7 @@ class MedicalFileDetails extends StatefulWidget { String gender; int encounterNumber; int pp; + PatiantInformtion patient; MedicalFileDetails( {this.age, @@ -26,16 +29,19 @@ class MedicalFileDetails extends StatefulWidget { this.lastName, this.gender, this.encounterNumber, - this.pp}); + this.pp, + this.patient}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, - age: age, - lastName: lastName, - gender: gender, - encounterNumber: encounterNumber, - pp: pp); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp, + patient: patient, + ); } class _MedicalFileDetailsState extends State { @@ -45,6 +51,7 @@ class _MedicalFileDetailsState extends State { String lastName; String gender; int pp; + PatiantInformtion patient; _MedicalFileDetailsState( {this.age, @@ -52,7 +59,8 @@ class _MedicalFileDetailsState extends State { this.lastName, this.gender, this.encounterNumber, - this.pp}); + this.pp, + this.patient}); bool isPhysicalExam = false; bool isProcedureExpand = false; bool isHistoryExpand = false; @@ -72,60 +80,10 @@ class _MedicalFileDetailsState extends State { child: SingleChildScrollView( child: Center( child: Container( - color: Colors.white, child: Column( children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - gender == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstName + ' ' + lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).age2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - age, - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), + PatientProfileHeaderNewDesign(patient, + patient.patientType.toString(), patient.arrivedOn), model.medicalFileList.length != 0 && model .medicalFileList[0] @@ -140,134 +98,159 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).visitDate + - ": ", - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString()), - SizedBox(width: 35.0), - // AppText( - // 'Appt Date : ', - // fontWeight: FontWeight.w700, - // ), - // AppText( - // '23/12/2020', - // ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).doctorName + - ": ".toUpperCase(), - fontWeight: FontWeight.w700, + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, - ), - ), - ], - ), - if (model.medicalFileList.length != 0) - Row( + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Column( children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, + Row( + children: [ + if (model.medicalFileList.length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ), + ], ), - if (model.medicalFileList.length != 0 && - model + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinic + + ": ", + ), + if (model.medicalFileList + .length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .clinicName, + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .episode + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model .medicalFileList[0] .entityList[0] .timelines[encounterNumber] .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .clinicName, - ), + .consulations[0] + .episodeID + .toString(), + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .visitDate + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .appointmentDate + .toString(), + fontWeight: FontWeight.w700, + ), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), + ], + ), ], ), - Row( - children: [ - AppText( - TranslationBase.of(context).episode + - ": ", - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .episodeID - .toString(), - ), - ], - ), - SizedBox(height: 15.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, ), + SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && model @@ -278,96 +261,116 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .historyOfPresentIllness + .toUpperCase(), + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = + !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = - !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstCheifComplaint + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstCheifComplaint[ - index] - .hOPI - .trim(), - ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstCheifComplaint[ + index] + .hOPI + .trim(), + ), + ), + SizedBox( + width: 35.0), + ], ), - SizedBox(width: 35.0), ], ), - ], - ), - ), - ); - }), - isExpand: isHistoryExpand, + ), + ); + }), + isExpand: isHistoryExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + SizedBox( height: 30, ), @@ -380,85 +383,175 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .assessment - .toUpperCase(), - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .assessment + .toUpperCase(), + variant: + isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - AppText( - 'ICD', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'ICD', + fontWeight: + FontWeight + .w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .iCD10 + .trim(), + ), + SizedBox( + width: 35.0), + AppText( + 'Condition: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .condition + .trim(), + ), + ], ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .iCD10 - .trim(), + Row( + children: [ + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .description, + fontWeight: + FontWeight + .w700, + ) + ], ), - SizedBox(width: 35.0), - AppText( - 'Condition: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'Type: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstAssessments[ + index] + .type), + ], + ), + SizedBox( + height: 15.0, ), AppText( model @@ -471,87 +564,34 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstAssessments[ index] - .condition + .remarks .trim(), ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .description, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Type: ', - fontWeight: - FontWeight.w700, + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .type), ], ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .remarks - .trim(), - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isAssessmentExpand, + ), + ); + }), + isExpand: isAssessmentExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), SizedBox( height: 30, ), @@ -564,90 +604,181 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .test + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - AppText( - 'Procedure ID: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + Column( + children: [ + AppText( + 'Procedure ID: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procedureId + .trim(), + ), + ], + ), + SizedBox( + width: 35.0), + Column( + children: [ + AppText( + 'Order Date: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + Helpers.getDateFormatted( + DateTime + .parse( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .orderDate + .trim(), + )), + fontSize: + 13.5, + ), + ], + ), + ], ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[ - index] - .procedureId - .trim(), + SizedBox( + height: 20.0, ), - SizedBox(width: 35.0), - AppText( - 'Order Date: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procName, + fontWeight: + FontWeight + .w700, + ), + ) + ], ), - Expanded( - child: AppText( - model + Row( + children: [ + AppText( + 'CPT Code : ', + fontWeight: + FontWeight + .w700, + ), + AppText(model .medicalFileList[ 0] .entityList[0] @@ -658,79 +789,38 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstProcedure[ index] - .orderDate - .trim(), - ), + .patientID + .toString()), + ], ), - ], - ), - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstProcedure[ - index] - .procName, - fontWeight: - FontWeight.w700, - ), - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - fontWeight: - FontWeight.w700, + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .patientID - .toString()), ], ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isProcedureExpand, + ), + ); + }), + isExpand: isProcedureExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), SizedBox( height: 30, ), @@ -743,79 +833,144 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .physicalSystemExamination + .toUpperCase(), + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = + !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = - !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - children: [ - Row( + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( children: [ - AppText( - 'Exam Type: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'Exam Type: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstPhysicalExam[ + index] + .examDesc), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .examDesc, + fontWeight: + FontWeight + .w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstPhysicalExam[ + index] + .abnormal), + ], + ), + SizedBox( + height: 15.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .examDesc), - ], - ), - Row( - children: [ AppText( model .medicalFileList[ @@ -827,69 +982,33 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .examDesc, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: - FontWeight.w700, + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .abnormal), ], ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .remarks, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isPhysicalExam, + ), + ); + }), + isExpand: isPhysicalExam, + ), + ), ), SizedBox( height: 30, ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), ], ), ), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 79f7416f..5f53c2b9 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -1,14 +1,21 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class MedicalFilePage extends StatefulWidget { @override @@ -21,6 +28,9 @@ class _MedicalFilePageState extends State { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: @@ -32,18 +42,45 @@ class _MedicalFilePageState extends State { baseViewModel: model, child: SingleChildScrollView( child: Container( - color: Colors.white, child: Column( // mainAxisAlignment: model.medicalFileList.length != 0 && // model.medicalFileList != null // ? MainAxisAlignment.start // : MainAxisAlignment.center, children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, + PatientProfileHeaderNewDesign( + patient, patient.patientType.toString(), arrivalType), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), + child: Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Medical', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Report', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + ), ), (model.medicalFileList != null && model.medicalFileList.length != 0) @@ -60,66 +97,155 @@ class _MedicalFilePageState extends State { horizontal: 12.0, vertical: 8.0), child: InkWell( child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), child: Column( children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + fontWeight: FontWeight.w700, + fontSize: 17.0, + fontFamily: 'Poppins', + ) + ], ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .projectName), + Row( + children: [ + AppText( + Helpers.convertStringToDate(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .day + .toString() + + "/", + ), + AppText( + Helpers.convertStringToDate(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .month + .toString() + + "/", + ), + AppText( + Helpers.convertStringToDate( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .year + .toString(), + ), + ], + ) ], ), Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context) - .doctorName - .toUpperCase() + - ": ", - fontWeight: FontWeight.w700, - ), - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - fontWeight: FontWeight.w700, + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all( + Radius.circular(30)), + child: Image.network( + 'https://previews.123rf.com/images/yupiramos/yupiramos1705/yupiramos170524444/78443570-a-female-doctor-avatar-character-vector-illustration-design.jpg', + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + ], ), ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinic + + ": ", + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName, + fontWeight: FontWeight.w600, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .branch + + ": ", + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName, + fontWeight: FontWeight.w600, + ), + ], + ), + ], + ), ], ), Row( + mainAxisAlignment: + MainAxisAlignment.end, children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName, - ), + Column( + children: [ + Icon( + Icons.remove_red_eye, + size: 30.0, + ) + ], + ) ], ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) ], ), ), @@ -135,16 +261,24 @@ class _MedicalFilePageState extends State { gender: patient.genderDescription, encounterNumber: index, pp: patient.patientId, + patient: patient, )), ); }, ), ); }) - : Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', - ), + : Column( + children: [ + Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', + ), + ), + SizedBox( + height: 400, + ) + ], ) ], ), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 45d457cd..0ae5452b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -210,11 +210,14 @@ class _PatientSearchScreenState extends State { InkWell( child: this.isView == false ? AppText( - 'Search With Other Critearia', + TranslationBase.of(context) + .searchWithOther, color: Colors.red, fontWeight: FontWeight.bold, ) - : AppText('Hide Other Criteria', + : AppText( + TranslationBase.of(context) + .hideOtherCriteria, color: Colors.red, fontWeight: FontWeight.bold), onTap: () { 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/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart new file mode 100644 index 00000000..ada0641b --- /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.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } 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..c523c2b0 --- /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.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } 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/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 0dab0226..aaafa380 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -7,6 +7,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -18,287 +20,257 @@ class AddRescheduleLeavScreen extends StatelessWidget { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => - {model.getRescheduleLeave(), model.getCoveringDoctors()}, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: model.getReschduleLeave.length > 0 - ? SingleChildScrollView( - child: Column( - children: [ - SizedBox(height: 50), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 20), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - child: Row( - children: [ - Expanded( - flex: 4, - child: AppText( - TranslationBase.of(context) - .requestLeave), - ), - IconButton( - icon: Icon( - Icons.add_circle, - color: Colors.red, - )) - ], - ) - // AppTextFormField( - // hintText: - // TranslationBase.of(context).requestLeave, - // borderColor: Colors.white, - // prefix: IconButton( - // icon: Icon( - // Icons.add_circle, - // color: Colors.red, - // )), - // // textInputType: TextInputType.text, - // readOnly: true, - // onTap: () { - // openLeave( - // context, - // false, - // ); - // return false; - // }, - // inputFormatter: ONLY_LETTERS, - // ) - , - onTap: () { - openLeave( - context, - false, - ); - }, - ) - ], - ), - ), - Column( - children: model.getReschduleLeave.map( - (GetRescheduleLeavesResponse item) { - return CardWithBgWidgetNew( - widget: Column( - children: [ - Container( - padding: - EdgeInsets.only(left: 10, right: 10), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: - EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase - .of(context) - .approved - : item.status == 2 - ? TranslationBase.of( - context) - .pending - : TranslationBase.of( - context) - .rejected, - fontWeight: - FontWeight.bold, - color: Colors.white, - ), - color: item.status == 1 - ? Colors.green - : item.status == 2 - ? Colors - .yellow[800] - : Colors.red[800], - ), - SizedBox( - height: 5, - ), - Container( - child: AppText( - item.requisitionType == 1 + onModelReady: (model) => + {model.getRescheduleLeave(), model.getCoveringDoctors()}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: SingleChildScrollView( + child: Column(children: [ + Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.all(10), + padding: + EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), + decoration: BoxDecoration( + color: HexColor('#EAEAEA'), + borderRadius: BorderRadius.all(Radius.circular(20))), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(10)), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openLeave( + context, + false, + ); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).applyForReschedule, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 18, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + ), + ), + Column( + children: model.getReschduleLeave + .map((GetRescheduleLeavesResponse item) { + return RoundedContainer( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + width: 5.0, + ))), + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: EdgeInsets.all(3), + margin: + EdgeInsets.only(top: 10), + child: AppText( + item.status == 1 + ? TranslationBase.of( + context) + .approved + : item.status == 2 ? TranslationBase.of( context) - .offTime + .pending : TranslationBase.of( - context) - .holiday + - ' ', - fontWeight: - FontWeight.bold, - )), - Row( - children: [ - Flexible( - child: Text( - DateUtils.convertStringToDateFormat( - item - .dateTimeFrom, - 'yyyy-MM-dd HH:mm') + - ' ' + - TranslationBase.of( - context) - .to + - ' ' + - DateUtils.convertStringToDateFormat( - item.dateTimeTo, - 'yyyy-MM-dd HH:mm') - // overflow: - // TextOverflow.ellipsis, - )) - ], - ), - SizedBox( - height: 5, - ), - AppText( - TranslationBase.of( - context) - .coveringDoctor, - fontWeight: - FontWeight.bold, - ), - model.coveringDoctors - .length > - 0 - ? Row(children: [ - AppText(getDoctor( - model - .coveringDoctors, - item.coveringDoctorId)) - ]) - : SizedBox(), - AppText( - TranslationBase.of( - context) - .reasons, - fontWeight: - FontWeight.bold, - ), - model.allReasons.length > 0 - ? Row(children: [ - AppText(getReasons( - model - .allReasons, - item.reasonId)) - ]) - : SizedBox(), - ], - ), - SizedBox( - width: 10, + context) + .rejected, + fontWeight: FontWeight.bold, + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + fontSize: 14, ), - ], - ), - ), - (item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.edit_outlined, - size: 30, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - openLeave(context, true, - extendedData: item) - }, + ), + Padding( + padding: + EdgeInsets.only(top: 10), + child: AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, )) - : SizedBox(), - ], - )), - SizedBox( - height: 10, - ), - Divider( - height: 1, - ), - ], - )); - }).toList(), - ) - ], - ), - ) - : new Builder(builder: (context) { - return Center( - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all( - color: HexColor('#B8382C'), width: 4), - borderRadius: - BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context).noReScheduleLeave, - fontWeight: FontWeight.bold, + ]), + SizedBox( + height: 5, + ), + Container( + child: AppText( + item.requisitionType == 1 + ? TranslationBase.of(context) + .offTime + : TranslationBase.of(context) + .holiday + + ' ', + fontWeight: FontWeight.bold, + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText(TranslationBase.of(context) + .startDate), + AppText( + DateUtils.convertStringToDateFormat( + item.dateTimeFrom, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + + // overflow: + // TextOverflow.ellipsis, + ]), + + // overflow: + // TextOverflow.ellipsis, + + SizedBox( + height: 5, + ), + Row( + children: [ + AppText(TranslationBase.of(context) + .endDate), + AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + ], + ), + + SizedBox( + height: 5, + ), + model.coveringDoctors.length > 0 + ? Row(children: [ + AppText( + TranslationBase.of(context) + .coveringDoctor, + ), + AppText( + getDoctor( + model.coveringDoctors, + item.coveringDoctorId), + fontWeight: FontWeight.bold, + ) + ]) + : SizedBox(), + // AppText( + // TranslationBase.of(context) + // .reasons, + // fontWeight: FontWeight.bold, + // ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 5), + child: AppText(getReasons( + model.allReasons, + item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => { + openLeave(context, true, + extendedData: item) + }, + ) + : SizedBox(), + ]), + ], + ), + SizedBox( + width: 10, + ), + ], + ), ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - ), - )); - }), - )); + ], + )), + ], + ), + ); + }).toList(), + ) + ]))), + ); } openLeave(BuildContext context, isExtend, {extendedData}) { - showModalBottomSheet( - context: context, - builder: (context) { - return new Container( - child: RescheduleLeaveScreen( - isExtend, - extendedData, - )); - }); + // showModalBottomSheet( + // context: context, + // builder: (context) { + // return new Container( + // child: RescheduleLeaveScreen( + // isExtend, + // extendedData, + // )); + // }); + + Navigator.push( + context, + FadePage( + page: RescheduleLeaveScreen( + isExtend, + extendedData, + ), + ), + ); } getDoctor(model, doctorId) { diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 7b034431..7af6b72c 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -114,12 +114,13 @@ class _RescheduleLeaveScreen extends State { model2.getCoveringDoctors() }, builder: (_, model2, w) => GestureDetector( - onTap: (){ - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( baseViewModel: model2, - isShowAppBar: false, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -127,119 +128,127 @@ class _RescheduleLeaveScreen extends State { widthFactor: 0.9, child: ListView( children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - dropdownColor: - Colors.grey, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .grey[500], - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), - ), - ], - ) - ], - ), - )), + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // width: double.infinity, + // child: Padding( + // padding: EdgeInsets.only( + // top: SizeConfig.widthMultiplier * 0.9, + // bottom: + // SizeConfig.widthMultiplier * 0.9, + // right: SizeConfig.widthMultiplier * 3, + // left: SizeConfig.widthMultiplier * 3), + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // // add Expanded to have your dropdown button fill remaining space + // child: + // DropdownButtonHideUnderline( + // child: new IgnorePointer( + // ignoring: true, + // child: DropdownButton( + // focusColor: + // Colors.grey, + // isExpanded: true, + // dropdownColor: + // Colors.grey, + // value: getClinicName( + // model) ?? + // "", + // iconSize: 0, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext + // context) { + // return model + // .getClinicNameList() + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize + // .max, + // children: < + // Widget>[ + // AppText( + // item, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors + // .grey[ + // 500], + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: + // (newValue) => + // {}, + // items: model + // .getClinicNameList() + // .map((item) { + // return DropdownMenuItem( + // value: item + // .toString(), + // child: Text( + // item, + // textAlign: + // TextAlign + // .end, + // ), + // ); + // }).toList(), + // ))), + // ), + // ], + // ) + // ], + // ), + // )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - new IgnorePointer( - ignoring: true, - child: AppTextFormField( - readOnly: true, - hintText: profile != null - ? profile['DoctorName'] - : "", - borderColor: Colors.white, - onSaved: (value) {}, - inputFormatter: ONLY_NUMBERS)) - ], - ), - ), + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // padding: EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // new IgnorePointer( + // ignoring: true, + // child: AppTextFormField( + // readOnly: true, + // hintText: profile != null + // ? profile['DoctorName'] + // : "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS)) + // ], + // ), + // ), Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -247,7 +256,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -262,7 +272,8 @@ class _RescheduleLeaveScreen extends State { // add Expanded to have your dropdown button fill remaining space child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButton( // focusColor: Colors.grey, isExpanded: true, value: offTime == null @@ -272,12 +283,14 @@ class _RescheduleLeaveScreen extends State { iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext context) { + (BuildContext + context) { return model2.allOffTime .map((item) { return Row( mainAxisSize: - MainAxisSize.max, + MainAxisSize + .max, children: [ AppText( item[ @@ -297,12 +310,22 @@ class _RescheduleLeaveScreen extends State { offTime = newValue; }), if (offTime == '1') - {model2.getReasons(18)} + { + model2 + .getReasons(18) + } else if (offTime == '2') - {model2.getReasons(19)} - else if (offTime == '3' || + { + model2 + .getReasons(19) + } + else if (offTime == + '3' || offTime == '5') - {model2.getReasons(102)} + { + model2 + .getReasons(102) + } }, items: model2.allOffTime .map((item) { @@ -335,20 +358,21 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of(context) - .fromDate, + hintText: TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon( - Icons.calendar_today)), + icon: Icon(Icons + .calendar_today)), textInputType: TextInputType.number, controller: _toDateController, @@ -372,11 +396,12 @@ class _RescheduleLeaveScreen extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(6.0)), + Radius.circular( + 6.0)), border: Border.all( width: 1.0, - color: - HexColor("#CCCCCC"))), + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: @@ -387,8 +412,8 @@ class _RescheduleLeaveScreen extends State { TranslationBase.of( context) .fromTime, - type: - DateTimePickerType.time, + type: DateTimePickerType + .time, controller: _controller4, onChanged: (val) => fromTime = val, @@ -411,11 +436,12 @@ class _RescheduleLeaveScreen extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(6.0)), + Radius.circular( + 6.0)), border: Border.all( width: 1.0, - color: - HexColor("#CCCCCC"))), + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: @@ -426,8 +452,8 @@ class _RescheduleLeaveScreen extends State { TranslationBase.of( context) .toTime, - type: - DateTimePickerType.time, + type: DateTimePickerType + .time, controller: _controller5, onChanged: (val) => toTime = val, @@ -457,23 +483,26 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: + TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons .calendar_today)), textInputType: TextInputType.number, - controller: _toDateController, + controller: + _toDateController, onTap: () { _presentDatePicker( 'fromDate'); @@ -493,21 +522,22 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase - .of(context) - .toDate, + hintText: + TranslationBase + .of(context) + .toDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon( - Icons - .calendar_today)), + icon: Icon(Icons + .calendar_today)), textInputType: TextInputType.number, controller: @@ -529,8 +559,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -538,7 +568,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -553,7 +584,8 @@ class _RescheduleLeaveScreen extends State { // add Expanded to have your dropdown button fill remaining space child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButton( focusColor: Colors.grey, isExpanded: true, value: reason == null @@ -564,12 +596,14 @@ class _RescheduleLeaveScreen extends State { iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext context) { + (BuildContext + context) { return model2.allReasons .map((item) { return Row( mainAxisSize: - MainAxisSize.max, + MainAxisSize + .max, children: [ AppText( projectsProvider @@ -603,7 +637,8 @@ class _RescheduleLeaveScreen extends State { projectsProvider .isArabic ? item['nameAr'] - : item['nameEn'], + : item[ + 'nameEn'], textAlign: TextAlign.end, ), @@ -621,8 +656,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -630,7 +665,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -649,33 +685,36 @@ class _RescheduleLeaveScreen extends State { dropdownSearchDecoration: InputDecoration( contentPadding: - EdgeInsets.all( - 0), - border: InputBorder - .none), + EdgeInsets + .all(0), + border: + InputBorder + .none), //maxHeight: 300, items: model2 .coveringDoctors .map((item) { return projectsProvider .isArabic - ? item['doctorNameN'] - : item['doctorName']; + ? item[ + 'doctorNameN'] + : item[ + 'doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { model2.coveringDoctors - .forEach((newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal[ - 'DoctorID'] - } - }); + .forEach( + (newVal) => { + if (newVal['doctorName'] == + item || + newVal['doctorName'] == + item) + { + doctorID = + newVal['DoctorID'] + } + }); }, selectedItem: getSelectedDoctor( @@ -693,8 +732,10 @@ class _RescheduleLeaveScreen extends State { ), popupTitle: Container( height: 50, - decoration: BoxDecoration( - color: Theme.of(context) + decoration: + BoxDecoration( + color: Theme.of( + context) .primaryColorDark, borderRadius: BorderRadius.only( @@ -712,8 +753,10 @@ class _RescheduleLeaveScreen extends State { style: TextStyle( fontSize: 24, fontWeight: - FontWeight.bold, - color: Colors.white, + FontWeight + .bold, + color: + Colors.white, ), ), ), @@ -723,9 +766,11 @@ class _RescheduleLeaveScreen extends State { borderRadius: BorderRadius.only( topLeft: - Radius.circular(24), + Radius.circular( + 24), topRight: - Radius.circular(24), + Radius.circular( + 24), ), ), ), @@ -797,6 +842,7 @@ class _RescheduleLeaveScreen extends State { ], ), )), + SizedBox(height: SizeConfig.screenHeight * .3), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), @@ -805,8 +851,11 @@ class _RescheduleLeaveScreen extends State { children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context).update - : TranslationBase.of(context).add, + ? TranslationBase.of(context) + .updateReschedule + : TranslationBase.of(context) + .addReschedule, + color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { if (widget.isUpdate == true) { @@ -837,7 +886,7 @@ class _RescheduleLeaveScreen extends State { ), ), ), - ))); + ))); } getProfile() async { diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index ad74b760..1297a673 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -6,12 +6,16 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -25,19 +29,94 @@ class AddSickLeavScreen extends StatelessWidget { onModelReady: (model) => model.getSickLeave(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).sickleave, body: SingleChildScrollView( child: Column(children: [ - PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign( + patient, routeArgs['patientType'], routeArgs['arrivalType']), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).sickLeave, + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ], + )), + Container( + width: SizeConfig.screenWidth, + margin: EdgeInsets.only( + left: 20, right: 20, top: 10, bottom: 10), + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: HexColor('#EAEAEA')), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(10)), + padding: EdgeInsets.all(3), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), + )), + Padding( + child: AppText( + TranslationBase.of(context).noSickLeaveApplied, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 16, + textAlign: TextAlign.center, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + )), + ], + ), model.getAllSIckLeave.length > 0 ? Column( children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { - return CardWithBgWidgetNew( - widget: Column( + return RoundedContainer( + child: Column( children: [ Container( - padding: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -66,42 +145,77 @@ class AddSickLeavScreen extends StatelessWidget { context) .all, fontWeight: FontWeight.bold, - color: Colors.white, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, ), - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + ), + Row( + children: [ + AppText(TranslationBase.of( + context) + .daysSickleave), + AppText( + item.noOfDays.toString(), + fontWeight: FontWeight.bold, + ), + ], ), Row( children: [ AppText( TranslationBase.of(context) - .leaveStartDate + + .startDate + ' ', - fontWeight: FontWeight.bold, ), Flexible( - child: Text( - item.startDate, - overflow: - TextOverflow.ellipsis, + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, )) ], ), - AppText( - item.noOfDays.toString() + - ' ' + - TranslationBase.of(context) - .daysSickleave, - fontWeight: FontWeight.bold, - ), - Row(children: [ - AppText( - item.remarks ?? "", - ) - ]), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1 || + item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == + 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .sickleaveonhold) + } + else + { + openSickLeave( + context, + true, + extendedData: + item) + } + }, + ) + : SizedBox() + ]), ], ), SizedBox( @@ -110,106 +224,104 @@ class AddSickLeavScreen extends StatelessWidget { ], ), ), - (item.status == 1 || item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.open_in_full, - size: 25, - color: item.status == 1 - ? Colors.grey[400] - : Colors.black, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .sickleaveonhold) - } - else - { - openSickLeave(context, true, - extendedData: item) - } - }, - )) - : SizedBox(), ], )), - SizedBox( - height: 20, - ), - Divider( - height: 1, - ), ], )); }).toList(), ) : new Builder(builder: (context) { - return Container( - height: MediaQuery.of(context).size.height * .7, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all( - color: HexColor('#B8382C'), width: 4), - borderRadius: - BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context) - .noSickLeaveApplied, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - )); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).sickLeave, + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ], + )), + Container( + width: SizeConfig.screenWidth, + margin: EdgeInsets.only( + left: 20, right: 20, top: 20, bottom: 20), + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: HexColor('#EAEAEA')), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: + BorderRadius.circular(10)), + padding: EdgeInsets.all(3), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), + )), + Padding( + child: AppText( + TranslationBase.of(context) + .noSickLeaveApplied, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 16, + textAlign: TextAlign.center, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + )), + SizedBox( + height: SizeConfig.screenHeight * .6, + ) + ], + ); }), ])))); } openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) { - showModalBottomSheet( - context: context, - builder: (context) { - return new Container( - child: SickLeaveScreen( - appointmentNo: isExtend == true - ? extendedData.appointmentNo - : patient.appointmentNo, //extendedData.appointmentNo, - patientMRN: isExtend == true - ? extendedData.patientMRN - : patient.patientMRN, - isExtended: isExtend, - extendedData: extendedData, - patient: patient)); - }); + // showModalBottomSheet( + // context: context, + // builder: (context) { + // return new Container( + // child: + Navigator.push( + context, + FadePage( + page: SickLeaveScreen( + appointmentNo: isExtend == true + ? extendedData.appointmentNo + : patient.appointmentNo, //extendedData.appointmentNo, + patientMRN: isExtend == true + ? extendedData.patientMRN + : patient.patientMRN, + isExtended: isExtend, + extendedData: extendedData, + patient: patient))); } } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index c3bd3178..52ec7094 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -6,12 +6,15 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -23,22 +26,34 @@ class ShowSickLeaveScreen extends StatelessWidget { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), + onModelReady: (model) => + model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).sickleave, body: SingleChildScrollView( child: Column( children: [ - PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign( + patient, routeArgs['patientType'], routeArgs['arrivalType']), Column( children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { - return CardWithBgWidgetNew( - widget: Column( + return RoundedContainer( + child: Column( children: [ Container( - padding: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -66,41 +81,74 @@ class ShowSickLeaveScreen extends StatelessWidget { context) .all, fontWeight: FontWeight.bold, - color: Colors.white, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, ), - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + ), + Row( + children: [ + AppText(TranslationBase.of(context) + .daysSickleave), + AppText( + item.noOfDays.toString(), + fontWeight: FontWeight.bold, + ), + ], ), Row( children: [ AppText( TranslationBase.of(context) - .leaveStartDate + + .startDate + ' ', - fontWeight: FontWeight.bold, ), Flexible( - child: Text( - item.startDate, - overflow: TextOverflow.ellipsis, + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, )) ], ), - AppText( - item.noOfDays.toString() + - ' ' + - TranslationBase.of(context) - .daysSickleave, - fontWeight: FontWeight.bold, - ), - Row(children: [ - AppText( - item.remarks ?? "", - ) - ]), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1 || + item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), ], ), SizedBox( @@ -109,15 +157,8 @@ class ShowSickLeaveScreen extends StatelessWidget { ], ), ), - ], )), - SizedBox( - height: 20, - ), - Divider( - height: 1, - ), ], )); }).toList(), @@ -128,6 +169,4 @@ class ShowSickLeaveScreen extends StatelessWidget { ), ); } - - } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index f8433fb0..12f157c2 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -89,7 +89,10 @@ class _SickLeaveScreenState extends State { }, child: AppScaffold( baseViewModel: model2, - isShowAppBar: false, + appBarTitle: widget.isExtended == true + ? TranslationBase.of(context).extendSickLeave + : TranslationBase.of(context).addSickLeave, + isShowAppBar: true, body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -97,29 +100,40 @@ class _SickLeaveScreenState extends State { widthFactor: 0.9, child: ListView( children: [ - Padding( - child: AppText( - widget.isExtended == true - ? TranslationBase.of(context) - .extendSickLeave - : TranslationBase.of(context) - .addSickLeave, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10)), + // Padding( + // child: AppText( + // widget.isExtended == true + // ? TranslationBase.of(context) + // .extendSickLeave + // : TranslationBase.of(context) + // .addSickLeave, + // fontWeight: FontWeight.bold, + // ), + // padding: EdgeInsets.all(10)), Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .sickLeave + + ' ' + + TranslationBase.of(context) + .days)), AppTextFormField( borderColor: Colors.white, onChanged: (value) { @@ -132,8 +146,7 @@ class _SickLeaveScreenState extends State { hintText: widget.extendedData != null ? widget.extendedData.noOfDays .toString() - : TranslationBase.of(context) - .sickLeaveDays, + : '', // validator: (value) { // return TextValidator().validateName(value); // }, @@ -146,25 +159,28 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).sickLeaveDate, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .sickLeaveDate, + )), AppTextFormField( hintText: widget.extendedData != null ? widget.extendedData.startDate - : TranslationBase.of(context) - .sickLeaveDate, + : '', borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons.calendar_today)), @@ -188,11 +204,12 @@ class _SickLeaveScreenState extends State { margin: EdgeInsets.only( top: 10, left: 10, right: 10), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), width: double.infinity, child: Padding( padding: EdgeInsets.only( @@ -205,10 +222,12 @@ class _SickLeaveScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).clinicName, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only(top: 5), + child: AppText( + TranslationBase.of(context) + .clinicName, + )), Row( mainAxisSize: MainAxisSize.max, children: [ @@ -291,19 +310,23 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).doctorName, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .doctorName, + )), new IgnorePointer( ignoring: true, child: AppTextFormField( @@ -324,19 +347,22 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).remarks, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context).remarks, + )), TextField( maxLines: 3, decoration: InputDecoration( @@ -344,8 +370,7 @@ class _SickLeaveScreenState extends State { border: InputBorder.none, hintText: widget.extendedData != null ? widget.extendedData.remarks - : TranslationBase.of(context) - .remarks), + : ''), onChanged: (value) { addSickLeave.remarks = value; if (widget.extendedData != null) { @@ -365,7 +390,9 @@ class _SickLeaveScreenState extends State { AppButton( title: widget.isExtended == true ? TranslationBase.of(context).extend - : TranslationBase.of(context).add, + : TranslationBase.of(context) + .addSickLeaverequest, + color: Colors.green, onPressed: () async { if (widget.isExtended) { await model2.extendSickLeave( diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index a78b34c8..ef292220 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -302,4 +302,14 @@ class DateUtils { } return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; } + + static bool isToday(DateTime dateTime){ + + DateTime todayDate = DateTime.now().toUtc(); + if(dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) { + return true; + } + return false; + + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 331b2812..da9e5f75 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -523,7 +523,10 @@ class TranslationBase { localizedValues['add-sickleave'][locale.languageCode]; String get add => localizedValues['add'][locale.languageCode]; - + String get addSickLeaverequest => + localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => + localizedValues['extendSickLeaveRequest'][locale.languageCode]; String get approved => localizedValues['approved'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode]; @@ -1145,26 +1148,46 @@ class TranslationBase { String get billNo => localizedValues['BillNo'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['prescriptions'][locale.languageCode]; String get notes => localizedValues['notes'][locale.languageCode]; String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - - + String get searchWithOther => + localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => + localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => + localizedValues['applyForReschedule'][locale.languageCode]; + + String get startDate => localizedValues['startDate'][locale.languageCode]; + String get endDate => localizedValues['endDate'][locale.languageCode]; + + String get addReschedule => + localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => + localizedValues['update-reschedule'][locale.languageCode]; + String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 34ec97db..c28cc8d3 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,58 +17,83 @@ class MyScheduleWidget extends StatelessWidget { List workingHours = Helpers.getWorkingHours( workingHoursTable.workingHours, ); - return CardWithBgWidgetNew( - widget: Container( - child: Column( + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - ], + children: [ + SizedBox( + height: 10, + ), + AppText( + workingHoursTable.dayName, + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + // fontSize: 18 ), SizedBox( height: 10, ), - Row( - children: [ - AppText( - workingHoursTable.dayName, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - AppText( - ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ), - ], + AppText( + ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + + fontFamily: 'Poppins', + // fontSize: 18 ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: workingHours.map((work) { - return Container( - child: Column( - children: [ - SizedBox( - height: 5, - ), - AppText( - work.from + ' - ' + work.to, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + ], + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + child: CardWithBgWidget( + bgColor: DateUtils.isToday(workingHoursTable.date) + ? Colors.green[500] + : Colors.transparent, + // hasBorder: false, + widget: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (DateUtils.isToday(workingHoursTable.date)) + AppText( + "Today", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.green[500], + // fontSize: 18 + ), + SizedBox( + height: 10, ), - ); - }).toList(), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: workingHours.map((work) { + return Container( + child: Column( + children: [ + SizedBox( + height: 5, + ), + AppText( + work.from + ' - ' + work.to, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ); + }).toList(), + ), + ], + ), ), - ], + ), ), - ), + ], ); } } diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 9ecc6a23..c53a38d7 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -84,13 +84,15 @@ class PatientCard extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) - : AppText( - DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + : patientInfo.arrivedOn != null + ? AppText( + DateUtils.convertStringToDateFormat( + patientInfo.arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : SizedBox() ], )) : SizedBox(), @@ -124,7 +126,9 @@ class PatientCard extends StatelessWidget { AppText( patientInfo.nationalityName != null ? patientInfo.nationalityName - : patientInfo.nationality, + : patientInfo.nationality != null + ? patientInfo.nationality + : "", fontWeight: FontWeight.bold, fontSize: 14, ), @@ -286,29 +290,29 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.all(4), - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(8), - topLeft: Radius.circular(8), - ), - color: patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? HexColor('#D02127') - : patientInfo.appointmentType == - 'Walkin' - ? HexColor('#28323A') - : HexColor('#6C7379'), - ), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.only( + // bottomRight: Radius.circular(8), + // topLeft: Radius.circular(8), + // ), + // color: patientInfo.appointmentType == + // 'Regular' && + // patientInfo.visitTypeId == 100 + // ? HexColor('#D02127') + // : patientInfo.appointmentType == + // 'Walkin' + // ? HexColor('#28323A') + // : HexColor('#6C7379'), + // ), child: Image.asset( patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 - ? 'assets/images/type-livecare.png' + ? 'assets/images/livecare.png' : patientInfo.appointmentType == 'Walkin' - ? 'assets/images/type-walkin.png' - : 'assets/images/type-booked.png', + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', height: 25, width: 35, )), diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index 38a66595..165e1680 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -15,6 +15,7 @@ class AppButton extends StatefulWidget { final Color fontColor; final bool loading; final bool disabled; + final FontWeight fontWeight; AppButton( {@required this.onPressed, @@ -25,7 +26,8 @@ class AppButton extends StatefulWidget { this.padding = 13, this.loading = false, this.disabled = false, - this.fontColor = Colors.white}); + this.fontColor = Colors.white, + this.fontWeight}); _AppButtonState createState() => _AppButtonState(); } @@ -76,6 +78,7 @@ class _AppButtonState extends State { widget.title.toUpperCase(), color: widget.fontColor, fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontWeight: widget.fontWeight, ), ], ), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 84144f49..100e8c1d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -31,14 +31,6 @@ class _AppDrawerState extends State { Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - // @override - // void didChangeDependencies() { - // super.didChangeDependencies(); - // // if (_isInit) { - // getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole. - // // } - // _isInit = false; - // } @override Widget build(BuildContext context) { @@ -47,127 +39,112 @@ class _AppDrawerState extends State { return RoundedContainer( child: Container( color: Colors.white, - // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), child: Drawer( child: Column(children: [ Expanded( flex: 4, child: ListView(padding: EdgeInsets.zero, children: [ Container( + margin: EdgeInsets.symmetric(horizontal: 20), height: SizeConfig.heightMultiplier * 50, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Image.asset( - 'assets/images/logo.png', - ), - margin: EdgeInsets.only(top: 10, bottom: 15), - ), - SizedBox( - height: 1, - child: Container( - color: Colors.black26, - ), - ), - SizedBox(height: 15), - InkWell( - onTap: () { - Navigator.of(context) - .pushNamed(PROFILE, arguments: { - 'title': authProvider.doctorProfile.doctorName, - "doctorProfileall": authProvider.doctorProfile - }); - }, - child: Column( - children: [ - authProvider.doctorProfile != null - ? CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - authProvider - .doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: Colors.transparent, - ) - : SizedBox(), - authProvider.doctorProfile != null - ? Padding( - padding: EdgeInsets.only(top: 10), - child: AppText( - TranslationBase.of(context).dr + - authProvider - .doctorProfile?.doctorName, - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: SizeConfig.textMultiplier * 2, - )) - : SizedBox(), - ], - ), - ), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red)), - child: AppText( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - await helpers.logout(); - projectsProvider.isLogin = false; - }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.asset( + 'assets/images/dr_app_logo.png', + ), + margin: EdgeInsets.only(top: 10, bottom: 15), + ), + SizedBox(height: 15), + if (authProvider.doctorProfile != null) + InkWell( + onTap: () { + Navigator.of(context).pushNamed(PROFILE, arguments: { + 'title': authProvider.doctorProfile.doctorName, + "doctorProfileall": authProvider.doctorProfile + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + TranslationBase.of(context).dr + + authProvider.doctorProfile?.doctorName, + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ), + Padding( + padding: EdgeInsets.only(top: 5), + child: AppText( + authProvider.doctorProfile?.clinicDescription, + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins', + )) + ], ), - ], + ), + SizedBox(height: 15), + InkWell( + child: DrawerItem( + TranslationBase.of(context).rescheduleLeaves, + // " or " + + // TranslationBase.of(context).leaves, + + DoctorApp.leaves, + // subTitle: , + ), + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + )); + }, ), - ), + ], ), ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(SETTINGS); - }, + SizedBox( + height: 40, ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).reschedule, - DoctorApp.leaves, - subTitle: TranslationBase.of(context).leaves, + Container( + margin: EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, Icons.settings), + onTap: () async { + Navigator.pop(context); + await helpers.logout(); + projectsProvider.isLogin = false; + }, + ), + InkWell( + child: DrawerItem( + projectsProvider.isArabic + ? TranslationBase.of(context).lanEnglish + : TranslationBase.of(context).lanArabic, + DoctorApp.qr_code), + onTap: () { + if (projectsProvider.isArabic) + projectsProvider.changeLanguage('en'); + else + projectsProvider.changeLanguage('ar'); + }, + ), + ], ), - onTap: () { - Navigator.pop(context); - - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - // MyReferredPatient(), - )); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).qr + - TranslationBase.of(context).reader, - DoctorApp.qr_code), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(QR_READER); - }, ), ]), ), @@ -179,14 +156,35 @@ class _AppDrawerState extends State { child: Align( alignment: FractionalOffset.bottomCenter, child: Container( - child: Column( - children: [ - Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 30, - ) - ], + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.3, + child: RichText( + text: TextSpan( + text: 'Powered by', + style: TextStyle( + color: Color(0xFF989898), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins',), + children: [ + TextSpan(text: ' Cloud Solutions', + style: TextStyle( + color: Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins',), + ) + ] + ),), + ), + // Text("Powered by"), + Image.asset( + 'assets/images/cs_logo_container.png', + width: SizeConfig.imageSizeMultiplier * 20, + ) + ], )))) ])) ])), diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 4a274529..3b65bba5 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -24,14 +24,14 @@ class CardWithBgWidget extends StatelessWidget { ProjectViewModel projectProvider = Provider.of(context); return Container( margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, + // width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.all( Radius.circular(10.0), ), border: Border.all( color: hasBorder ? HexColor('#707070') : Colors.transparent, - width: hasBorder ? 2.0 : 0), + width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 83afb860..84691f7f 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -26,7 +26,7 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), + margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -39,15 +39,19 @@ class _DrawerItemState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - widget.title, - color: widget.color ?? Colors.black, - textOverflow: TextOverflow.ellipsis, - // fontWeight: FontWeight.bold, - // margin: 5, - marginLeft: 5, - marginRight: 5, - fontSize: SizeConfig.textMultiplier * 2.3, + Container( + width: MediaQuery.of(context).size.width *0.45, + child: Expanded( + child: AppText( + widget.title, + marginLeft: 5, + marginRight: 5, + color:widget.color ??Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2.0, + fontFamily: 'Poppins', + fontWeight: FontWeight.bold, + ), + ), ), AppText( widget.subTitle, diff --git a/pubspec.lock b/pubspec.lock index ca18664d..e15e02c9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -1084,5 +1084,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0"