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/lib/config/localized_values.dart b/lib/config/localized_values.dart index 19c05230..20cb9ef7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -843,6 +843,10 @@ const Map> localizedValues = { "en": "Step", "ar": "خطوة" }, + "fieldRequired": { + "en": "This field is required", + "ar": "هذه الخانة مطلوبه" + }, "applyOrRescheduleLeave": { "en": "Apply Or Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة" diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 95afd136..c39464bd 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -116,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) { @@ -124,6 +125,7 @@ class _UCAFInputScreenState extends State { _inPatient = newValue; }); }, + activeColor: HexColor("#D02127"), controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), @@ -132,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) { @@ -140,12 +143,12 @@ 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, dropDownText: "3", @@ -170,7 +173,7 @@ class _UCAFInputScreenState extends State { color: Color(0xFFCC9B14), ), SizedBox( - width: 4, + width: 8, ), AppText( "BP (H/L)", @@ -192,7 +195,7 @@ class _UCAFInputScreenState extends State { ], ), SizedBox( - width: 4, + width: 6, ), Expanded( child: Row( @@ -205,7 +208,7 @@ class _UCAFInputScreenState extends State { fontWeight: FontWeight.normal, ), SizedBox( - width: 8, + width: 4, ), Expanded( child: AppText( @@ -222,7 +225,7 @@ class _UCAFInputScreenState extends State { ], ), SizedBox( - height: 4, + height: 2, ), Row( mainAxisAlignment: @@ -231,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}", @@ -258,8 +261,9 @@ class _UCAFInputScreenState extends State { 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, @@ -269,6 +273,7 @@ class _UCAFInputScreenState extends State { .patientFeelsPainInHisBackAndCough, fontFamily: 'Poppins', fontWeight: FontWeight.normal, + color: Color(0xFF575757), fontSize: SizeConfig.textMultiplier * 1.8, ), SizedBox( @@ -292,7 +297,8 @@ 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, @@ -302,6 +308,7 @@ class _UCAFInputScreenState extends State { fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.1, + fontFamily: 'Poppins', ), value: conditionsData[index] ['isChecked'], @@ -319,7 +326,6 @@ class _UCAFInputScreenState extends State { height: 8, ), AppTextFieldCustom( - height: screenSize.height * 0.075, hintText: TranslationBase.of(context).other, dropDownText: "None", enabled: false, @@ -328,7 +334,6 @@ class _UCAFInputScreenState extends State { height: 8, ), AppTextFieldCustom( - height: screenSize.height * 0.075, hintText: TranslationBase.of(context).how, dropDownText: "None", enabled: false, @@ -340,7 +345,6 @@ class _UCAFInputScreenState extends State { children: [ Expanded( child: AppTextFieldCustom( - height: screenSize.height * 0.075, hintText: TranslationBase.of(context).when, dropDownText: "None", @@ -352,7 +356,6 @@ class _UCAFInputScreenState extends State { ), Expanded( child: AppTextFieldCustom( - height: screenSize.height * 0.075, hintText: TranslationBase.of(context).where, dropDownText: "None", @@ -379,7 +382,8 @@ class _UCAFInputScreenState extends State { AppText( TranslationBase.of(context).significantSigns, fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, ), SizedBox( height: 8, diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 58bcbab0..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; @@ -13,7 +22,7 @@ class PageStepperWidget extends StatelessWidget { @override Widget build(BuildContext context) { - double dividerWidth = (screenSize.width / stepsCount) - (5 * stepsCount); + double dividerWidth = (screenSize.width / stepsCount) - (10 * stepsCount); return Container( margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0), @@ -38,6 +47,7 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { + final int index; final bool isInProgress; final bool isFinalStep; @@ -71,24 +81,25 @@ class StepWidget extends StatelessWidget { 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..69886efb 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 @@ -118,14 +118,14 @@ class _AdmissionRequestThirdScreenState hintText: TranslationBase.of(context).clinic, isDropDown: true, 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 +142,7 @@ class _AdmissionRequestThirdScreenState if (model.state == ViewState.Idle && model.clinicList.length > 0) { openListDialogField( - 'clinicGroupName', + projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { 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 b1516ba8..d167ca43 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -36,7 +36,8 @@ class LabsHomePage extends StatelessWidget { builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString() ?? '0', patientType), + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patient.patientType.toString() ?? '0', patientType), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -66,11 +67,24 @@ class LabsHomePage extends StatelessWidget { ], ), ), - if (patientType != null && patientType == '7' && patient.patientStatusType == 43) + if (patientType != null && + patientType == '7' && + patient.patientStatusType == 43) InkWell( onTap: () { - addSelectedLabOrder(context, model, patient); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddSelectedLabOrder( + patient: patient, + model: model, + )), + ); }, + + // () { + // addSelectedLabOrder(context, model, patient); + // }, child: Container( width: double.maxFinite, height: 140, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index d688710f..6c44cde4 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -33,7 +33,8 @@ class RadiologyHomePage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( isShowAppBar: true, // appBarTitle: TranslationBase.of(context).radiology, - appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString() ?? '0', arrivalType), + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patient.patientType.toString() ?? '0', arrivalType), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -62,11 +63,23 @@ class RadiologyHomePage extends StatelessWidget { ], ), ), - if (patientType != null && patientType == '7' && patient.patientStatusType == 43) + if (patientType != null && + patientType == '7' && + patient.patientStatusType == 43) InkWell( onTap: () { - addSelectedRadiologyOrder(context, model, patient); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddSelectedRadiologyOrder( + patient: patient, + model: model, + )), + ); }, + // () { + // addSelectedRadiologyOrder(context, model, patient); + // }, child: Container( width: double.maxFinite, height: 140, @@ -108,26 +121,27 @@ class RadiologyHomePage extends StatelessWidget { ), ), ), - ...List.generate(model.radiologyList.length, (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], - patient: patient, - ), - ), - ), - child: DoctorCard( - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, + ...List.generate( + model.radiologyList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: model.radiologyList[index], + patient: patient, + ), + ), + ), + child: DoctorCard( + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, appointmentDate: model.radiologyList[index].orderDate, ), )), - ], ), ), 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/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 39aed026..31dabcd2 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -343,6 +343,8 @@ class _AddSelectedProcedureState extends State { AppButton( title: TranslationBase.of(context) .addSelectedProcedures, + color: Color(0xff359846), + fontWeight: FontWeight.w700, onPressed: () { //print(entityList.toString()); onPressed: diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 93773c8f..252dce0b 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -142,157 +143,158 @@ class _AddSelectedLabOrderState extends State { onModelReady: (model) => model.getProcedureCategory( categoryName: "Laboratory", categoryID: "02"), builder: (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Row( - children: [ - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ), - ], - ), - Row( - children: [ - AppText( - 'New Lab Order', - fontWeight: FontWeight.w700, - fontSize: 20, + AppScaffold( + isShowAppBar: false, + body: NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'New Lab Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.48, + ), + InkWell( + child: Icon( + Icons.close, + size: 28.0, ), - ], - ), - ], - ), - SizedBox( - height: 10.0, - ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); + onTap: () { + Navigator.pop(context); }, - isEntityListSelected: (master) => - isEntityListSelected(master), - )), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Container( - // child: Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderType), - // Radio( - // activeColor: Color(0xFFB9382C), - // value: 1, - // groupValue: selectedType, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text('routine'), - // Radio( - // activeColor: Color(0xFFB9382C), - // groupValue: selectedType, - // value: 0, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text(TranslationBase.of(context).urgent), - // ], - // ), - // ), - // SizedBox( - // height: 15.0, - // ), - // TextFields( - // hintText: TranslationBase.of(context).remarks, - // controller: remarksController, - // minLines: 3, - // maxLines: 5, - // ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addSelectedProcedures, - color: Color(0xff359846), - onPressed: () { - //print(entityList.toString()); - onPressed: - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); - return; - } + ), + ], + ), + SizedBox( + height: 10.0, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + "Add Lab Order", //TranslationBase.of(context) + fontWeight: FontWeight.w700, + //.addSelectedProcedures, + color: Color(0xff359846), + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), ), - ), - ], - ) - ], + ], + ) + ], + ), ), ), - ), - ); - }), + ); + }), + ), ), ); } diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 9fc76dc4..aa897569 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -142,157 +143,156 @@ class _AddSelectedRadiologyOrderState extends State { onModelReady: (model) => model.getProcedureCategory( categoryName: "Radiology", categoryID: "03"), builder: (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Row( - children: [ - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ), - ], - ), - Row( - children: [ - AppText( - 'New Radiology Order', - fontWeight: FontWeight.w700, - fontSize: 20, + AppScaffold( + isShowAppBar: false, + body: NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'New Radiology Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.48, + ), + InkWell( + child: Icon( + Icons.close, + size: 28.0, ), - ], - ), - ], - ), - SizedBox( - height: 10.0, - ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); + onTap: () { + Navigator.pop(context); }, - isEntityListSelected: (master) => - isEntityListSelected(master), - )), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Container( - // child: Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderType), - // Radio( - // activeColor: Color(0xFFB9382C), - // value: 1, - // groupValue: selectedType, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text('routine'), - // Radio( - // activeColor: Color(0xFFB9382C), - // groupValue: selectedType, - // value: 0, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text(TranslationBase.of(context).urgent), - // ], - // ), - // ), - // SizedBox( - // height: 15.0, - // ), - // TextFields( - // hintText: TranslationBase.of(context).remarks, - // controller: remarksController, - // minLines: 3, - // maxLines: 5, - // ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addSelectedProcedures, - color: Color(0xff359846), - onPressed: () { - //print(entityList.toString()); - onPressed: - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); - return; - } + ), + ], + ), + SizedBox( + height: 10.0, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'Add Radiology Order', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), ), - ), - ], - ) - ], + ], + ) + ], + ), ), ), - ), - ); - }), + ); + }), + ), ), ); } diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 4846c8c9..679739e2 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -74,16 +74,18 @@ class _EntityListCheckboxSearchWidgetState child: Container( margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(8), color: Colors.white), child: ListView( children: [ TextFields( hintText: TranslationBase.of(context).searchProcedures, suffixIcon: EvaIcons.search, + suffixIconColor: Color(0xff2B353E), onChanged: (value) { filterSearchResults(value); }, + hasBorder: false, ), SizedBox( height: 15, @@ -99,7 +101,7 @@ class _EntityListCheckboxSearchWidgetState Checkbox( value: widget.isEntityListSelected( historyInfo), - activeColor: Colors.red[800], + activeColor: Color(0xffD02127), onChanged: (bool newValue) { setState(() { if (widget.isEntityListSelected( @@ -118,6 +120,7 @@ class _EntityListCheckboxSearchWidgetState horizontal: 10, vertical: 0), child: Texts( historyInfo.procedureName, + fontSize: 14.0, variant: "bodyText", bold: true, color: Color(0xff575757)), @@ -130,18 +133,32 @@ class _EntityListCheckboxSearchWidgetState child: Padding( padding: EdgeInsets.symmetric( horizontal: 12), - child: Row( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context) - .orderType, - fontWeight: FontWeight.w700, + Row( + children: [ + Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 11), + child: AppText( + TranslationBase.of( + context) + .orderType, + fontWeight: + FontWeight.w700, + color: Color(0xff2B353E), + ), + ), + ], ), Row( children: [ Radio( activeColor: - Color(0xFFB9382C), + Color(0xFFD02127), value: 0, groupValue: selectedType, onChanged: (value) { @@ -153,10 +170,14 @@ class _EntityListCheckboxSearchWidgetState value.toString(); }, ), - Text('routine'), + AppText( + 'routine', + color: Color(0xff575757), + fontWeight: FontWeight.w600, + ), Radio( activeColor: - Color(0xFFB9382C), + Color(0xFFD02127), groupValue: selectedType, value: 1, onChanged: (value) { @@ -168,9 +189,12 @@ class _EntityListCheckboxSearchWidgetState value.toString(); }, ), - Text(TranslationBase.of( - context) - .urgent), + AppText( + TranslationBase.of(context) + .urgent, + color: Color(0xff575757), + fontWeight: FontWeight.w600, + ), ], ), ], @@ -192,11 +216,13 @@ class _EntityListCheckboxSearchWidgetState }, minLines: 3, maxLines: 5, + borderWidth: 0.5, + borderColor: Colors.grey[500], ), ), + DividerWithSpacesAround(), ], ), - DividerWithSpacesAround(), ], ); }).toList(), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 265c7280..0a0248a6 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1216,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/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 606dccde..ddc41c82 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -455,28 +455,11 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 2, - height: 30, - color: Color(0xFFD9D9D9), - - /* - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom: BorderSide( - color: Color(0xFFD9D9D9), width: 2.5), - left: BorderSide( - color: Color(0xFFD9D9D9), width: 2.5), - )), - */ - ), - Container( - margin: EdgeInsets.only( - left: 0, top: 20, right: 0, bottom: 0), - child: Icon( - Icons.arrow_forward, - color: Color(0xFFD9D9D9), - size: 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( diff --git a/lib/widgets/shared/app-textfield-custom.dart b/lib/widgets/shared/app-textfield-custom.dart index 6c52001b..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.w700, - ), - 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, + ), + ], + ), + ), + ], ); }