From 47a350a81152e9a4f9af8d3cb2aff53122ce2c1a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 28 Dec 2020 13:05:40 +0200 Subject: [PATCH] prscription and procedure --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 11 -- lib/util/translations_delegate_base.dart | 8 +- lib/widgets/shared/TextFields.dart | 30 ++++-- lib/widgets/shared/app_buttons_widget.dart | 110 +++++++++----------- lib/widgets/shared/app_text_form_field.dart | 8 +- 6 files changed, 80 insertions(+), 91 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 00ddd293..abf451b8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -113,7 +113,6 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; - // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; @@ -121,7 +120,8 @@ const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f786685a..50d32393 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -276,7 +276,6 @@ const Map> localizedValues = { "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."}, "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}, - 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, @@ -313,7 +312,6 @@ const Map> localizedValues = { 'en': "EXTEND SICK LEAVE", 'ar': 'قم بتمديد الإجازة المرضية' }, - "empty-message": {"en": "Please enter Value", "ar": "يرجى ادخال القيمه"}, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", "ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25" @@ -323,11 +321,6 @@ const Map> localizedValues = { 'en': 'No Prescription Listed', 'ar': 'لا وصفة طبية مدرجة' }, - 'next': {'en': 'Next', 'ar': 'التالي'}, - 'healthRecordInformation': { - 'en': 'HEALTH RECORD INFORMATION', - 'ar': 'معلومات السجل الصحي' - }, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, @@ -360,8 +353,4 @@ const Map> localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, 'route': {'en': 'Route', 'ar': 'المسار'}, - 'noAppointmentsErrorMsg': { - 'en': "There is no appointments for at this date", - 'ar': 'لا توجد مواعيد في هذا التاريخ' - }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 120667b9..59eda9e0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -344,14 +344,11 @@ class TranslationBase { String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; @@ -378,8 +375,7 @@ class TranslationBase { String get reject => localizedValues['reject'][locale.languageCode]; String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; String get noPrescriptionListed => diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 070f97a3..20885eb3 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -146,15 +146,29 @@ class _TextFieldsState extends State { Widget _buildSuffixIcon() { switch (widget.type) { case "password": - { return Padding( - padding: const EdgeInsets.only(right: 8.0), - child: view ? - InkWell(onTap: () {this.setState(() { view= false; });}, child: Icon(EvaIcons.eye, size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) - : - InkWell(onTap: () {this.setState(() { view= true; });}, child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500])) - );} + { + return Padding( + padding: const EdgeInsets.only(right: 8.0), + child: view + ? InkWell( + onTap: () { + this.setState(() { + view = false; + }); + }, + child: Icon(EvaIcons.eye, + size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + : InkWell( + onTap: () { + this.setState(() { + view = true; + }); + }, + child: Icon(EvaIcons.eyeOff, + size: 24.0, color: Colors.grey[500]))); + } - break; + break; default: if (widget.suffixIcon != null) return InkWell( diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index ba04e97d..38a66595 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -6,8 +6,6 @@ import 'package:hexcolor/hexcolor.dart'; import 'app_texts_widget.dart'; class AppButton extends StatefulWidget { - - final GestureTapCallback onPressed; final String title; final IconData icon; @@ -26,14 +24,7 @@ class AppButton extends StatefulWidget { this.fontSize = 2, this.padding = 13, this.loading = false, - this.disabled = false}); - AppButton( - {@required this.onPressed, - this.title, - this.icon, - this.color, - this.fontSize = 2, - this.padding = 13, + this.disabled = false, this.fontColor = Colors.white}); _AppButtonState createState() => _AppButtonState(); @@ -42,58 +33,57 @@ class AppButton extends StatefulWidget { class _AppButtonState extends State { @override Widget build(BuildContext context) { - returnIgnorePointer( - ignoring: widget.loading, - child: RawMaterialButton( - fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Icon( - widget.icon, - color: Colors.white, - ), - if (widget.icon != null) - SizedBox( - width: 5.0, - ), - widget.loading - ? Padding( - padding: EdgeInsets.all(2.6), - child: SizedBox( - height: 19.0, - width: 19.0, - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[300], + return IgnorePointer( + ignoring: widget.loading, + child: RawMaterialButton( + fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Icon( + widget.icon, + color: Colors.white, + ), + if (widget.icon != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[300], + ), + ), ), + ) + : AppText( + widget.title.toUpperCase(), + color: widget.fontColor, + fontSize: SizeConfig.textMultiplier * widget.fontSize, ), - ), - ) - : AppText( - widget.title.toUpperCase(), - color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, - ), - ], + ], + ), ), + onPressed: widget.onPressed, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6))), ), - onPressed: widget.onPressed, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(6))), - ), - ); + ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index 256eff5c..4c2573cd 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -43,8 +43,8 @@ class AppTextFormField extends FormField { keyboardType: textInputType, inputFormatters: [ FilteringTextInputFormatter.allow( - RegExp(inputFormatter)),], - + RegExp(inputFormatter)), + ], onChanged: onChanged ?? (value) { state.didChange(value); @@ -62,8 +62,8 @@ class AppTextFormField extends FormField { labelText: labelText, labelStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, - - ),enabledBorder: OutlineInputBorder( + ), + enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), borderSide: BorderSide( color: borderColor != null