diff --git a/assets/images/no-data.png b/assets/images/no-data.png new file mode 100644 index 00000000..4fd47e0f Binary files /dev/null and b/assets/images/no-data.png differ diff --git a/assets/images/patient/ic_ref_arrow_left.png b/assets/images/patient/ic_ref_arrow_left.png new file mode 100644 index 00000000..09e05ab2 Binary files /dev/null and b/assets/images/patient/ic_ref_arrow_left.png differ diff --git a/assets/images/patient/ic_ref_arrow_up.png b/assets/images/patient/ic_ref_arrow_up.png new file mode 100644 index 00000000..8294cfed Binary files /dev/null and b/assets/images/patient/ic_ref_arrow_up.png differ diff --git a/assets/images/qr_code.png b/assets/images/qr_code.png index 775a30bd..71a9e895 100644 Binary files a/assets/images/qr_code.png and b/assets/images/qr_code.png differ diff --git a/assets/images/saudi-arabia-flag.png b/assets/images/saudi-arabia-flag.png new file mode 100644 index 00000000..932eb11a Binary files /dev/null and b/assets/images/saudi-arabia-flag.png differ diff --git a/assets/images/usa-flag.png b/assets/images/usa-flag.png new file mode 100644 index 00000000..63c17641 Binary files /dev/null and b/assets/images/usa-flag.png differ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 194ee2af..20cb9ef7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -43,7 +43,7 @@ const Map> localizedValues = { 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, - 'referral': {'en': 'Referral', 'ar': 'االإحالة'}, + 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, @@ -51,7 +51,7 @@ const Map> localizedValues = { 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, - 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, + 'myReferredPatient': {'en': 'Referred', 'ar': 'المحالين'}, 'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'}, 'referredOn': {'en': 'referred On : ', 'ar': ' : تمت الإحالة في'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, @@ -843,4 +843,15 @@ const Map> localizedValues = { "en": "Step", "ar": "خطوة" }, + "fieldRequired": { + "en": "This field is required", + "ar": "هذه الخانة مطلوبه" + }, + "applyOrRescheduleLeave": { + "en": "Apply Or Reschedule Leave", + "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + },"myQRCode": { + "en": "My QR Code", + "ar": "My QR Code" + }, }; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 67760908..afebad74 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -19,7 +19,7 @@ class MedicalFileViewModel extends BaseViewModel { await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { error = _medicalFileService.error; - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/main.dart b/lib/main.dart index a7515e7b..b5e8414d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -46,7 +46,7 @@ class MyApp extends StatelessWidget { child: Consumer( builder: (context, projectProvider, child) => MaterialApp( showSemanticsDebugger: false, - title: 'Flutter Demo', + title: 'Doctors App', locale: projectProvider.appLocal, localizationsDelegates: [ TranslationBaseDelegate(), diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 957dcc66..465ef71e 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -119,7 +119,7 @@ class _LoginsreenState extends State { children: [ AuthHeader(loginType.knownUser), SizedBox( - height: 60, + height: 40, ), LoginForm( changeLoadingStata: changeLoadingStata, diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 13e17077..252958b1 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -79,7 +79,8 @@ class _DashboardScreenState extends State { PatientID: 0, From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + To: DateUtils.convertDateToFormat( + DateTime.now().add(Duration(days: 7, hours: 0)), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", @@ -1020,12 +1021,12 @@ class _DashboardScreenState extends State { ), hasBorder: false, onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // SearchMedicinePatientScreen(), - // )); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SearchMedicinePatientScreen(), + )); }, ) ], diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 48118c7e..00648473 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -161,181 +161,6 @@ class _MedicalFilePageState extends State { ), ); - // return Padding( - // padding: EdgeInsets.symmetric( - // 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: [ - // Row( - // children: [ - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[index] - // .doctorName, - // fontWeight: FontWeight.w700, - // fontSize: 17.0, - // fontFamily: 'Poppins', - // ) - // ], - // ), - // 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: [ - // 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: [ - // Column( - // children: [ - // Icon( - // Icons.remove_red_eye, - // size: 30.0, - // ) - // ], - // ) - // ], - // ), - // ], - // ), - // ), - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // MedicalFileDetails( - // age: patient.age, - // firstName: patient.firstName, - // lastName: patient.lastName, - // gender: patient.genderDescription, - // encounterNumber: index, - // pp: patient.patientId, - // patient: patient, - // )), - // ); - // }, - // ), - // ); }) : Column( children: [ diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 62485f0d..0efd3a95 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -176,11 +176,12 @@ class _PatientsScreenState extends State { patiantAppointment = convertDateFormat(responseModelList[i].appointmentDate); } + if (patiantAppointment != null) { + String dateAppointment = checkDate(patiantAppointment); - String dateAppointment = checkDate(patiantAppointment); - - if (dateAppointment.contains(str) || str == 'All') { - filterDate.add(responseModelList[i]); + if (dateAppointment.contains(str) || str == 'All') { + filterDate.add(responseModelList[i]); + } } } catch (e) { print(e); diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 99948bed..ec7a7355 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -8,10 +8,12 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/order-procedure.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/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; @@ -45,6 +47,9 @@ class _UcafDetailScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, body: Column( children: [ @@ -54,7 +59,32 @@ class _UcafDetailScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientHeaderWidgetNoAvatar(patient), + // PatientHeaderWidgetNoAvatar(patient), + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).patient}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).ucaf}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + PageStepperWidget( + stepsCount: 2, + currentStepIndex: 2, + screenSize: screenSize, + ), SizedBox( height: 10, ), @@ -80,48 +110,60 @@ class _UcafDetailScreenState extends State { ), Container( margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), - child: BorderedButton( - TranslationBase.of(context).save, - hasBorder: true, - vPadding: 8, - hPadding: 8, - borderColor: HexColor("#B8382B"), - backgroundColor: HexColor("#B8382B"), - textColor: Colors.white, - fontSize: SizeConfig.textMultiplier * 2.0, - handler: () async { - await model.postUCAF(patient); - if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).postUcafSuccessMsg); - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - } else { - DrAppToastMsg.showErrorToast(model.error); - } - }, - ), - ), - Container( - margin: EdgeInsets.only( - left: 16, right: 16, top: 0.0, bottom: 8), - child: BorderedButton( - TranslationBase.of(context).cancel, - hasBorder: true, - vPadding: 8, - hPadding: 8, - borderColor: Colors.white, - backgroundColor: Colors.white, - textColor: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.2, - handler: () { - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - }, + child: Row( + children: [ + Expanded( + child: Container( + child: BorderedButton( + TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 8, + hPadding: 8, + borderColor: Colors.white, + backgroundColor: Colors.white, + textColor: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.2, + handler: () { + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: BorderedButton( + TranslationBase.of(context).save, + hasBorder: true, + vPadding: 8, + hPadding: 8, + borderColor: HexColor("#B8382B"), + backgroundColor: HexColor("#B8382B"), + textColor: Colors.white, + fontSize: SizeConfig.textMultiplier * 2.0, + handler: () async { + await model.postUCAF(patient); + if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).postUcafSuccessMsg); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + } else { + DrAppToastMsg.showErrorToast(model.error); + } + }, + ), + ), + ), + ], ), ), + ], ), )); diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 18939d54..c39464bd 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/patients/profile/UCAF/page-stepper-widget.dart'; @@ -115,7 +116,8 @@ class _UCAFInputScreenState extends State { title: AppText( TranslationBase.of(context).inPatient, fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.1, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, ), value: _inPatient, onChanged: (newValue) { @@ -123,6 +125,7 @@ class _UCAFInputScreenState extends State { _inPatient = newValue; }); }, + activeColor: HexColor("#D02127"), controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), @@ -131,7 +134,8 @@ class _UCAFInputScreenState extends State { title: AppText( TranslationBase.of(context).emergencyCase, fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.1, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, ), value: _emergencyCase, onChanged: (newValue) { @@ -139,14 +143,14 @@ class _UCAFInputScreenState extends State { _emergencyCase = newValue; }); }, + activeColor: HexColor("#D02127"), controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).durationOfIllness, + hintText: TranslationBase.of(context) + .durationOfIllness, dropDownText: "3", inputType: TextInputType.number, inputFormatters: [ @@ -163,6 +167,14 @@ class _UCAFInputScreenState extends State { children: [ Row( children: [ + Icon( + DoctorApp.warning, + size: 20, + color: Color(0xFFCC9B14), + ), + SizedBox( + width: 8, + ), AppText( "BP (H/L)", fontSize: @@ -183,7 +195,7 @@ class _UCAFInputScreenState extends State { ], ), SizedBox( - width: 4, + width: 6, ), Expanded( child: Row( @@ -196,7 +208,7 @@ class _UCAFInputScreenState extends State { fontWeight: FontWeight.normal, ), SizedBox( - width: 8, + width: 4, ), Expanded( child: AppText( @@ -213,7 +225,7 @@ class _UCAFInputScreenState extends State { ], ), SizedBox( - height: 4, + height: 2, ), Row( mainAxisAlignment: @@ -222,14 +234,14 @@ class _UCAFInputScreenState extends State { Row( children: [ AppText( - "${TranslationBase.of(context).pulseBeats} :", + "${TranslationBase.of(context).pulseBeats}:", fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), SizedBox( - width: 8, + width: 4, ), AppText( "${model.patientVitalSigns.pulseBeatPerMinute}", @@ -246,10 +258,12 @@ class _UCAFInputScreenState extends State { height: 16, ), AppText( - TranslationBase.of(context).chiefComplaintsAndSymptoms, + TranslationBase.of(context) + .chiefComplaintsAndSymptoms, fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), SizedBox( height: 4, @@ -259,13 +273,15 @@ class _UCAFInputScreenState extends State { .patientFeelsPainInHisBackAndCough, fontFamily: 'Poppins', fontWeight: FontWeight.normal, + color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.8, ), SizedBox( height: 8, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).instruction, + hintText: + TranslationBase.of(context).instruction, dropDownText: helpers.parseHtmlString(model .patientChiefComplaintList[0] .chiefComplaint), @@ -281,16 +297,18 @@ class _UCAFInputScreenState extends State { AppText( TranslationBase.of(context).otherConditions, fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 2.1, + color: Color(0xFF2E303A), ), ...List.generate( conditionsData.length, (index) => CheckboxListTile( title: AppText( conditionsData[index]['name'], - fontWeight: FontWeight.bold, + fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.1, + fontFamily: 'Poppins', ), value: conditionsData[index] ['isChecked'], @@ -307,115 +325,76 @@ class _UCAFInputScreenState extends State { SizedBox( height: 8, ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).other, - null, - false), - enabled: true, - controller: _otherController, - keyboardType: TextInputType.text, - )), + AppTextFieldCustom( + hintText: TranslationBase.of(context).other, + dropDownText: "None", + enabled: false, + ), SizedBox( height: 8, ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).how, - null, - false), - enabled: true, - controller: _howController, - keyboardType: TextInputType.text, - )), + AppTextFieldCustom( + hintText: TranslationBase.of(context).how, + dropDownText: "None", + enabled: false, + ), SizedBox( height: 8, ), Row( children: [ Expanded( - child: Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - TranslationBase.of(context) - .when, - null, - false), - enabled: true, - controller: _whenController, - keyboardType: TextInputType.text, - )), + child: AppTextFieldCustom( + hintText: + TranslationBase.of(context).when, + dropDownText: "None", + enabled: false, + ), ), SizedBox( width: 4, ), Expanded( - child: Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - TranslationBase.of(context) - .where, - null, - false), - enabled: true, - controller: _whereController, - keyboardType: TextInputType.text, - )), + child: AppTextFieldCustom( + hintText: + TranslationBase.of(context).where, + dropDownText: "None", + enabled: false, + ), ), ], ), SizedBox( height: 8, ), - Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .specifyPossibleLineManagement, - null, - false), - enabled: true, - controller: _managementsLineController, - keyboardType: TextInputType.text, + AppTextFieldCustom( + height: screenSize.height * 0.1, + hintText: TranslationBase.of(context) + .specifyPossibleLineManagement, + dropDownText: "None", + enabled: false, minLines: 4, maxLines: 6, - )), + ), SizedBox( - height: 16, + height: 26, ), AppText( TranslationBase.of(context).significantSigns, fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, ), SizedBox( height: 8, ), - Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .backAbdomen, - null, - false), - enabled: true, - controller: _signsController, - keyboardType: TextInputType.multiline, - minLines: null, - maxLines: null, - )), + AppTextFieldCustom( + height: screenSize.height * 0.1, + hintText: + TranslationBase.of(context).backAbdomen, + dropDownText: "BackLNeck", + enabled: false, + ), ], ), ), @@ -430,7 +409,11 @@ class _UCAFInputScreenState extends State { color: HexColor("#D02127"), onPressed: () { Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, - arguments: {'patient': patient}); + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType + }); }, ), ), diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 5e93f141..fa3d5daa 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -4,6 +4,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +/// * +/// By Mousa Zaid Mousa Abuzaid +/// At 13/4/2021 + +/* + All hex value from 100% to 0% alpha: used in line 122 + https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 + */ + class PageStepperWidget extends StatelessWidget { final int stepsCount; final int currentStepIndex; @@ -38,6 +47,7 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { + final int index; final bool isInProgress; final bool isFinalStep; @@ -68,27 +78,28 @@ class StepWidget extends StatelessWidget { Container( padding: EdgeInsets.all(0.0), margin: EdgeInsets.symmetric(horizontal: 1), - width: 25, - height: 25, + width: 30, + height: 30, decoration: BoxDecoration( - color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), + color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), shape: BoxShape.circle, border: Border.all( - color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), + color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), width: 1), ), child: Center( child: Icon( Icons.check, size: 20, - color: status == StepStatus.InProgress ? Colors.white : status == StepStatus.Locked ? Colors.grey.shade800 : Color(0xFF359846), + color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white, )), ), if (!isFinalStep) Container( + margin: EdgeInsets.symmetric(horizontal: 4), width: dividerWidth, height: 2, - color: Colors.grey, + color: status == StepStatus.Completed ? Color(0xFF359846) : Color(0xFFCCCCCC), ), ], ), @@ -98,23 +109,27 @@ class StepWidget extends StatelessWidget { AppText( "${TranslationBase.of(context).step} $index", fontWeight: FontWeight.bold, - color: status == StepStatus.InProgress ? Colors.black : status == StepStatus.Locked ? Colors.grey : Color(0xFF359846), + color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, ), Container( margin: EdgeInsets.symmetric(vertical: 4), - padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4), decoration: BoxDecoration( color: status == StepStatus.InProgress ? Color(0xFFF1E9D3) : status == StepStatus.Locked - ? Color(0xFFD8E8DB) - : Color(0xFFCCCCCC), + ? Color(0x29797979) + : Color(0xFFD8E8D8), borderRadius: BorderRadius.all( - Radius.circular(8.0), + Radius.circular(4.0), ), - border: Border.all(color: HexColor('#707070'), width: 0.30), + border: Border.all(color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0x29797979) + : Color(0xFFD8E8D8), width: 0.30), ), child: AppText( status == StepStatus.InProgress diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 8095d04a..876066ce 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -44,6 +44,12 @@ class _AdmissionRequestThirdScreenState bool _isSickLeaveRequired = false; bool _patientPregnant = false; + String clinicError; + String doctorError; + String sickLeaveCommentError; + String medicalHistoryError; + String surgicalHistoryError; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -117,15 +123,16 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).clinic, isDropDown: true, + validationError: clinicError, dropDownText: _selectedClinic != null - ? _selectedClinic['clinicGroupName'] + ? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] : null, enabled: false, onClick: model.clinicList != null && model.clinicList.length > 0 ? () { openListDialogField( - 'clinicGroupName', + projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { @@ -142,7 +149,7 @@ class _AdmissionRequestThirdScreenState if (model.state == ViewState.Idle && model.clinicList.length > 0) { openListDialogField( - 'clinicGroupName', + projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { @@ -170,6 +177,7 @@ class _AdmissionRequestThirdScreenState ? _selectedDoctor['DoctorName'] : null, enabled: false, + validationError: doctorError, onClick: _selectedClinic != null ? model.doctorsList != null && model.doctorsList.length > 0 @@ -263,6 +271,7 @@ class _AdmissionRequestThirdScreenState controller: _sickLeaveCommentsController, minLines: 2, maxLines: 4, + validationError: sickLeaveCommentError, inputType: TextInputType.multiline, ), SizedBox( @@ -331,6 +340,7 @@ class _AdmissionRequestThirdScreenState controller: _postMedicalHistoryController, minLines: 4, maxLines: 6, + validationError: medicalHistoryError, inputType: TextInputType.multiline, ), SizedBox( @@ -341,6 +351,7 @@ class _AdmissionRequestThirdScreenState controller: _postSurgicalHistoryController, minLines: 2, maxLines: 4, + validationError: surgicalHistoryError, inputType: TextInputType.multiline, ), ], @@ -401,6 +412,34 @@ class _AdmissionRequestThirdScreenState } else { DrAppToastMsg.showErrorToast( TranslationBase.of(context).pleaseFill); + + setState(() { + if(_selectedClinic == null){ + clinicError = TranslationBase.of(context).fieldRequired; + }else { + clinicError = null; + } + if(_selectedDoctor == null){ + doctorError = TranslationBase.of(context).fieldRequired; + }else { + doctorError = null; + } + if(_sickLeaveCommentsController.text == ""){ + sickLeaveCommentError = TranslationBase.of(context).fieldRequired; + }else { + sickLeaveCommentError = null; + } + if(_postMedicalHistoryController.text == ""){ + medicalHistoryError = TranslationBase.of(context).fieldRequired; + }else { + medicalHistoryError = null; + } + if(_postSurgicalHistoryController.text == ""){ + surgicalHistoryError = TranslationBase.of(context).fieldRequired; + }else { + surgicalHistoryError = null; + } + }); } }, ), diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index a48a7c45..bf896145 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -38,6 +38,10 @@ class _AdmissionRequestThirdScreenState dynamic _selectedIcd; dynamic _selectedDiagnosisType; + String diagnosisError; + String icdError; + String diagnosisTypeError; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -112,6 +116,7 @@ class _AdmissionRequestThirdScreenState : null, enabled: false, isDropDown: true, + validationError: diagnosisError, onClick: model.diagnosisTypesList != null && model.diagnosisTypesList.length > 0 ? () { @@ -157,6 +162,7 @@ class _AdmissionRequestThirdScreenState : null, enabled: false, isDropDown: true, + validationError: icdError, onClick: model.icdCodes != null && model.icdCodes.length > 0 ? () { @@ -204,6 +210,7 @@ class _AdmissionRequestThirdScreenState : null, enabled: false, isDropDown: true, + validationError: diagnosisTypeError, onClick: model.listOfDiagnosisSelectionTypes != null && model.listOfDiagnosisSelectionTypes.length > @@ -312,6 +319,26 @@ class _AdmissionRequestThirdScreenState } else { DrAppToastMsg.showErrorToast( TranslationBase.of(context).pleaseFill); + + setState(() { + if(_selectedDiagnosis == null){ + diagnosisError = TranslationBase.of(context).fieldRequired; + }else { + diagnosisError = null; + } + + if(_selectedIcd == null){ + icdError = TranslationBase.of(context).fieldRequired; + }else { + icdError = null; + } + + if(_selectedDiagnosisType == null){ + diagnosisTypeError = TranslationBase.of(context).fieldRequired; + }else { + diagnosisTypeError = null; + } + }); } }, ), diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 2dcfbbf9..a4aebc9f 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -50,6 +50,18 @@ class _AdmissionRequestSecondScreenState dynamic _selectedRoomCategory; dynamic _selectedAdmissionType; + String costError; + String plansError; + String otherInterventionsError; + String expectedDaysError; + String expectedDatesError; + String floorError; + String roomError; + String treatmentsError; + String complicationsError; + String proceduresError; + String admissionTypeError; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -125,6 +137,7 @@ class _AdmissionRequestSecondScreenState hintText: TranslationBase.of(context).estimatedCost, controller: _estimatedCostController, + validationError: costError, inputType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.allow( @@ -138,6 +151,7 @@ class _AdmissionRequestSecondScreenState hintText: TranslationBase.of(context).postPlans, controller: _postPlansEstimatedCostController, inputType: TextInputType.multiline, + validationError: plansError, minLines: 4, maxLines: 6, ), @@ -150,6 +164,7 @@ class _AdmissionRequestSecondScreenState controller: _otherDepartmentsInterventionsController, inputType: TextInputType.multiline, + validationError: otherInterventionsError, minLines: 2, maxLines: 4, ), @@ -170,6 +185,7 @@ class _AdmissionRequestSecondScreenState hintText: TranslationBase.of(context).expectedDays, controller: _expectedDaysController, + validationError: expectedDaysError, inputType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.allow( @@ -188,6 +204,7 @@ class _AdmissionRequestSecondScreenState : null, enabled: false, isDropDown: true, + validationError: expectedDatesError, suffixIcon: Icon( Icons.calendar_today, color: Colors.black, @@ -215,6 +232,7 @@ class _AdmissionRequestSecondScreenState : null, enabled: false, isDropDown: true, + validationError: floorError, onClick: model.floorList != null && model.floorList.length > 0 ? () { @@ -314,6 +332,7 @@ class _AdmissionRequestSecondScreenState : null, enabled: false, isDropDown: true, + validationError: roomError, onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0 ? () { @@ -365,6 +384,7 @@ class _AdmissionRequestSecondScreenState TranslationBase.of(context).treatmentLine, controller: _treatmentLineController, inputType: TextInputType.multiline, + validationError: treatmentsError, minLines: 3, maxLines: 5, ), @@ -376,6 +396,7 @@ class _AdmissionRequestSecondScreenState TranslationBase.of(context).complications, controller: _complicationsController, inputType: TextInputType.multiline, + validationError: complicationsError, minLines: 3, maxLines: 5, ), @@ -387,6 +408,7 @@ class _AdmissionRequestSecondScreenState TranslationBase.of(context).otherProcedure, controller: _otherProceduresController, inputType: TextInputType.multiline, + validationError: proceduresError, minLines: 3, maxLines: 5, ), @@ -402,6 +424,7 @@ class _AdmissionRequestSecondScreenState : null, enabled: false, isDropDown: true, + validationError: admissionTypeError, onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0 ? () { @@ -533,6 +556,75 @@ class _AdmissionRequestSecondScreenState } else { DrAppToastMsg.showErrorToast( TranslationBase.of(context).pleaseFill); + + setState(() { + if (_estimatedCostController.text == "") { + costError = TranslationBase.of(context).fieldRequired; + } else { + costError = null; + } + + if (_postPlansEstimatedCostController.text == "") { + plansError = TranslationBase.of(context).fieldRequired; + } else { + plansError = null; + } + + if (_expectedDaysController.text == "") { + expectedDaysError = TranslationBase.of(context).fieldRequired; + } else { + expectedDaysError = null; + } + + if (_expectedAdmissionDate == null) { + expectedDatesError = TranslationBase.of(context).fieldRequired; + } else { + expectedDatesError = null; + } + + if (_otherDepartmentsInterventionsController.text == "") { + otherInterventionsError = TranslationBase.of(context).fieldRequired; + } else { + otherInterventionsError = null; + } + + if (_selectedFloor == null) { + floorError = TranslationBase.of(context).fieldRequired; + } else { + floorError = null; + } + + if (_selectedRoomCategory == null) { + roomError = TranslationBase.of(context).fieldRequired; + } else { + roomError = null; + } + + if (_treatmentLineController.text == "") { + treatmentsError = TranslationBase.of(context).fieldRequired; + } else { + treatmentsError = null; + } + + if (_complicationsController.text == "") { + complicationsError = TranslationBase.of(context).fieldRequired; + } else { + complicationsError = null; + } + + if (_otherProceduresController.text == "") { + proceduresError = TranslationBase.of(context).fieldRequired; + } else { + proceduresError = null; + } + + if (_selectedAdmissionType == null) { + admissionTypeError = TranslationBase.of(context).fieldRequired; + } else { + admissionTypeError = null; + } + }); + } }, ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index a61477e7..0d8b1749 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -43,6 +43,8 @@ class _LaboratoryResultPageState extends State { orderNo: widget.patientLabOrders.orderNo, appointmentDate:widget.patientLabOrders.orderDate, doctorName: widget.patientLabOrders.doctorName, + branch: widget.patientLabOrders.projectName, + clinic: widget.patientLabOrders.clinicDescription, profileUrl: widget.patientLabOrders.doctorImageURL, invoiceNO: widget.patientLabOrders.invoiceNo, ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 79920811..d167ca43 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -150,6 +150,7 @@ class LabsHomePage extends StatelessWidget { invoiceNO: ' ${labOrder.invoiceNo}', profileUrl: labOrder.doctorImageURL, branch: labOrder.projectName, + clinic: labOrder.clinicDescription, appointmentDate: labOrder.orderDate, orderNo: labOrder.orderNo, ); diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 70c9f5b9..63a1247b 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -141,24 +141,29 @@ class PatientProfileScreen extends StatelessWidget { if (patient.episodeNo != 0) BorderedButton( "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - backgroundColor: Colors.red.shade700, - textColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, + backgroundColor: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + textColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 12, + fontFamily: 'Poppins', + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, ), handler: () { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); - }, + if (patient.patientStatusType == 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: {'patient': patient}); + } + } ), ], ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index c5921438..235aacf6 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -43,6 +43,8 @@ class RadiologyDetailsPage extends StatelessWidget { arrivalType: arrivalType ?? "0", appointmentDate: finalRadiology.orderDate, doctorName: finalRadiology.doctorName, + clinic: finalRadiology.clinicDescription, + branch: finalRadiology.projectName, profileUrl: finalRadiology.doctorImageURL, invoiceNO: finalRadiology.invoiceNo.toString(), ), @@ -54,6 +56,7 @@ class RadiologyDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( + width: double.maxFinite, margin: EdgeInsets.all(8), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 9adb8ae8..6c44cde4 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -138,9 +138,10 @@ class RadiologyHomePage extends StatelessWidget { profileUrl: model.radiologyList[index].doctorImageURL, invoiceNO: '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', - appointmentDate: model.radiologyList[index].orderDate, - ), - )), + clinic: model.radiologyList[index].clinicDescription, + appointmentDate: model.radiologyList[index].orderDate, + ), + )), ], ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 16084342..1935bc46 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -44,12 +44,12 @@ class _PatientReferralScreen extends State child: Container( height: 60.0, // margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, + width: MediaQuery.of(context).size.width * 1, // 0.92, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 + width: 1), //width: 0.7 ), color: Colors.white), child: Center( @@ -68,7 +68,7 @@ class _PatientReferralScreen extends State width: MediaQuery.of(context).size.width * 0.30, child: Center( child: - AppText(TranslationBase.of(context).myReferral), + AppText(TranslationBase.of(context).referral), ), ), Container( diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 2619b200..815ec93d 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -10,6 +10,7 @@ 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/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -38,6 +39,11 @@ class _PatientMakeReferralScreenState extends State { DateTime appointmentDate; final _remarksController = TextEditingController(); + String branchError = null; + String hospitalError = null; + String clinicError = null; + String doctorError = null; + @override void initState() { super.initState(); @@ -71,7 +77,9 @@ class _PatientMakeReferralScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), body: SingleChildScrollView( child: Container( child: Column( @@ -80,8 +88,8 @@ class _PatientMakeReferralScreenState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), + /*PatientProfileHeaderNewDesign( + patient, patientType, arrivalType),*/ Container( margin: EdgeInsets.all(16.0), child: Column( @@ -145,6 +153,28 @@ class _PatientMakeReferralScreenState extends State { fontWeight: FontWeight.w700, color: HexColor("#359846"), onPressed: () { + setState(() { + if(_referTo == null){ + branchError = TranslationBase.of(context).fieldRequired; + }else { + branchError = null; + } + if(_selectedBranch == null){ + hospitalError = TranslationBase.of(context).fieldRequired; + }else { + hospitalError = null; + } + if(_selectedClinic == null){ + clinicError = TranslationBase.of(context).fieldRequired; + }else { + clinicError = null; + } + if(_selectedDoctor == null){ + doctorError = TranslationBase.of(context).fieldRequired; + }else { + doctorError = null; + } + }); if (appointmentDate == null || _selectedBranch == null || _selectedClinic == null || @@ -186,6 +216,7 @@ class _PatientMakeReferralScreenState extends State { dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, isDropDown: true, + validationError: branchError, onClick: referToList != null ? () { ListSelectDialog dialog = ListSelectDialog( @@ -238,6 +269,7 @@ class _PatientMakeReferralScreenState extends State { : null, enabled: false, isDropDown: true, + validationError: hospitalError, onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && @@ -285,6 +317,7 @@ class _PatientMakeReferralScreenState extends State { : null, enabled: false, isDropDown: true, + validationError: clinicError, onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 @@ -332,6 +365,7 @@ class _PatientMakeReferralScreenState extends State { _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, enabled: false, isDropDown: true, + validationError: doctorError, onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0 @@ -357,7 +391,13 @@ class _PatientMakeReferralScreenState extends State { }, ); } - : null, + : (){ + if(_selectedClinic == null){ + DrAppToastMsg.showErrorToast("You need to select a clinic first"); + } else if(model.doctorsList == null || model.doctorsList.length == 0){ + DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); + } + }, ), SizedBox( height: 10, diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 5eea8f3d..3c0e4add 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -90,10 +90,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { height: 20, decoration: BoxDecoration( shape: BoxShape.rectangle, - color: Colors.grey), + color: Colors.red), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).diastolicLng) + AppText(TranslationBase.of(context).diastolicLng,) ], ), ], @@ -248,7 +248,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - colors: [Colors.grey], + colors: [Colors.red], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index e838affa..3431a011 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -51,7 +51,7 @@ class VitalSignItem extends StatelessWidget { "$lastVal", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.4, - fontWeight: FontWeight.w800, + fontWeight: FontWeight.bold, margin: 0, ), Expanded( @@ -88,7 +88,7 @@ class VitalSignItem extends StatelessWidget { "$des", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.3, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.bold, ), ), ), diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index f2bbe274..a92f5365 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -36,6 +36,7 @@ class PrescriptionItemsPage extends StatelessWidget { patientType: patientType??"0", arrivalType: arrivalType??"0", clinic: prescriptions.clinicDescription, + branch: prescriptions.name, isPrescriptions: true, appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), doctorName: prescriptions.doctorName, diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 9f62d253..43be9b71 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -1,6 +1,6 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -27,7 +27,7 @@ class ProcedureCard extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return Container( width: double.maxFinite, - //height: MediaQuery.of(context).size.height * .22, + height: MediaQuery.of(context).size.height * .22, margin: EdgeInsets.all(10), padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( @@ -80,7 +80,7 @@ class ProcedureCard extends StatelessWidget { ), Texts( entityList.procedureName, - fontWeight: FontWeight.w700, + bold: true, fontSize: 14, ), ], @@ -120,135 +120,55 @@ class ProcedureCard extends StatelessWidget { Texts( entityList.orderNo.toString(), fontSize: 12, - fontWeight: FontWeight.w700, + bold: true, ), ], ), - // Row( - // children: [ - // Texts( - // TranslationBase.of(context).doctorName + ": ", - // //color: Colors.grey, - // fontSize: 12, - // color: Colors.grey, - // ), - // Texts( - // entityList.doctorName.toString(), - // fontSize: 12, - // bold: true, - // ), - // ], - // ), - // Row( - // children: [ - // Texts( - // TranslationBase.of(context).clinic + ": ", - // //color: Colors.grey, - // fontSize: 12, - // color: Colors.grey, - // ), - // Texts( - // entityList.clinicDescription.toString(), - // bold: true, - // fontSize: 12, - // ), - // ], - // ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child: Texts( - entityList.remarks.toString() ?? '----', - fontSize: 12, - ), + Texts( + TranslationBase.of(context).doctorName + ": ", + //color: Colors.grey, + fontSize: 12, + color: Colors.grey, + ), + Texts( + entityList.doctorName.toString(), + fontSize: 12, + bold: true, ), - if (entityList.categoryID == 2 || - entityList.categoryID == 4) - InkWell( - child: Icon(Icons.edit), - onTap: onTap, - ) ], ), Row( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 30, - height: 30, - margin: EdgeInsets.only( - left: - projectViewModel.isArabic ? 5 : 5 /*10:85*/, - right: - projectViewModel.isArabic ? 5 : 5 /*85:10*/, - top: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom: BorderSide( - color: Colors.grey[400], width: 2.5), - left: BorderSide( - color: Colors.grey[400], width: 2.5), - )), + Texts( + TranslationBase.of(context).clinic + ": ", + //color: Colors.grey, + fontSize: 12, + color: Colors.grey, ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only( - left: 5, top: 25, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - TextSpan( - text: "Dr.".toString(), - style: TextStyle( - fontSize: 13, - fontFamily: 'Poppins')), - TextSpan( - text: entityList.doctorName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), - ], - ), - ), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - TextSpan( - text: TranslationBase.of(context) - .clinic, - style: TextStyle( - fontSize: 13, - fontFamily: 'Poppins')), - TextSpan( - text: entityList.clinicDescription, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), - ], - ), - ) - ], - ), - ), + Texts( + entityList.clinicDescription??"", + bold: true, + fontSize: 12, ), ], ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + entityList.remarks.toString() ?? '', + fontSize: 12, + ), + if (entityList.categoryID == 2 || + entityList.categoryID == 4) + InkWell( + child: Icon(DoctorApp.edit), + onTap: onTap, + ) + ], + ) ], ), //onTap: onTap, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index e8fdd882..646665b7 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -29,122 +29,119 @@ class ProcedureScreen extends StatelessWidget { builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, + baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( patient, arrivalType ?? '0', patientType), - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - 'Order Test or', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - Texts( - 'Procedure', - bold: true, - fontSize: 22, - ), - ], - ), + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Order Test or', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Procedure', + bold: true, + fontSize: 22, + ), + ], ), - if (patientType != null && patientType == '7' && patient.patientStatusType == 43) - InkWell( - onTap: () { - addSelectedProcedure(context, model, patient); - }, - child: Container( - width: double.maxFinite, - height: 140, - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Container( - height: 90, - child: Column( - children: [ - Container( - height: 40, - width: 40, - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), - ), + ), + if (patientType != null && patientType == '7' && patient.patientStatusType == 43) + InkWell( + onTap: () { + addSelectedProcedure(context, model, patient); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), ), - SizedBox( - height: 10, + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), - Texts( - 'Add More Procedure', - color: Colors.grey[600], - fontWeight: FontWeight.w600, - ) - ], - ), + ), + SizedBox( + height: 10, + ), + Texts( + 'Add More Procedure', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], ), ), ), ), - if (model.procedureList.isNotEmpty) - ...List.generate( - model.procedureList[0].rowcount, - (index) => ProcedureCard( - categoryID: - model.procedureList[0].entityList[index].categoryID, - entityList: model.procedureList[0].entityList[index], - onTap: () { - if (model.procedureList[0].entityList[index].categoryID == - 2 || - model.procedureList[0].entityList[index].categoryID == 4) - updateProcedureForm(context, - model: model, - patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model.procedureList[0] - .entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model.procedureList[0] - .entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0] - .entityList[index].lineItemNo); - // } else - // helpers.showErrorToast( - // 'You Cant Update This Procedure'); - }, - ), + ), + if (model.procedureList.isNotEmpty) + ...List.generate( + model.procedureList[0].rowcount, + (index) => ProcedureCard( + categoryID: + model.procedureList[0].entityList[index].categoryID, + entityList: model.procedureList[0].entityList[index], + onTap: () { + if (model.procedureList[0].entityList[index].categoryID == + 2 || + model.procedureList[0].entityList[index].categoryID == 4) + updateProcedureForm(context, + model: model, + patient: patient, + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model.procedureList[0] + .entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model.procedureList[0] + .entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0] + .entityList[index].lineItemNo); + // } else + // helpers.showErrorToast( + // 'You Cant Update This Procedure'); + }, ), - ], - ), + ), + ], ), ), ), diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index 283649aa..1e9e2459 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -57,25 +57,25 @@ class _ProfileScreenState extends State { children: [ DrawerItem( TranslationBase.of(context).gender, - Icons.person_pin, + icon: Icons.person_pin, color: Colors.black, subTitle: doctorProfile.genderDescription //"Male" , ), - DrawerItem(TranslationBase.of(context).clinic, Icons.build, + DrawerItem(TranslationBase.of(context).clinic, icon: Icons.build, color: Colors.black, subTitle: doctorProfile.clinicDescription //"Neurology Clinic", ), DrawerItem( TranslationBase.of(context).hospital, - Icons.local_hospital, + icon: Icons.local_hospital, color: Colors.black, subTitle: doctorProfile.projectName, //"Al-Takkassussi", ), DrawerItem( TranslationBase.of(context).speciality, - Icons.crop_square, + icon: Icons.crop_square, color: Colors.black, subTitle: doctorProfile.doctorRate == 0 ? TranslationBase.of(context).beingBad diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index ba90cf6e..eb59cdc3 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -10,7 +10,9 @@ 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-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; @@ -29,12 +31,16 @@ class AddSickLeavScreen extends StatelessWidget { onModelReady: (model) => model.getSickLeave(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).sickleave, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + routeArgs['patientType'] ?? "0", + routeArgs['arrivalType'] ?? "0", + ), body: SingleChildScrollView( child: Column(children: [ - PatientProfileHeaderNewDesign( - patient, routeArgs['patientType'], routeArgs['arrivalType']), + // PatientProfileHeaderNewDesign( + // patient, routeArgs['patientType'], routeArgs['arrivalType']), patient.patientStatusType == 43 ? Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index f64147dc..94624b5e 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -10,6 +10,7 @@ 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-app-bar.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'; @@ -30,13 +31,17 @@ class ShowSickLeaveScreen extends StatelessWidget { model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).sickleave, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + routeArgs['patientType'] ?? "0", + routeArgs['arrivalType'] ?? "0", + ), body: SingleChildScrollView( child: Column( children: [ - PatientProfileHeaderNewDesign( - patient, routeArgs['patientType'], routeArgs['arrivalType']), + // PatientProfileHeaderNewDesign( + // patient, routeArgs['patientType'], routeArgs['arrivalType']), Column( children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6094331f..0a0248a6 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -622,6 +622,11 @@ class TranslationBase { String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; + String get applyOrRescheduleLeave => + localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get myQRCode => + localizedValues['myQRCode'][locale.languageCode]; + String get addMedication => localizedValues['addMedication'][locale.languageCode]; @@ -1211,7 +1216,7 @@ class TranslationBase { String get remove => localizedValues['remove'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; - + String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; diff --git a/lib/widgets/auth/known_user_login.dart b/lib/widgets/auth/known_user_login.dart index b181aed8..cbf3c71a 100644 --- a/lib/widgets/auth/known_user_login.dart +++ b/lib/widgets/auth/known_user_login.dart @@ -319,7 +319,7 @@ class _KnownUserLoginState extends State { } navigateToHome() { - Navigator.of(context).pushNamed(HOME); + Navigator.of(context).pushReplacementNamed(HOME); } showErorrMsg(localMsg) { diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index c59c01d9..487f6be9 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -69,220 +69,232 @@ class _LoginFormState extends State { return Form( key: loginFormKey, - child: Container( - width: SizeConfig.realScreenWidth * 0.90, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - buildSizedBox(), - Padding( - child: AppText( - TranslationBase.of(context).enterCredentials, - fontSize: 18, - fontWeight: FontWeight.w600, - ), - padding: EdgeInsets.only(top: 10, bottom: 10)), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).enterId, - fontWeight: FontWeight.w600, - )), - AppTextFormField( - labelText: '', - borderColor: Colors.white, - // keyboardType: TextInputType.number, - textInputAction: TextInputAction.next, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).enterId, - // 'assets/images/user_id_icon.png'), - validator: (value) { - if (value != null && value.isEmpty) { - return TranslationBase.of(context) - .pleaseEnterYourID; - } - return null; - }, - onSaved: (value) { - if (value != null) userInfo.userID = value.trim(); - }, - onChanged: (value) { - if (value != null) userInfo.userID = value.trim(); - }, - onFieldSubmitted: (_) { - focusPass.nextFocus(); - }, - // onEditingComplete: () {}, - // autofocus: false, - ) - ])), - buildSizedBox(), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).enterPassword, - fontWeight: FontWeight.w600, - )), - AppTextFormField( - focusNode: focusPass, - obscureText: true, - borderColor: Colors.white, - textInputAction: TextInputAction.next, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).enterPassword, - // 'assets/images/password_icon.png'), - validator: (value) { - if (value != null && value.isEmpty) { - return TranslationBase.of(context) - .pleaseEnterPassword; - } - return null; - }, - onSaved: (value) { - userInfo.password = value; - }, - onFieldSubmitted: (_) { - focusPass.nextFocus(); - helpers.showCupertinoPicker(context, projectsList, - 'facilityName', onSelectProject); - }, - onTap: () { - this.getProjects(userInfo.userID); - }, - ) - ])), - buildSizedBox(), - projectsList.length > 0 - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).selectYourProject, - fontWeight: FontWeight.w600, - )), - AppTextFormField( - focusNode: focusProject, - controller: projectIdController, - borderColor: Colors.white, - onTap: () { - helpers.showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject); - }, - // showCursor: false, - // //readOnly: true, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).selectYourProject, - // 'assets/images/password_icon.png'), - validator: (value) { - if (value != null && value.isEmpty) { - return TranslationBase.of(context) - .pleaseEnterYourProject; - } - return null; - }) - ])) - : Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).selectYourProject, - fontWeight: FontWeight.w600, - )), - AppTextFormField( - readOnly: true, borderColor: Colors.white + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.90, + height: SizeConfig.realScreenHeight * 0.65, + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + buildSizedBox(), + Padding( + child: AppText( + TranslationBase.of(context).enterCredentials, + fontSize: 18, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.only(top: 10, bottom: 10)), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).enterId, + fontWeight: FontWeight.w800, + fontSize: 14, + )), + AppTextFormField( + labelText: '', + borderColor: Colors.white, + // keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context).enterId, + // 'assets/images/user_id_icon.png'), + validator: (value) { + if (value != null && value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterYourID; + } + return null; + }, + onSaved: (value) { + if (value != null) userInfo.userID = value.trim(); + }, + onChanged: (value) { + if (value != null) userInfo.userID = value.trim(); + }, + onFieldSubmitted: (_) { + focusPass.nextFocus(); + }, + // onEditingComplete: () {}, + // autofocus: false, + ) + ])), + buildSizedBox(), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).enterPassword, + fontWeight: FontWeight.w800, + fontSize: 14, + )), + AppTextFormField( + focusNode: focusPass, + obscureText: true, + borderColor: Colors.white, + textInputAction: TextInputAction.next, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context).enterPassword, + // 'assets/images/password_icon.png'), + validator: (value) { + if (value != null && value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterPassword; + } + return null; + }, + onSaved: (value) { + userInfo.password = value; + }, + onFieldSubmitted: (_) { + focusPass.nextFocus(); + helpers.showCupertinoPicker(context, projectsList, + 'facilityName', onSelectProject); + }, + onTap: () { + this.getProjects(userInfo.userID); + }, + ) + ])), + buildSizedBox(), + projectsList.length > 0 + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).selectYourProject, + fontWeight: FontWeight.w600, + )), + AppTextFormField( + focusNode: focusProject, + controller: projectIdController, + borderColor: Colors.white, + suffixIcon: Icons.arrow_drop_down, + onTap: () { + helpers.showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject); + }, + // showCursor: false, + // //readOnly: true, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context).selectYourProject, + // 'assets/images/password_icon.png'), + validator: (value) { + if (value != null && value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterYourProject; + } + return null; + }) + ])) + : Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).selectYourProject, + fontWeight: FontWeight.w800, + fontSize: 14, + )), + AppTextFormField( + readOnly: true, borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.arrow_drop_down), + iconSize: 30, + padding: EdgeInsets.only(bottom: 30), + ), + // decoration: buildInputDecoration( // context, // TranslationBase.of(context) // .pleaseEnterYourProject, // 'assets/images/password_icon.png') - - ) - ])), - buildSizedBox(), - - Row( - children: [ - Expanded( - child: Button( - title: TranslationBase.of(context).login, - color: Colors.red[700], - onTap: () { - login(context, authProv, widget.changeLoadingStata); - }, - )), - ], - ) - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // RaisedButton( - // onPressed: () { - // login(context, authProv, widget.changeLoadingStata); - // }, - // textColor: Colors.white, - // elevation: 0.0, - // padding: const EdgeInsets.all(0.0), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10), - // side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))), - // child: Container( - // padding: const EdgeInsets.all(10.0), - // height: 50, - // width: SizeConfig.realScreenWidth * 0.35, - // child: ), - // ) - // ], - // ), - ], - ), + ) + ])), + ]), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: Button( + title: TranslationBase.of(context).login, + color: HexColor('#D02127'), + onTap: () { + login(context, authProv, widget.changeLoadingStata); + }, + )), + ], + ) + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // RaisedButton( + // onPressed: () { + // login(context, authProv, widget.changeLoadingStata); + // }, + // textColor: Colors.white, + // elevation: 0.0, + // padding: const EdgeInsets.all(0.0), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10), + // side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))), + // child: Container( + // padding: const EdgeInsets.all(10.0), + // height: 50, + // width: SizeConfig.realScreenWidth * 0.35, + // child: ), + // ) + // ], + // ), + ], ), ); } diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index cbd2e730..f64221b8 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -155,7 +155,7 @@ class _VerificationMethodsState extends State { child: Row( children: [ Flexible( - flex: 4, + flex: 3, child: ListTile( title: Text( TranslationBase.of( @@ -164,15 +164,17 @@ class _VerificationMethodsState extends State { overflow: TextOverflow .ellipsis, style: TextStyle( - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600, - ), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w800, + fontSize: 14), ), subtitle: AppText( getType( user.logInTypeID, context), + fontSize: 14, ) // Text( // user.editedOn != null @@ -208,6 +210,9 @@ class _VerificationMethodsState extends State { : '--', textAlign: TextAlign.right, + fontSize: 14, + fontWeight: + FontWeight.w800, ), subtitle: AppText( user.editedOn != null @@ -223,6 +228,7 @@ class _VerificationMethodsState extends State { : '--', textAlign: TextAlign.right, + fontSize: 14, ), )) ], @@ -487,8 +493,8 @@ class _VerificationMethodsState extends State { children: [ Image.asset( 'assets/images/verify-whtsapp.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, + height: 60, + width: 60, ), ], ), @@ -497,7 +503,8 @@ class _VerificationMethodsState extends State { ), AppText( TranslationBase.of(context).verifyWhatsApp, - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: 14, + fontWeight: FontWeight.w600, ) ], ), @@ -520,8 +527,8 @@ class _VerificationMethodsState extends State { children: [ Image.asset( 'assets/images/verify-sms.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, + height: 60, + width: 60, ), projectsProvider.isArabic ? SizedBox( @@ -532,9 +539,8 @@ class _VerificationMethodsState extends State { ), AppText( TranslationBase.of(context).verifySMS, - fontSize: projectsProvider.isArabic - ? SizeConfig.textMultiplier * 1.8 - : SizeConfig.textMultiplier * 2.2, + fontSize: 14, + fontWeight: FontWeight.w600, ) ], ), @@ -560,15 +566,16 @@ class _VerificationMethodsState extends State { children: [ Image.asset( 'assets/images/verification_fingerprint_icon.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, + height: 60, + width: 60, ), SizedBox( height: 20, ), AppText( TranslationBase.of(context).verifyFingerprint, - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: 14, + fontWeight: FontWeight.w600, ) ], ), @@ -602,15 +609,16 @@ class _VerificationMethodsState extends State { children: [ Image.asset( 'assets/images/verification_faceid_icon.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, + height: 60, + width: 60, ), SizedBox( height: 20, ), AppText( TranslationBase.of(context).verifyFaceID, - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: 14, + fontWeight: FontWeight.w600, ) ], ), @@ -640,8 +648,8 @@ class _VerificationMethodsState extends State { children: [ Image.asset( 'assets/images/login/more_icon.png', - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, + height: 60, + width: 60, ), projectsProvider.isArabic ? SizedBox( @@ -652,7 +660,8 @@ class _VerificationMethodsState extends State { ), AppText( TranslationBase.of(context).moreVerification, - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: 14, + fontWeight: FontWeight.w600, // textAlign: TextAlign.center, ) ], diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index d705010d..40b24cba 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -35,9 +35,6 @@ class MyScheduleWidget extends StatelessWidget { fontFamily: 'Poppins', // fontSize: 18 ), - SizedBox( - height: 10, - ), AppText( ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', fontSize: 18, diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 9cdda71b..b60ebeb1 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -60,20 +60,8 @@ class SMSOTP { builder: (context) { projectProvider = Provider.of(context); return AlertDialog( - contentPadding: EdgeInsets.fromLTRB(24.0, 20.0, 0.0, 24.0), - title: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.close), - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - ) - ], - ), + contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 0.0, 24.0), + // shape: RoundedRectangleBorder( // borderRadius: BorderRadius.all(Radius.circular(10.0))), content: StatefulBuilder(builder: (context, setState) { @@ -89,21 +77,44 @@ class SMSOTP { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - type == 1 - ? Padding( - child: Icon( - DoctorApp.verify_sms_1, - size: 40, - ), - padding: EdgeInsets.only(bottom: 20), - ) - : Padding( - child: Icon( - DoctorApp.verify_whtsapp, - size: 40, - ), - padding: EdgeInsets.only(bottom: 20), - ), + Padding( + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + type == 1 + ? Padding( + child: Icon( + DoctorApp.verify_sms_1, + size: 40, + ), + padding: EdgeInsets.only(bottom: 20), + ) + : Padding( + child: Icon( + DoctorApp.verify_whtsapp, + size: 40, + ), + padding: EdgeInsets.only(bottom: 20), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 20), + child: IconButton( + icon: Icon(Icons.close), + iconSize: 40, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + )) + ], + ) + ])), Padding( padding: EdgeInsets.only(top: 5), child: AppText( @@ -122,7 +133,7 @@ class SMSOTP { child: Directionality( textDirection: TextDirection.ltr, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( width: SizeConfig.realScreenWidth * 0.15, @@ -233,22 +244,23 @@ class SMSOTP { )), ), ), - Padding( - padding: EdgeInsets.only(top: 10), - child: Row(children: [ - Expanded( - child: AppText( - TranslationBase.of(context).validationMessage + ' ', - fontWeight: FontWeight.w600, - ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).validationMessage + ' ', + fontWeight: FontWeight.w600, + fontSize: 14, ), AppText( displayTime, color: Colors.red, - textAlign: TextAlign.center, + textAlign: TextAlign.start, fontWeight: FontWeight.bold, + fontSize: 14, ) - ])) + ]) ], ))), ); diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 394ea216..75cfbf7c 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -102,14 +102,18 @@ class PatientCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row(children: [ - AppText( - (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Container( + width: 170, + child: AppText( + (Helpers.capitalize(patientInfo.firstName) + + " " + + Helpers.capitalize(patientInfo.lastName)), + fontSize: 16, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), ), patientInfo.gender == 1 ? Icon( @@ -143,7 +147,10 @@ class PatientCard extends StatelessWidget { errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { - return Text('No Image'); + return AppText( + 'No Image', + fontSize: 10, + ); }, )) : SizedBox() diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 1ce84387..ddc41c82 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -282,48 +282,38 @@ class PatientReferralItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: referralStatus != null - ? referralStatus - : "", - style: TextStyle( - color: referralStatus != null - ? referralStatus == 'Pending' - ? Color(0xffc4aa54) - : referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] - : Colors.grey[500], - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: - 2.0 * SizeConfig.textMultiplier)), - ], - ), + AppText( + referralStatus != null ? referralStatus : "", + fontFamily: 'Poppins', + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: referralStatus != null + ? referralStatus == 'Pending' + ? Color(0xffc4aa54) + : referralStatus == 'Accepted' + ? Colors.green[700] + : Colors.red[700] + : Colors.grey[500], ), - //TODO :ask backend to return in the standard format AppText( referredOn, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.1 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Color(0XFF28353E), ) ], ), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: AppText( patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, + color: Colors.black, fontFamily: 'Poppins', ), ), @@ -339,64 +329,68 @@ class PatientReferralItemWidget extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, ), + SizedBox( + width: 4, + ), + AppText( + referredOn, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ) ], ), - SizedBox( - width: 10, - ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Column( - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.patientID.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).fileNumber, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + patientInfo.patientID.toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), ], ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .referredFrom, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: isSameBranch - ? TranslationBase.of(context) - .sameBranch - : TranslationBase.of(context) - .otherBranch, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).referredFrom, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context) + .otherBranch, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], ), - ), - ], + ], + ), ), Row( children: [ @@ -405,7 +399,8 @@ class PatientReferralItemWidget extends StatelessWidget { patient.nationality*/ "Saudi", fontWeight: FontWeight.bold, - fontSize: 12, + color: Color(0xFF2E303A), + fontSize: 1.4 * SizeConfig.textMultiplier, ), /* patient.nationality != null ? ClipRRect( @@ -434,48 +429,51 @@ class PatientReferralItemWidget extends StatelessWidget { ) ], ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of(context).remarks + " : ", - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.remarksFromSource, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks + " : ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), + Expanded( + child: AppText( + patientInfo.remarksFromSource, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 30, - height: 30, + margin: EdgeInsets.only(left: 10, right: 0), + child: Image.asset( + infoIcon != null ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', + height: 50, + width: 30, + ), + ), + Container( margin: EdgeInsets.only( - left: - projectViewModel.isArabic ? 10 : 10 /*10:85*/, - right: - projectViewModel.isArabic ? 10 : 10 /*85:10*/, - top: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom: BorderSide( - color: Colors.grey[400], width: 2.5), - left: BorderSide( - color: Colors.grey[400], width: 2.5), - )), + left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: Container( + width: 40, + height: 40, + child: Image.asset( + 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), ), Expanded( flex: 4, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index bfe8fcad..0b80c788 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -171,7 +171,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Container( child: AppText( convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + patient.appointmentDate ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -281,7 +281,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate.toString(); + return newDate??''; } isToday(date) { diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 4a55435d..e8bc3513 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -15,8 +15,8 @@ import 'package:provider/provider.dart'; import 'large_avatar.dart'; -class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget - with PreferredSizeWidget { +class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with PreferredSizeWidget { + final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -59,7 +59,8 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget } return Container( - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), @@ -80,12 +81,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.2, + patient.firstName != null ? + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier *2.2, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, fontFamily: 'Poppins', @@ -93,13 +94,13 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), gender == 1 ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) + DoctorApp.male_2, + color: Colors.blue, + ) : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), + DoctorApp.female_1, + color: Colors.pink, + ), ]), ), Row(children: [ @@ -121,10 +122,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -162,43 +165,57 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == + if (SERVICES_PATIANT2[ + int.parse(patientType)] == "List_MyOutPatient") Container( child: Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context) + .appointmentDate + " : ", fontSize: 14, ), patient.startTime != null ? Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - patient.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ) + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) : SizedBox(), SizedBox( width: 3.5, ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate.toString() ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + convertDateFormat2(patient.appointmentDate.toString()?? ''), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, ), ), SizedBox( @@ -211,23 +228,34 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig + .textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: + TranslationBase.of( + context) + .fileNumber, style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + fontSize: 12, + fontFamily: + 'Poppins')), new TextSpan( - text: patient.patientId.toString(), + text: patient.patientId + .toString(), style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', fontSize: 14)), ], ), @@ -235,23 +263,32 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget Row( children: [ AppText( - patient.nationalityName ?? patient.nationality, + patient.nationalityName ?? + patient.nationality, fontWeight: FontWeight.bold, fontSize: 12, ), patient.nationality != null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) : SizedBox() ], ) @@ -261,19 +298,26 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, color: Colors.black, fontFamily: 'Poppins', ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", + "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + fontWeight: + FontWeight.w700, + fontSize: 14)), ], ), ), @@ -288,16 +332,14 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget Container( width: 30, height: 30, - margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom: BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), - )), + shape: BoxShape.rectangle, + border: Border( + bottom:BorderSide(color: Colors.grey[400],width: 2.5), + left: BorderSide(color: Colors.grey[400],width: 2.5), + ) + ), ), Expanded( child: Container( @@ -305,16 +347,15 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (doctorName != null && profileUrl != null) - Container( - child: LargeAvatar( - name: doctorName, - url: profileUrl, - ), - width: 25, - height: 25, - margin: EdgeInsets.only(top: 10), + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), Expanded( flex: 4, child: Container( @@ -331,22 +372,31 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget if (orderNo != null && !isPrescriptions) Row( children: [ - Texts('Order No: ', - color: Colors.grey[800], - fontSize: 12), - Texts(orderNo ?? '', fontSize: 12) + Texts( + 'Order No: ', + color: Colors.grey[800], + fontSize: 12 + ), + Texts( + orderNo ?? '',fontSize: 12 + ) ], ), if (invoiceNO != null && !isPrescriptions) Row( children: [ - Texts('Invoice: ', - color: Colors.grey[800], - fontSize: 12), - Texts(invoiceNO, fontSize: 12) + Texts( + 'Invoice: ', + color: Colors.grey[800], + fontSize: 12 + ), + Texts( + invoiceNO, + fontSize: 12 + ) ], ), - if (isPrescriptions && branch != null) + if ( branch != null) Row( children: [ Texts('Branch: ', @@ -356,6 +406,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ], ), if (isPrescriptions) + if(clinic!=null) Row( children: [ Texts('Clinic: ', @@ -384,25 +435,22 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Row( children: [ - if (!isMedicalFile) - Expanded( - child: Texts( - !isPrescriptions - ? 'Result Date: ' - : 'Prescriptions Date ', - color: Colors.grey[800], - fontSize: 12, - ), + Expanded( + child: Texts( + !isPrescriptions? 'Result Date: ': 'Prescriptions Date ', + color: Colors.grey[800], + fontSize: 12, ), + ), Texts( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - fontSize: 14, + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',fontSize: 14, ) ], ) ]), ), ), + ], ), ), @@ -416,7 +464,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate = ""; + String newDate =""; const start = "/Date("; const end = "+0300)"; @@ -427,10 +475,10 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget var date = new DateTime.fromMillisecondsSinceEpoch( int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); } return newDate.toString(); @@ -454,5 +502,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget } @override - Size get preferredSize => Size(double.maxFinite, 290); + Size get preferredSize => Size(double.maxFinite,290); } diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 72f06fb1..d691446e 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -57,7 +57,7 @@ class ProfileWelcomeWidget extends StatelessWidget { CircleAvatar( // radius: (52) child: ClipRRect( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(20), child: Image.network( authProvider.doctorProfile.doctorImageURL, fit: BoxFit.fill, diff --git a/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart b/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart new file mode 100644 index 00000000..dcd0daa1 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/SOAP_step_header.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class SOAPStepHeader extends StatelessWidget { + const SOAPStepHeader({ + Key key, + this.currentIndex, this.changePageViewIndex, + }) : super(key: key); + + final int currentIndex; + final Function changePageViewIndex; + + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createNew, + fontSize: 3 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w500, + ), + AppText(TranslationBase.of(context).episode, + fontSize: 3.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: StepsWidget( + index: currentIndex, + changeCurrentTab: changePageViewIndex, + height: 100,//MediaQuery.of(context).size.height * 0.17, + ), + ), + SizedBox( + height: 30, + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart index 32876539..81bdf613 100644 --- a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -44,7 +44,6 @@ class ExpandableSOAPWidget extends StatelessWidget { if(isRequired) Icon( FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, size: 12, ) ], diff --git a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart index e8c3b831..ce0f6064 100644 --- a/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart @@ -26,13 +26,14 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import '../SOAP_step_header.dart'; import 'examination-item-card.dart'; import 'objective-add-examination-page.dart'; class UpdateObjectivePage extends StatefulWidget { final Function changePageViewIndex; final Function changeLoadingState; - + final int currentIndex; final List mySelectedExamination; final PatiantInformtion patientInfo; @@ -41,7 +42,7 @@ class UpdateObjectivePage extends StatefulWidget { this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, - this.changeLoadingState}); + this.changeLoadingState, this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -108,6 +109,8 @@ class _UpdateObjectivePageState extends State { body: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), + Expanded( child: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 0abc84c7..973c4138 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -24,19 +24,23 @@ class StepsWidget extends StatelessWidget { height: height == 0 ? 150 : height, width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.87, - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), - ), - ), + // child:, ), Positioned( - top: 43, + top: 30 + , + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.9, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + )), + Positioned( + top: 10, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -87,7 +91,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, left: MediaQuery .of(context) .size @@ -143,7 +147,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, left: MediaQuery .of(context) .size @@ -201,7 +205,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -271,7 +275,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -321,7 +325,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, right: MediaQuery .of(context) .size @@ -374,7 +378,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, right: MediaQuery .of(context) .size @@ -432,7 +436,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 43, + top: 10, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart index 68844765..440252fa 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart @@ -1,5 +1,5 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -10,12 +10,14 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -40,30 +42,52 @@ class _UpdateMedicationWidgetState extends State { return Column( children: [ - Container( - child: TextFields( - hintText: TranslationBase.of(context).addMedication, - borderColor: HexColor('#707070'), - borderWidth: 0.30, - fontSize: 13.5, - borderRadius: 12, - onTapTextFields: () { - openMedicationList(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: Color(0xFF2B353E), - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), + InkWell( + onTap: () { + openMedicationList(context); + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), + margin: + EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade400, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(8), + ), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).addMedication}", + fontSize: SizeConfig + .textMultiplier * + 1.8, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ], + )), + Icon( + Icons.add_box_rounded, + size: 25, + ) + ], + ), + ), ), SizedBox( height: 20, @@ -77,6 +101,7 @@ class _UpdateMedicationWidgetState extends State { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, + isDismissible: false, context: context, builder: (context) { return AddMedication( @@ -120,17 +145,20 @@ class _AddMedicationState extends State { String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( + filled: true, + fillColor: Colors.white, + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Colors.grey, width: 0.00), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Colors.grey, width: 0.00), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Colors.grey, width: 0.00), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -152,7 +180,6 @@ class _AddMedicationState extends State { .of(context) .size; return FractionallySizedBox( - heightFactor: 0.7, child: BaseView( onModelReady: (model) async { if (model.medicationStrengthList.length == 0) { @@ -172,388 +199,402 @@ class _AddMedicationState extends State { }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 115, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(top: 40), + child: Column( children: [ - - SizedBox( - height: 16, - ), - AppText( - TranslationBase - .of(context) - .addMedication, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.genericName - : null, - true, - icon: EvaIcons.search), - itemSubmitted: (item) => - setState( - () => _selectedMedication = item), - key: key, - suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - suggestion.description + '/' + - suggestion.genericName), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith(input.toLowerCase()), - ) - : TextField( - minLines: 2, - maxLines: 2, - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.description + - (' (${_selectedMedication - .genericName} )') - : null, - true, - icon: EvaIcons.search), - enabled: false, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 20, color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context) + .addMedication, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), ), - ), - ), - if(isFormSubmitted && _selectedMedication == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - TextFields( - onTapTextFields: model.medicationDoseTimeList != - null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; - - doseController.text = - projectViewModel.isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: doseController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .doseTime, - //TODO add translation - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: doseController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedMedicationDose == null) - CustomValidationError(), SizedBox( - height: 5, - ), - TextFields( - onTapTextFields: model - .medicationStrengthList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationStrengthList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; - - strengthController.text = - projectViewModel.isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; + InkWell( + onTap: () { + Navigator.pop(context); }, - ); - } - : null, - hasLabelText: strengthController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .strength, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: strengthController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), SizedBox( - height: 5, + child: Icon(FontAwesomeIcons.times, + size: 30, color: Color(0xFF2B353E))) + ], ), - if(isFormSubmitted && - _selectedMedicationStrength == null) - CustomValidationError(), + ], + ), + ), + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: + textFieldSelectorDecoration( - SizedBox( - height: 5, - ), + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .genericName + : null, + true, + icon: EvaIcons.search), + itemSubmitted: (item) => setState( + () => + _selectedMedication = item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: Texts(suggestion + .description + + '/' + + suggestion.genericName), + padding: + EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith( + input.toLowerCase()), + ) + : AppTextFieldCustom( + hintText: _selectedMedication != null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context) + .searchMedicineNameHere, + minLines: 2, + maxLines: 2, + enabled: false, + ), + ), + ), + if (isFormSubmitted && + _selectedMedication == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + onClick: model.medicationDoseTimeList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; - TextFields( - onTapTextFields: model - .medicationRouteList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationRouteList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).doseTime, + //TODO add translation + maxLines: 2, + minLines: 2, + isDropDown: true, + controller: doseController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationDose == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isDropDown: true, + onClick: model.medicationStrengthList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationStrengthList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - routeController.text = - projectViewModel.isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: routeController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .route, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: routeController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedMedicationRoute == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - TextFields( - onTapTextFields: model - .medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationFrequencyList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).strength, + // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 2, + controller: strengthController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationStrength == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isDropDown: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - frequencyController.text = - projectViewModel.isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: frequencyController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .frequency, - //TODO add translation - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: frequencyController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - SizedBox( - height: 5, - ), - if(isFormSubmitted && - _selectedMedicationFrequency == null) - CustomValidationError(), - SizedBox( - height: 30, - ), - AppButton( - title: TranslationBase - .of(context) - .add - .toUpperCase(), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != - null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = - widget.medicationController.text + - '${_selectedMedication - .description } (${TranslationBase - .of(context) - .doseTime} ) ${doseController - .text} (${TranslationBase - .of(context) - .strength}) ${strengthController - .text} (${TranslationBase - .of(context) - .route }) ${routeController - .text} (${TranslationBase - .of(context) - .frequency }) ${frequencyController - .text} \n \n'; - Navigator.of(context).pop(); - } - }, - ), - ] + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 2, + minLines: 2, + controller: routeController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationRoute == null) + CustomValidationError(), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + onClick: model.medicationFrequencyList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationFrequencyList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).frequency, + //TODO add translation + enabled: false, + // hintColor: Colors.black, + maxLines: 2, + minLines: 2, + isDropDown: true, + controller: frequencyController, + ), + SizedBox( + height: 5, + ), + if (isFormSubmitted && + _selectedMedicationFrequency == null) + CustomValidationError(), + SizedBox( + height: 30, + ), + ], + )), + ), + ), + ]), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).addMedication.toUpperCase(), + color: Color(0xFF359846), + onPressed: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, ), ), ), - ),), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), ), ); } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 2d475624..6306e069 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -21,10 +22,13 @@ import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjecti import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../SOAP_step_header.dart'; import '../expandable_SOAP_widget.dart'; +import '../steps_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -32,13 +36,14 @@ class UpdateSubjectivePage extends StatefulWidget { final List myAllergiesList; final List myHistoryList; final PatiantInformtion patientInfo; + final int currentIndex; UpdateSubjectivePage( {Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList, - this.patientInfo, this.changeLoadingState}); + this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -231,10 +236,10 @@ class _UpdateSubjectivePageState extends State { widthFactor: 0.9, child: Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 30, - ), + + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context) .chiefComplaints @@ -316,11 +321,11 @@ class _UpdateSubjectivePageState extends State { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( - Radius.circular(10.0), + Radius.circular(0.0), ), border: Border.all( color: HexColor('#707070'), - width: 0.30), + width: 0), ), height: MediaQuery .of(context) @@ -535,3 +540,4 @@ class _UpdateSubjectivePageState extends State { + diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index f5b3def9..475596d4 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -14,6 +14,7 @@ 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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; @@ -28,6 +29,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import 'SOAP_step_header.dart'; import 'custom_validation_error.dart'; class UpdateAssessmentPage extends StatefulWidget { @@ -35,13 +37,13 @@ class UpdateAssessmentPage extends StatefulWidget { List mySelectedAssessmentList; final PatiantInformtion patientInfo; final Function changeLoadingState; - + final int currentIndex; UpdateAssessmentPage( {Key key, this.changePageViewIndex, this.mySelectedAssessmentList, this.patientInfo, - this.changeLoadingState}); + this.changeLoadingState, this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -122,9 +124,7 @@ class _UpdateAssessmentPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox( - height: 30, - ), + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -640,7 +640,8 @@ class _AddAssessmentDetailsState extends State { {IconData icon}) { return InputDecoration( fillColor: Colors.white, - contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), + + contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderRadius: BorderRadius.circular(8), @@ -688,7 +689,8 @@ class _AddAssessmentDetailsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( + + SizedBox( height: 16, ), Row( @@ -763,6 +765,7 @@ class _AddAssessmentDetailsState extends State { .mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration( TranslationBase.of(context) .nameOrICD, diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 5c69a8ae..ad6390ea 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -1,9 +1,8 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.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/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; @@ -13,39 +12,40 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'SOAP_step_header.dart'; + class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; final Function changeLoadingState; - GetPatientProgressNoteResModel patientProgressNote; + + final int currentIndex; + GetPatientProgressNoteResModel patientProgressNote; UpdatePlanPage( {Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, - this.patientProgressNote}); + this.patientProgressNote, + this.currentIndex}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); } class _UpdatePlanPageState extends State { - bool isProgressNoteExpand = false; - + bool isAddProgress = true; TextEditingController progressNoteController = TextEditingController(text: null); @@ -62,7 +62,17 @@ class _UpdatePlanPageState extends State { )), ); } - TextEditingController typeController = TextEditingController(); + + @override + void initState() { + super.initState(); + if(widget.patientProgressNote.planNote !=null ){ + setState(() { + isAddProgress = false; + }); + } + } + @override Widget build(BuildContext context) { @@ -83,7 +93,9 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; - + setState(() { + isAddProgress = false; + }); } widget.changeLoadingState(false); }, @@ -96,241 +108,199 @@ class _UpdatePlanPageState extends State { child: Center( child: FractionallySizedBox( widthFactor: 0.95, - child: Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.all(12.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, + child: Column( + children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), + + SizedBox(height: 10,), + Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.all(12.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .progressNoteSOAP, - variant: isProgressNoteExpand ? "bodyText" : '', - bold: isProgressNoteExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: Colors.black, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isProgressNoteExpand = !isProgressNoteExpand; - }); - }, - child: Icon(isProgressNoteExpand - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 2, - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( - children: [ - if(widget.patientProgressNote.planNote == null) - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).progressNote, - controller: progressNoteController, - minLines: 2, - maxLines: 4, - inputType: TextInputType.multiline, - onChanged: (value){ - // examination.remark = value; - }, - ), - ), - SizedBox( - height: 20, - ), - if ( widget.patientProgressNote.planNote != null) + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - - SizedBox( - height: 8, + margin: EdgeInsets.only(left: 5, right: 5), + child: Texts(TranslationBase + .of(context) + .progressNote)), + if(isAddProgress) + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value){ + widget.patientProgressNote.planNote = value; + }, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + ), + SizedBox( + height: 9, + ), + if ( widget.patientProgressNote.planNote != null&& !isAddProgress) + Container( + margin: + EdgeInsets.only(left: 5, right: 5, ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Appointment No: '), - Texts(widget.patientProgressNote.appointmentNo.toString()), + Row( + children: [ + Texts('Appointment No: ',fontSize: 12,), + Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), + + ], + ), + Texts( + widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight + .w600, + fontSize: 14, + ) ], ), - AppText( - widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .bold, - fontSize: 16, - ) - - ], - ), - Row( - children: [ - Texts('Condition: '), - Texts(widget.patientProgressNote.mName.toString()), + Row( - ], - ), - if(widget.patientProgressNote.createdByName !=null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).createdBy, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.patientProgressNote.createdByName??"", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - if(widget.patientProgressNote.editedByName !=null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).editedBy, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.patientProgressNote.editedByName??"", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Padding( - padding: const EdgeInsets.all(0.0), - child: Container( - width: MediaQuery.of(context) - .size - .width * - 0.6, - child: Texts( - progressNoteController.text, - fontSize: 10, - color: Colors.grey, - ), + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts('Condition: ', + fontSize: 12,), + Texts( + widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), + ], ), + Texts( + widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) + ], + ), + SizedBox(height: 8, ), - ], + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: Texts( + progressNoteController.text, + fontSize: 10, + ), ), - ], - ), - ) + InkWell( + onTap: (){ + setState(() { + isAddProgress = true; + widget.changePageViewIndex(3,isChangeState:false); + }); + }, + child: Icon(DoctorApp.edit,size: 18,)) + ], + ), ], - ) - ]), - isExpand: isProgressNoteExpand, - ), + ), + ) + ], + ), - ], - ), + ], + ), + ), + ], ), ), ), ), bottomSheet: Container( width: double.maxFinite, - height: 70, - child: Container( - margin: EdgeInsets.all(6), - child: Column( - children: [ - - Row( - children: [ - Expanded( - child: AppButton( - title: 'Previous', - color: Colors.white38, - fontColor: Colors.black, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - setState(() { - widget.changePageViewIndex(2); - }); - }, + height: 90, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + margin: EdgeInsets.all(6), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: AppButton( + title: 'Previous', + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w400, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + setState(() { + widget.changePageViewIndex(2); + }); + }, + ), ), - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w700, - loading: model.state == ViewState.BusyLocal, - disabled: progressNoteController.text.isEmpty, - onPressed: () async { - - if(widget.patientProgressNote.planNote.isEmpty) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; - widget.patientProgressNote.editedByName = doctorProfile.doctorName; - widget.patientProgressNote.createdOn = DateTime.now().toString(); - widget.patientProgressNote.planNote = progressNoteController.text; - }); - - } else - submitPlan(model); - }, + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: isAddProgress? TranslationBase.of(context).next: "Finish", + fontWeight: FontWeight.w400, + loading: model.state == ViewState.BusyLocal, + color: Colors.red[700], + disabled: progressNoteController.text.isEmpty, + onPressed: () async { + + if(isAddProgress) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; + widget.patientProgressNote.editedByName = doctorProfile.doctorName; + widget.patientProgressNote.createdOn = DateTime.now().toString(); + widget.patientProgressNote.planNote = progressNoteController.text; + isAddProgress = !isAddProgress; + }); + submitPlan(model); + + } else{ + Navigator.of(context).pop(); + } + }, + ), ), - ), - ], - ), + ], + ), - ], + ], + ), ), ), ), @@ -361,7 +331,7 @@ class _UpdatePlanPageState extends State { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else { - Navigator.of(context).pop(); + widget.changePageViewIndex(4,isChangeState:false); } } else { helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 72c8c714..07f1aef5 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; @@ -6,11 +7,13 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -38,9 +41,13 @@ class _UpdateSoapIndexState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - changePageViewIndex(pageIndex) { - if (pageIndex != _currentIndex) changeLoadingState(true); + changePageViewIndex(pageIndex,{isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) + changeLoadingState(true); _controller.jumpToPage(pageIndex); + setState(() { + _currentIndex = pageIndex; + }); } bool _isLoading = true; @@ -79,6 +86,7 @@ class _UpdateSoapIndexState extends State color: Theme.of(context).scaffoldBackgroundColor), child: Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,), @@ -87,20 +95,10 @@ class _UpdateSoapIndexState extends State height: 1, color: Color(0xffCCCCCC), ), + Container( color: Theme.of(context).scaffoldBackgroundColor, - margin: EdgeInsets.only( - left: MediaQuery.of(context).size.width * 0.05, - right: MediaQuery.of(context).size.width * 0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, - height: MediaQuery.of(context).size.height * 0.20, - ), - ), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.50, + height: MediaQuery.of(context).size.height * 0.73, child: PageView( physics: NeverScrollableScrollPhysics(), controller: _controller, @@ -113,22 +111,26 @@ class _UpdateSoapIndexState extends State children: [ UpdateSubjectivePage( changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList, patientInfo: patient, changeLoadingState: changeLoadingState), UpdateObjectivePage( changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, mySelectedExamination: mySelectedExamination, patientInfo: patient, changeLoadingState: changeLoadingState), UpdateAssessmentPage( changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, mySelectedAssessmentList: mySelectedAssessment, patientInfo: patient, changeLoadingState: changeLoadingState), UpdatePlanPage( changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, patientInfo: patient, patientProgressNote: patientProgressNote, changeLoadingState: changeLoadingState) diff --git a/lib/widgets/shared/app-textfield-custom.dart b/lib/widgets/shared/app-textfield-custom.dart index caeb7ea2..9f671c66 100644 --- a/lib/widgets/shared/app-textfield-custom.dart +++ b/lib/widgets/shared/app-textfield-custom.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'app_texts_widget.dart'; @@ -19,6 +20,7 @@ class AppTextFieldCustom extends StatefulWidget { final int maxLines; final List inputFormatters; final Function(String) onChanged; + final String validationError; AppTextFieldCustom({ this.height = 0, @@ -36,6 +38,7 @@ class AppTextFieldCustom extends StatefulWidget { this.maxLines = 1, this.inputFormatters, this.onChanged, + this.validationError, }); @override @@ -45,80 +48,115 @@ class AppTextFieldCustom extends StatefulWidget { class _AppTextFieldCustomState extends State { @override Widget build(BuildContext context) { - return Container( - height: widget.height != 0 ? widget.height : null, - decoration: widget.hasBorder - ? containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)) - : null, - padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), - child: InkWell( - onTap: widget.onClick ?? null, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if ((widget.controller != null && - widget.controller.text != "") || - widget.dropDownText != null) - AppText( - widget.hintText, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.4, - fontWeight: FontWeight.w600, - ), - widget.dropDownText == null - ? TextField( - textAlign: TextAlign.left, - decoration: textFieldSelectorDecoration( - widget.hintText, null, true), - style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, + return Column( + children: [ + Container( + height: widget.height != 0 ? widget.height + 8 : null, + decoration: widget.hasBorder + ? containerBorderDecoration( + Color(0Xffffffff), + widget.validationError == null + ? Color(0xFFEFEFEF) + : Colors.red.shade700) + : null, + padding: + EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + child: InkWell( + onTap: widget.onClick ?? null, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Container( + padding: widget.dropDownText == null + ? EdgeInsets.symmetric(vertical: 0) + : EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if ((widget.controller != null && + widget.controller.text != "") || + widget.dropDownText != null) + AppText( + widget.hintText, fontFamily: 'Poppins', - color: Colors.grey.shade800, + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, ), - controller: widget.controller, - keyboardType: widget.inputType, - enabled: widget.enabled, - minLines: widget.minLines, - maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], - onChanged: (value) { - if (widget.onChanged != null){ - widget.onChanged(value); - setState(() { - - }); - } - }, - ) - : AppText( - widget.dropDownText, - fontFamily: 'Poppins', - color: Colors.grey.shade800, - fontSize: SizeConfig.textMultiplier * 1.7, - ), - ], - ), + widget.dropDownText == null + ? TextField( + textAlign: TextAlign.left, + decoration: textFieldSelectorDecoration( + widget.hintText, null, true), + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.7, + fontFamily: 'Poppins', + color: Colors.grey.shade800, + ), + controller: widget.controller, + keyboardType: widget.inputType, + enabled: widget.enabled, + minLines: widget.minLines, + maxLines: widget.maxLines, + inputFormatters: widget.inputFormatters != null + ? widget.inputFormatters + : [], + onChanged: (value) { + if (widget.onChanged != null) { + widget.onChanged(value); + setState(() {}); + } + }, + ) + : AppText( + widget.dropDownText, + fontFamily: 'Poppins', + color: Colors.grey.shade800, + fontSize: SizeConfig.textMultiplier * 1.7, + ), + ], + ), + ), + ), + widget.isDropDown + ? widget.suffixIcon != null + ? widget.suffixIcon + : Icon( + Icons.keyboard_arrow_down, + color: widget.dropDownColor != null + ? widget.dropDownColor + : Colors.black, + ) + : Container(), + ], ), - widget.isDropDown - ? widget.suffixIcon != null - ? widget.suffixIcon - : Icon( - Icons.keyboard_arrow_down, - color: widget.dropDownColor != null - ? widget.dropDownColor - : Colors.black, - ) - : Container(), - ], + ), ), - ), + if (widget.validationError != null) + Container( + margin: EdgeInsets.only(top: 8, right: 8, left: 8, bottom: 8), + child: Row( + children: [ + Icon( + DoctorApp.warning, + size: 20, + color: Colors.red.shade700, + ), + SizedBox( + width: 12, + ), + AppText( + widget.validationError, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.red.shade700, + fontWeight: FontWeight.w700, + ), + ], + ), + ), + ], ); } diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 6193204d..ee4e7aaf 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -45,18 +45,36 @@ class _AppDrawerState extends State { flex: 4, child: ListView(padding: EdgeInsets.zero, children: [ Container( - margin: EdgeInsets.symmetric(horizontal: 20), + margin: EdgeInsets.symmetric(horizontal: 15), // height: SizeConfig.heightMultiplier * 50, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: Image.asset( - 'assets/images/dr_app_logo.png', - ), - margin: EdgeInsets.only(top: 10, bottom: 10), + Row( + children: [ + Container( + child: Image.asset( + 'assets/images/dr_app_logo.png', + ), + margin: EdgeInsets.only(top: 10, bottom: 10), + ), + Container( + child: InkWell( + onTap: (){ + Navigator.pop(context); + }, + child: Icon( + DoctorApp.close_1, + size: 20, + ), + ), + margin: EdgeInsets.only(top: 20, bottom: 10), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: 10), + SizedBox(height: 5), if (authProvider.doctorProfile != null) InkWell( onTap: () { @@ -80,7 +98,7 @@ class _AppDrawerState extends State { ), ), Padding( - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.only(top: 0), child: AppText( authProvider.doctorProfile?.clinicDescription, fontWeight: FontWeight.w600, @@ -91,14 +109,11 @@ class _AppDrawerState extends State { ], ), ), - SizedBox(height: 10), + SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase.of(context).rescheduleLeaves, - // " or " + - // TranslationBase.of(context).leaves, - - DoctorApp.reschedule__1, + TranslationBase.of(context).applyOrRescheduleLeave, + icon: DoctorApp.reschedule__1, // subTitle: , ), onTap: () { @@ -111,19 +126,17 @@ class _AppDrawerState extends State { )); }, ), - - SizedBox(height: 10), + SizedBox(height: 15), InkWell( child: DrawerItem( - 'My QR Code', - // " or " + - // TranslationBase.of(context).leaves, - - DoctorApp.qr_code_3, + TranslationBase + .of(context) + .myQRCode, + icon: DoctorApp.qr_code_3, // subTitle: , ), ), - + SizedBox(height: 15), InkWell( child: Container( height: 80, @@ -138,20 +151,25 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: 40, + height: MediaQuery.of(context).size.height * 0.09, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), child: Column( children: [ - - InkWell( child: DrawerItem( - projectsProvider.isArabic - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, - DoctorApp.qr_code), + projectsProvider.isArabic + ? TranslationBase + .of(context) + .lanEnglish + : TranslationBase + .of(context) + .lanArabic, + // icon: DoctorApp.qr_code, + assetLink: projectsProvider.isArabic + ? 'assets/images/usa-flag.png' + : 'assets/images/saudi-arabia-flag.png',), onTap: () { if (projectsProvider.isArabic) projectsProvider.changeLanguage('en'); @@ -159,9 +177,12 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), + SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, DoctorApp.logout_1), + TranslationBase + .of(context) + .logout, icon: DoctorApp.logout_1,), onTap: () async { Navigator.pop(context); await helpers.logout(); @@ -193,13 +214,13 @@ class _AppDrawerState extends State { style: TextStyle( color: Color(0xFF989898), fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: 14, fontFamily: 'Poppins',), children: [ TextSpan(text: ' Cloud Solutions', style: TextStyle( color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 2, + fontSize: 15, fontFamily: 'Poppins',), ) ] diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 0f5673ab..d3b07254 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -37,23 +37,23 @@ class _BottomNavBarState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ BottomNavigationItem( - icon: DoctorApp.home_icon_active, - activeIcon: DoctorApp.home_active, + icon: DoctorApp.home_1, + activeIcon: DoctorApp.home_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 0, name: TranslationBase.of(context).home, ), BottomNavigationItem( - icon: DoctorApp.schedule_icon, - activeIcon: DoctorApp.scdedule_icon_active_1, + icon: DoctorApp.schedule_1, + activeIcon: DoctorApp.schedule_active_1, changeIndex: _changeIndex, index: _index, currentIndex: 1, name: TranslationBase.of(context).mySchedule, ), BottomNavigationItem( - icon: DoctorApp.qr_code, + icon: DoctorApp.qr_reader, activeIcon: DoctorApp.qr_reader_active_1, changeIndex: _changeIndex, index: _index, @@ -61,7 +61,7 @@ class _BottomNavBarState extends State { name: TranslationBase.of(context).qr, ), BottomNavigationItem( - icon: DoctorApp.message_icon, + icon: DoctorApp.dr_reply_1, activeIcon: DoctorApp.dr_reply_active_1, changeIndex: _changeIndex, index: _index, diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 501a354d..e69ff690 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -34,19 +34,10 @@ class BottomNavigationItem extends StatelessWidget { children: [ SizedBox(height: 15,), Container( -// decoration: BoxDecoration(boxShadow: [ -// BoxShadow( -// color: currentIndex == index -// ? Color.fromRGBO(78, 62, 253, 0.4) -// : Color.fromRGBO(78, 62, 253, 0), -// blurRadius: 9.0, -// spreadRadius: -4.0, -// offset: Offset(0.0, 2.0)) -// ]), child: Icon(currentIndex == index ? activeIcon : icon, - /*color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).dividerColor,*/ + color: currentIndex == index + ? Color(0xFF333C45) + : Theme.of(context).dividerColor, size: 22.0), ), SizedBox(height: 5,), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 9ba055fc..df5cbe33 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -82,7 +82,7 @@ class DoctorCard extends StatelessWidget { ], ), Row( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( child: LargeAvatar( @@ -93,74 +93,81 @@ class DoctorCard extends StatelessWidget { height: 55, ), Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - Texts( - 'order No:', - color: Colors.grey[500], - fontSize: 14, - ), - Texts( - orderNo ?? '', - fontSize: 14, - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - 'Invoice:', - fontSize: 14, - color: Colors.grey[500], + if (orderNo != null && !isPrescriptions) + Row( + children: [ + Texts( + 'order No:', + color: Colors.grey[500], + fontSize: 14, + ), + Texts( + orderNo ?? '', + fontSize: 14, + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Invoice:', + fontSize: 14, + color: Colors.grey[500], + ), + Texts( + invoiceNO, + fontSize: 14, + ) + ], + ), + if(clinic!=null) + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[500], + fontSize: 14, + ), + Texts( + clinic, + fontSize: 14, + ) + ], ), - Texts( - invoiceNO, - fontSize: 14, + if(branch!=null) + Row( + children: [ + Texts( + 'Branch: ', + fontSize: 14, + color: Colors.grey[500], + ), + Texts( + branch, + fontSize: 14, + ) + ], ) - ], - ), - if(isPrescriptions) - Row( - children: [ - Texts( - 'Clinic: ', - color: Colors.grey[500], - fontSize: 14, - ), - Texts( - clinic, - fontSize: 14, - ) - ], - ), - if(branch!=null) - Row( - children: [ - Texts( - 'Branch: ', - fontSize: 14, - color: Colors.grey[500], - ), - Texts( - branch, - fontSize: 14, - ) - ], - ) - ]), + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], ), ), - Icon( - EvaIcons.eye, - ) + ], ), ], diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 248123a6..3dcac4c9 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -15,8 +15,9 @@ class DrawerItem extends StatefulWidget { final String subTitle; final IconData icon; final Color color; + final String assetLink; - DrawerItem(this.title, this.icon, {this.color, this.subTitle = ''}); + DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -26,10 +27,17 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0), + margin: EdgeInsets.only(top: 0, bottom: 5, left: 0, right: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(widget.assetLink!=null) + Container( + height: 20, + width: 20, + child: Image.asset(widget.assetLink), + ), + if(widget.assetLink==null) Icon( widget.icon, color: widget.color ?? Colors.black87, @@ -49,16 +57,9 @@ class _DrawerItemState extends State { color:widget.color ??Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w600, ), ), - AppText( - widget.subTitle, - visibility: !widget.subTitle.isNullOrEmpty(), - color: widget.color ?? Colors.black, - marginLeft: 5, - fontSize: SizeConfig.textMultiplier * 2.5, - ), ], ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 7adef404..20d95bcd 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -18,6 +18,12 @@ class HeaderBodyExpandableNotifier extends StatefulWidget { class _HeaderBodyExpandableNotifierState extends State { + + @override + void initState() { + super.initState(); + + } @override Widget build(BuildContext context) { setState(() { @@ -26,7 +32,6 @@ class _HeaderBodyExpandableNotifierState widget.controller.expanded = true; } }); - return ExpandableNotifier( child: Padding( padding: const EdgeInsets.only(left: 0, right: 0), diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index f84db092..f85d2fe6 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -137,14 +137,29 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState items[index]), activeColor: Colors.red[800], onChanged: (bool newValue) { - // setState(() { - // if (widget - // .isServiceSelected(items[index])) { - // widget.removeHistory(items[index]); - // } else { - // widget.addHistory(items[index]); - // } - // }); + setState(() { + if (widget + .isServiceSelected( + items[index])) { + widget.removeAllergy( + items[index]); + } else { + // TODO add Allergy + + MySelectedAllergy + mySelectedAllergy = + new MySelectedAllergy( + selectedAllergy: + items[index], + selectedAllergySeverity: + _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy( + mySelectedAllergy); + } + }); }), InkWell( onTap: () { diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 139b85e8..adba46cd 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,8 +33,13 @@ class NetworkBaseView extends StatelessWidget { break; case ViewState.Error: return Center( - child: DrAppEmbeddedError( - error: baseViewModel.error, + child: Column( + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png',height: 250), + Texts(baseViewModel.error??'') + + ], ), ); break;