diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index daca52b9..a10f0fcc 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -2,13 +2,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; - import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; - import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 89c7c182..902268da 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.d import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; + import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index aabf7b2f..ae394c49 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -446,85 +446,40 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - // height: MediaQuery.of(context) - // .size - // .height * - // 0.02, + color: Colors.white, width: MediaQuery.of(context) .size .width * 0.35, - child: AppTextFieldCustom( - isPrscription: true, - inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), - // WhitelistingTextInputFormatter - // .digitsOnly - ], - hintText: - TranslationBase.of( - context) - .strength, - - // fontWeight: FontWeight.w500, - // fontSize: 14.0, - // borderWidth: 0.2, - - controller: - strengthController, - // keyboardType: TextInputType - // .numberWithOptions( - // decimal: true, - // ), - onChanged: (String value) { - setState(() { - strengthChar = - value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, - ); - } - }, - // onClick: (_) { - // if (_selectedMedication != - // null && - // duration != null && - // frequency != null && - // strengthController - // .text != - // null) { - // model.getBoxQuantity( - // freq: frequency[ - // 'parameterCode'], - // duration: - // duration['id'], - // itemCode: - // _selectedMedication - // .itemId, - // strength: double.parse( - // strengthController - // .text)); - // box = model.boxQuintity; - // - // return; - // } - // }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), + child: TextField( + decoration: + textFieldSelectorDecorationStreangrh( + strengthController + .text, + 'Strength', //strengthController.text, + false), + enabled: true, + controller: + strengthController, + onChanged: + (String value) { + setState(() { + strengthChar = + value.length; + }); + if (strengthChar >= 5) { + DrAppToastMsg + .showErrorToast( + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, + ); + } + }, + keyboardType: TextInputType + .numberWithOptions( + decimal: true, + )), ), SizedBox( width: 5.0, @@ -1394,6 +1349,48 @@ class _PrescriptionFormWidgetState extends State { ); } + InputDecoration textFieldSelectorDecorationStreangrh( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + hintText: selectedText == null || selectedText == "" ? hintText : null, + labelText: + selectedText != null && selectedText != "" ? '\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 15, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } + openDrugToDrug(model) { showModalBottomSheet( context: context,