diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 0ba19289..f2d57d5f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -112,8 +112,8 @@ class BaseAppClient { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await helpers.logout(); - helpers.showErrorToast('Your session expired Please login agian'); + await Helpers.logout(); + Helpers.showErrorToast('Your session expired Please login agian'); } if (isAllowAny) { onFailure(getError(parsed), statusCode); @@ -308,7 +308,7 @@ class BaseAppClient { } } if (error == null || error == "null" || error == "null\n") { - return helpers.generateContactAdminMsg(); + return Helpers.generateContactAdminMsg(); } return error; } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 67b3491c..643c719d 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -112,7 +112,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug}) async { + Future getMedicationList({String drug =''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index dd684673..7c94dca9 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -16,7 +16,6 @@ import 'package:flutter/cupertino.dart'; import 'package:doctor_app_flutter/config/config.dart'; import '../../models/doctor/user_model.dart'; -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } class AuthViewModel extends BaseViewModel { diff --git a/lib/core/viewModel/imei_view_model.dart b/lib/core/viewModel/imei_view_model.dart index 16798af5..98419ced 100644 --- a/lib/core/viewModel/imei_view_model.dart +++ b/lib/core/viewModel/imei_view_model.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/service/auth_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; class IMEIViewModel extends BaseViewModel { AuthService _authService = locator(); @@ -25,7 +26,7 @@ class IMEIViewModel extends BaseViewModel { await _authService.login(userInfo); if (_authService.hasError) { error = _authService.error; - helpers.showErrorToast(error); + Helpers.showErrorToast(error); setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 32c3f04a..17a05f11 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; class ListDoctorWorkingHoursTable { @@ -15,7 +16,7 @@ class ListDoctorWorkingHoursTable { }); ListDoctorWorkingHoursTable.fromJson(Map json) { - date = Helpers.convertStringToDate(json['Date']); + date = DateUtils.convertStringToDate(json['Date']); dayName = json['DayName']; workingHours = json['WorkingHours']; projectName = json['ProjectName']; diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index b6c5cc2a..e381901f 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -70,7 +71,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = Helpers.convertStringToDate(json['RequestDate']) ; + requestDate = DateUtils.convertStringToDate(json['RequestDate']) ; requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 48d3dc27..893b49ae 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -1,11 +1,6 @@ -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: - *@return:LabOrdersResModel - *@desc: LabOrdersResModel class - */ -import 'package:doctor_app_flutter/util/helpers.dart'; + + +import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { String setupID; @@ -67,7 +62,7 @@ class LabOrdersResModel { status = json['Status']; createdBy = json['CreatedBy']; createdByN = json['CreatedByN']; - createdOn = Helpers.convertStringToDate(json['CreatedOn']); + createdOn = DateUtils.convertStringToDate(json['CreatedOn']); editedBy = json['EditedBy']; editedByN = json['EditedByN']; editedOn = json['EditedOn']; diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index e18dd546..a9645618 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; class MyReferralPatientModel { @@ -142,7 +143,7 @@ class MyReferralPatientModel { referralResponseOn = json['ReferralResponseOn']; priority = json['Priority']; frequency = json['Frequency']; - mAXResponseTime = Helpers.convertStringToDate(json['MAXResponseTime']); + mAXResponseTime = DateUtils.convertStringToDate(json['MAXResponseTime']); age = json['Age']; frequencyDescription = json['FrequencyDescription']; genderDescription = json['GenderDescription']; diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 9b88279e..30d7cacc 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; class PrescriptionReportForInPatient { @@ -125,7 +126,7 @@ class PrescriptionReportForInPatient { orderNo = json['OrderNo']; patientID = json['PatientID']; pharmacyRemarks = json['PharmacyRemarks']; - prescriptionDatetime = Helpers.convertStringToDate(json['PrescriptionDatetime']); + prescriptionDatetime = DateUtils.convertStringToDate(json['PrescriptionDatetime']); prescriptionNo = json['PrescriptionNo']; processedBy = json['ProcessedBy']; projectID = json['ProjectID']; @@ -138,11 +139,11 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = Helpers.convertStringToDate(json['StartDatetime']) ; + startDatetime = DateUtils.convertStringToDate(json['StartDatetime']) ; status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; - stopDatetime = Helpers.convertStringToDate(json['StopDatetime']); + stopDatetime = DateUtils.convertStringToDate(json['StopDatetime']); unitofMeasurement = json['UnitofMeasurement']; unitofMeasurementDescription = json['UnitofMeasurementDescription']; unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index de96bb45..b0c663b6 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -5,6 +5,7 @@ *@return:VitalSignResModel *@desc: VitalSignResModel class */ +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; class VitalSignResModel { @@ -170,7 +171,7 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? Helpers.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = json['VitalSignDate'] !=null? DateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 2ddb4049..de077495 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -210,7 +210,7 @@ class _QrReaderScreenState extends State { setState(() { isLoading = false; }); - helpers.showErrorToast(error.message); + Helpers.showErrorToast(error.message); //DrAppToastMsg.showErrorToast(error); }); } diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 17cbd586..4387f28f 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.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'; @@ -89,34 +90,6 @@ class DoctorReplayChat extends StatelessWidget { color: Color(0xFF2B353E))) ], ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // InkWell( - // onTap: () { - // // TODO: move to doctor profile - // }, - // child: RichText( - // text: TextSpan( - // style: TextStyle( - // fontSize: 1.6 * - // SizeConfig.textMultiplier, - // color: Colors.black), - // children: [ - // new TextSpan( - // text: - // 'Tap here to view patient profile' - // .toString(), - // style: TextStyle( - // fontFamily: 'Poppins', - // fontSize: 12)), - // ], - // ), - // ), - // ), - // ], - // ), ], ), ), @@ -234,91 +207,6 @@ class DoctorReplayChat extends StatelessWidget { ), ), SizedBox(height: 30,), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Container( - // // color: Color(0xFF2B353E), - // width: MediaQuery.of(context).size.width * 0.8, - // padding: EdgeInsets.all(5), - // decoration: BoxDecoration( - // color: Colors.white,// Color(0xFF2B353E), - // borderRadius: BorderRadius.all( - // Radius.circular(10.0), - // ), - // border: Border.all( - // color: HexColor('#707070') , - // width: 0.30), - // ), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Container( - // margin: EdgeInsets.only(top: 5), - // width: 60, - // height: 60, - // child: Image.asset( - // 1 == 1 - // ? 'assets/images/male_avatar.png' - // : 'assets/images/female_avatar.png', - // fit: BoxFit.cover, - // ), - // ), - // Column( - // children: [ - // AppText( - // "07 Jan 2021", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // fontFamily: 'Poppins', - // color: Color(0xFF2B353E), - // // fontSize: 18 - // ), - // AppText( - // "07:00 PM", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // fontFamily: 'Poppins', - // color: Color(0xFF2B353E), - // // fontSize: 18 - // ), - // ], - // ), - // ], - // ), - // SizedBox( - // height: 10, - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Column( - // children: [ - // Padding( - // padding: const EdgeInsets.all(8.0), - // child: Container( - // width: MediaQuery.of(context).size.width * 0.7, - // child: AppText( - // "This procedure should be taken only when the patient is below 99o", - // fontSize: 15, - // fontFamily: 'Poppins', - // color: Color(0xFF2B353E), - // // fontSize: 18 - // ), - // ), - // ), - // ], - // ), - // ], - // ), - // ], - // ), - // ), - // ], - // ), ], ), ), @@ -341,11 +229,6 @@ class DoctorReplayChat extends StatelessWidget { child: TextFields( borderRadius: 0, - // hasLabelText: msgController.text != '' - // ? true - // : false, - // showLabelText: false, - // padding: EdgeInsets.all(0.3), hintText: TranslationBase .of(context) .typeHereToReply, @@ -357,7 +240,7 @@ class DoctorReplayChat extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(context); await model.replay(msgController.text, reply); if(model.state == ViewState.ErrorLocal) { - helpers.showErrorToast("An error happened while you are replaying"); + Helpers.showErrorToast("An error happened while you are replaying"); } else { DrAppToastMsg.showSuccesToast("Thank you for your replay "); await previousModel.getDoctorReply(); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2504b59f..b18e6f76 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -679,7 +679,7 @@ class _HomeScreenState extends State { // model.getDashboard(); }).catchError((err) { changeIsLoading(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index f6d011a7..660a6827 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -96,7 +96,7 @@ class _VideoCallPageState extends State { connectOpenTok(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } @override @@ -307,7 +307,7 @@ class _VideoCallPageState extends State { .then((result) { connectOpenTok(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCall() { @@ -317,7 +317,7 @@ class _VideoCallPageState extends State { .then((result) { print(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCallWithCharge() { @@ -328,7 +328,7 @@ class _VideoCallPageState extends State { print('end callwith charge'); print(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } closeRoute() { diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 9f12e8b7..30a7b9b4 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -786,7 +786,7 @@ class _MedicalFileDetailsState extends State { 'Order Date: ', ), AppText( - Helpers.getDateFormatted( + DateUtils.getDateFormatted( DateTime .parse( model diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 9dea3448..7325cd37 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_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_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; @@ -242,12 +242,12 @@ class _MedicineSearchState extends State { searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { - helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); //"Type Medicine Name") return; } if (myController.text.length < 3) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); return; } diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 51750e38..fe87e59a 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -17,7 +17,7 @@ import '../../lookups/patient_lookup.dart'; import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; -import '../../widgets/shared/app_text_form_field.dart'; +import '../../widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; @@ -86,7 +86,7 @@ class _PatientSearchScreenState extends State { ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && _selectedType == "6")) { - // helpers.showErrorToast("Please Choose The Dates"); + // Helpers.showErrorToast("Please Choose The Dates"); } else { setState(() { isFormSubmitted = false; @@ -111,7 +111,7 @@ class _PatientSearchScreenState extends State { handelCatchErrorCase(err) { //isLoading = false; //isError = true; - error = helpers.generateContactAdminMsg(err); + error = Helpers.generateContactAdminMsg(err); //notifyListeners(); throw err; } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0209991b..adfb1c8c 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -13,13 +13,11 @@ import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.dart'; 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/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -689,12 +687,12 @@ class _PatientsScreenState extends State { }); GifLoaderDialogUtils.hideDialog(context); }).catchError((error) { - helpers.showErrorToast(error.toString()); + Helpers.showErrorToast(error.toString()); GifLoaderDialogUtils.hideDialog(context); }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index fa94d3fa..c92eb066 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -9,7 +9,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/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-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/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'; @@ -282,7 +282,7 @@ class _UCAFInputScreenState extends State { AppTextFieldCustom( hintText: TranslationBase.of(context).instruction, - dropDownText: helpers.parseHtmlString(model + dropDownText: Helpers.parseHtmlString(model .patientChiefComplaintList[0] .chiefComplaint), controller: _additionalComplaintsController, 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 876066ce..054c1d8f 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 @@ -11,7 +11,7 @@ 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-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/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'; @@ -122,7 +122,7 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).clinic, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: clinicError, dropDownText: _selectedClinic != null ? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] @@ -172,7 +172,7 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, - isDropDown: true, + isTextFieldHasSuffix: true, dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, @@ -280,7 +280,7 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).dietType, - isDropDown: true, + isTextFieldHasSuffix: true, dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : 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 bf896145..145017d0 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 @@ -13,7 +13,7 @@ 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-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/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'; @@ -115,7 +115,7 @@ class _AdmissionRequestThirdScreenState ? _selectedDiagnosis['nameEn'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: diagnosisError, onClick: model.diagnosisTypesList != null && model.diagnosisTypesList.length > 0 @@ -161,7 +161,7 @@ class _AdmissionRequestThirdScreenState ? _selectedIcd['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: icdError, onClick: model.icdCodes != null && model.icdCodes.length > 0 @@ -209,7 +209,7 @@ class _AdmissionRequestThirdScreenState ? _selectedDiagnosisType['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: diagnosisTypeError, onClick: model.listOfDiagnosisSelectionTypes != 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 a4aebc9f..6f63c194 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 @@ -14,7 +14,7 @@ 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-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/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'; @@ -203,7 +203,7 @@ class _AdmissionRequestSecondScreenState ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: expectedDatesError, suffixIcon: Icon( Icons.calendar_today, @@ -231,7 +231,7 @@ class _AdmissionRequestSecondScreenState ? _selectedFloor['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: floorError, onClick: model.floorList != null && model.floorList.length > 0 @@ -281,7 +281,7 @@ class _AdmissionRequestSecondScreenState ? _selectedWard['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, onClick: model.wardList != null && model.wardList.length > 0 ? () { @@ -331,7 +331,7 @@ class _AdmissionRequestSecondScreenState ? _selectedRoomCategory['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: roomError, onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0 @@ -423,7 +423,7 @@ class _AdmissionRequestSecondScreenState ? _selectedAdmissionType['nameEn'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: admissionTypeError, onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0 diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart index 75e4c33b..119d7666 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; 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/large_avatar.dart'; @@ -241,7 +242,7 @@ class _LabOrdersScreenState extends State { ), Expanded( child: AppText( - '${Helpers.getDate(model + '${DateUtils.getDate(model .patientLabResultOrdersList[index] .createdOn)}', fontSize: 2.0 * diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index 5ca818bf..0dbd0eb1 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -97,11 +98,11 @@ class _InpatientPrescriptionDetailsScreenState key: 'UOM'), buildTableRow( des: - '${Helpers.getDate(prescription.startDatetime)}', + '${DateUtils.getDate(prescription.startDatetime)}', key: 'Start Date'), buildTableRow( des: - '${Helpers.getDate(prescription.stopDatetime)}', + '${DateUtils.getDate(prescription.stopDatetime)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', @@ -116,7 +117,7 @@ class _InpatientPrescriptionDetailsScreenState key: 'Pharmacy Remarks'), buildTableRow( des: - '${Helpers.getDate(prescription.prescriptionDatetime)}', + '${DateUtils.getDate(prescription.prescriptionDatetime)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index ffa1608a..3e4340f5 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index c27a5c46..3297a405 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget 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/user-guid/text_fields/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'; @@ -242,7 +242,7 @@ class _PatientMakeReferralScreenState extends State { hintText: TranslationBase.of(context).branch, dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: branchError, onClick: referToList != null ? () { @@ -295,7 +295,7 @@ class _PatientMakeReferralScreenState extends State { ? _selectedBranch['facilityName'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: hospitalError, onClick: model.branchesList != null && model.branchesList.length > 0 && @@ -343,7 +343,7 @@ class _PatientMakeReferralScreenState extends State { ? _selectedClinic['ClinicDescription'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: clinicError, onClick: _selectedBranch != null && model.clinicsList != null && @@ -393,7 +393,7 @@ class _PatientMakeReferralScreenState extends State { dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: doctorError, onClick: _selectedClinic != null && model.doctorsList != null && @@ -441,7 +441,7 @@ class _PatientMakeReferralScreenState extends State { ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, suffixIcon: Icon( Icons.calendar_today, color: Colors.black, diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a2083bd9..0e642a10 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.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'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +// import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; @@ -13,13 +13,16 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/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/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -75,22 +78,29 @@ class _AddAssessmentDetailsState extends State { icdNameController.text = widget.mySelectedAssessment.selectedICD.code; } InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( + String hintText, String selectedText, bool isDropDown , + + {IconData icon, String validationError}) { + return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderSide: BorderSide(color: (validationError != null + ? Colors.red.shade700 + :Color(0xFFEFEFEF)) , width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderSide: BorderSide(color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderSide: BorderSide(color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -139,10 +149,10 @@ class _AddAssessmentDetailsState extends State { Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: AppTextFieldCustom( - height: 55.0, + // height: 55.0, hintText: TranslationBase.of(context).appointmentNumber, - isDropDown: false, + isTextFieldHasSuffix: false, enabled: false, controller: appointmentIdController, ), @@ -164,47 +174,45 @@ class _AddAssessmentDetailsState extends State { child: widget .mySelectedAssessment.selectedICD == null - ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - widget.mySelectedAssessment - .selectedICD != - null - ? widget.mySelectedAssessment - .selectedICD.nameEn - : null, - true, - icon: Icons.keyboard_arrow_down), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts(suggestion - .description + - " / " + - suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ) + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + widget.mySelectedAssessment.selectedICD == null, + child:AutoCompleteTextField( + + decoration: TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context) + .nameOrICD, null, true, suffixIcon: Icons.search), + + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text = '${item.code.trim()}/${item.description}'; + }), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts(suggestion + .description + + " / " + + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.code + .toLowerCase() + .startsWith( + input.toLowerCase()), + ), + ) : AppTextFieldCustom( onClick: model.listOfICD10 != null ? () { @@ -220,19 +228,16 @@ class _AddAssessmentDetailsState extends State { maxLines: 2, minLines: 1, controller: icdNameController, - enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: Icon(Icons.search,color: Colors.grey.shade600,), ) ), ), - if (isFormSubmitted && - widget.mySelectedAssessment.selectedICD == null) - CustomValidationError(), SizedBox( height: 7, ), AppTextFieldCustom( - height: 55.0, onClick: model.listOfDiagnosisCondition != null ? () { MasterKeyDailog dialog = MasterKeyDailog( @@ -271,19 +276,20 @@ class _AddAssessmentDetailsState extends State { maxLines: 2, minLines: 1, controller: conditionController, - isDropDown: true, + isTextFieldHasSuffix: true, enabled: false, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == null?TranslationBase + .of(context) + .emptyMessage:null, ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null) - CustomValidationError(), + SizedBox( height: 10, ), AppTextFieldCustom( - height: 55.0, onClick: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( @@ -315,40 +321,30 @@ class _AddAssessmentDetailsState extends State { maxLines: 2, minLines: 1, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == null?TranslationBase + .of(context) + .emptyMessage:null, ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null) - CustomValidationError(), SizedBox( height: 10, ), Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( + child: AppTextFieldCustom( hintText: TranslationBase.of(context).remarks, - fontSize: 13.5, - fontWeight: FontWeight.w600, maxLines: 18, minLines: 5, - hasLabelText: - remarkController.text != '' ? true : false, - showLabelText: true, controller: remarkController, onChanged: (value) { widget.mySelectedAssessment.remark = remarkController.text; }, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), + ), ), SizedBox( height: 10, @@ -458,7 +454,7 @@ class _AddAssessmentDetailsState extends State { } if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 7a42fe79..309df861 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.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/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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -496,7 +497,7 @@ class _UpdateAssessmentPageState extends State { loading: model.state == ViewState.BusyLocal, onPressed: () async { if (widget.mySelectedAssessmentList.isEmpty) { - helpers.showErrorToast( + Helpers.showErrorToast( TranslationBase .of(context) .assessmentErrorMsg); diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 82cef2e9..ea933cee 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 941b60ca..a3d5ed9b 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/material.dart'; @@ -43,7 +43,7 @@ class _ExaminationsListSearchWidgetState AppTextFieldCustom( height: MediaQuery.of(context).size.height * 0.080, hintText: TranslationBase.of(context).searchExamination, - isDropDown: true, + isTextFieldHasSuffix: true, hasBorder: false, controller: filteredSearchController, onChanged: (value) { diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index abb62808..0e9ada40 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -2,8 +2,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.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'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -11,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model. import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -131,9 +130,14 @@ class _UpdateObjectivePageState extends State { }).toList(), ) ], + ), isExpanded: isSysExaminationExpand, ), + SizedBox(height: MediaQuery + .of(context) + .size + .height * 0.12,) ], ), ), @@ -250,14 +254,14 @@ class _UpdateObjectivePageState extends State { } if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else { widget.changeLoadingState(true); widget.changePageViewIndex(2); } } else { - helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } } diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 6f57ceb8..b99aea6e 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -13,7 +13,7 @@ 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/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/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:flutter/material.dart'; @@ -85,7 +85,7 @@ class _UpdatePlanPageState extends State { await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = helpers + progressNoteController.text = Helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); widget.patientProgressNote.planNote = progressNoteController.text; widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; @@ -303,7 +303,7 @@ class _UpdatePlanPageState extends State { Navigator.of(context).pop(); } } else { - helpers.showErrorToast(TranslationBase.of(context) + Helpers.showErrorToast(TranslationBase.of(context) .progressNoteErrorMsg); } }, @@ -342,12 +342,12 @@ class _UpdatePlanPageState extends State { } if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else { widget.changePageViewIndex(4,isChangeState:false); } } else { - helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index c1cbcd28..02985823 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -207,7 +208,7 @@ class _AddAllergiesState extends State { addAllergyLocally(MySelectedAllergy mySelectedAllergy) { if (mySelectedAllergy.selectedAllergy == null) { - helpers.showErrorToast(TranslationBase + Helpers.showErrorToast(TranslationBase .of(context) .requiredMsg); } else { diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index ff88718e..6aeadfbc 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -187,7 +188,7 @@ class _UpdateAllergiesWidgetState extends State { changeParentState(); Navigator.of(context).pop(); } else { - helpers.showErrorToast(TranslationBase + Helpers.showErrorToast(TranslationBase .of(context) .requiredMsg); } diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index cdc6cad5..e0e64288 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/new_text_Field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -35,33 +36,28 @@ class UpdateChiefComplaints extends StatelessWidget { height: 20, ), //TODO handel error cases - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase.of(context).addChiefComplaints, controller: complaintsController, maxLines: 25, - minLines: 3, - ), + minLines: 7, + hasBorder: true, + validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null , - Container( - child: CustomValidationError( - error: complaintsControllerError, - )), + ), SizedBox( height: 20, ), - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase .of(context) .historyOfPresentIllness, controller: illnessController, maxLines: 25, - minLines: 3, - ), - Container( - child: CustomValidationError(error: illnessControllerError,)), - SizedBox( - height: 20, + minLines: 7, + hasBorder: true, + validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , ), SizedBox( height: 10, @@ -72,16 +68,17 @@ class UpdateChiefComplaints extends StatelessWidget { SizedBox( height: 10, ), - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase .of(context) .currentMedications, controller: medicationController, - maxLines: 25, - minLines: 3, + maxLines: 25, + minLines: 7, + hasBorder: true, + validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null , + ), - Container(child: CustomValidationError( - error: medicationControllerError,)), SizedBox( height: 10, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 3b96cd65..867e8d11 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -8,11 +8,13 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_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/shared/Text.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/dialogs/master_key_dailog.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -45,47 +47,13 @@ class _AddMedicationState extends State { GetMedicationResponseModel _selectedMedication; GlobalKey key = - new GlobalKey>(); + new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration( - 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: 0.00), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 0.00), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 0.00), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 10, - color: Theme - .of(context) - .hintColor, - fontWeight: FontWeight.w700 - ), - ); - } - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery - .of(context) - .size; + final screenSize = MediaQuery.of(context).size; return FractionallySizedBox( child: BaseView( onModelReady: (model) async { @@ -136,7 +104,7 @@ class _AddMedicationState extends State { height: 16, ), Container( - height: screenSize.height * 0.070, + // height: screenSize.height * 0.070, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -146,48 +114,55 @@ class _AddMedicationState extends State { } : 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()), + + CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + _selectedMedication ==null, + child: AutoCompleteTextField< + GetMedicationResponseModel>( + + decoration: + TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, null, true, suffixIcon: Icons.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 @@ -198,13 +173,12 @@ class _AddMedicationState extends State { .searchMedicineNameHere, minLines: 2, maxLines: 2, + isTextFieldHasSuffix: true, + suffixIcon: Icon(Icons.search,color: Colors.grey.shade600,), enabled: false, ), ), ), - if (isFormSubmitted && - _selectedMedication == null) - CustomValidationError(), SizedBox( height: 5, ), @@ -231,6 +205,7 @@ class _AddMedicationState extends State { .nameEn; }); }, + ); showDialog( barrierDismissible: false, @@ -245,21 +220,19 @@ class _AddMedicationState extends State { TranslationBase.of(context).doseTime, maxLines: 2, minLines: 2, - isDropDown: true, + isTextFieldHasSuffix: true, controller: doseController, + validationError:isFormSubmitted && + _selectedMedicationDose == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationDose == null) - CustomValidationError(), - SizedBox( - height: 5, - ), AppTextFieldCustom( enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, onClick: model.medicationStrengthList != null ? () { MasterKeyDailog dialog = @@ -296,19 +269,20 @@ class _AddMedicationState extends State { maxLines: 2, minLines: 2, controller: strengthController, + validationError:isFormSubmitted && + _selectedMedicationStrength == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationStrength == null) - CustomValidationError(), SizedBox( height: 5, ), AppTextFieldCustom( enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, onClick: model.medicationRouteList != null ? () { MasterKeyDailog dialog = @@ -344,13 +318,14 @@ class _AddMedicationState extends State { maxLines: 2, minLines: 2, controller: routeController, + validationError:isFormSubmitted && + _selectedMedicationRoute == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationRoute == null) - CustomValidationError(), SizedBox( height: 5, ), @@ -391,15 +366,16 @@ class _AddMedicationState extends State { enabled: false, maxLines: 2, minLines: 2, - isDropDown: true, + isTextFieldHasSuffix: true, controller: frequencyController, + validationError:isFormSubmitted && + _selectedMedicationFrequency == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationFrequency == null) - CustomValidationError(), SizedBox( height: 30, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index d78c8c45..c6fc5253 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,4 +1,3 @@ -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/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -15,6 +14,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -208,7 +208,7 @@ class _UpdateSubjectivePageState extends State { await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = helpers.parseHtmlString( + complaintsController.text = Helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; @@ -376,19 +376,19 @@ class _UpdateSubjectivePageState extends State { complaintsController.text.length > 25) { await postChiefComplaint(model: model); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } if (myHistoryList.length != 0) { await postHistories(model: model, myHistoryList: myHistoryList); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } if (myAllergiesList.length != 0) { await postAllergy(myAllergiesList: myAllergiesList, model: model); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } widget.changeLoadingState(true); @@ -419,7 +419,7 @@ class _UpdateSubjectivePageState extends State { .emptyMessage; } }); - helpers.showErrorToast(TranslationBase + Helpers.showErrorToast(TranslationBase .of(context) .chiefComplaintErrorMsg); } @@ -470,7 +470,7 @@ class _UpdateSubjectivePageState extends State { await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } @@ -501,7 +501,7 @@ class _UpdateSubjectivePageState extends State { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 67c483a8..397e1a60 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -20,7 +20,7 @@ import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.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_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.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/loader/gif_loader_dialog_utils.dart'; @@ -83,7 +83,7 @@ postProcedure( await model.postPrescription(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); DrAppToastMsg.showSuccesToast('Medication has been added'); @@ -715,7 +715,7 @@ class _PrescriptionFormWidgetState extends State { }); if (route == null) { - helpers.showErrorToast( + Helpers.showErrorToast( 'plase fill'); } }, @@ -1556,12 +1556,12 @@ class _PrescriptionFormWidgetState extends State { searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); // if (myController.text.isEmpty()) { - // helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + // Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); // //"Type Medicine Name") // return; // } if (myController.text.length < 3) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); return; } diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a92f5365..b798418e 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -30,6 +30,7 @@ class PrescriptionItemsPage extends StatelessWidget { model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 18655e65..3d846515 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -3,6 +3,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/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; @@ -227,7 +228,7 @@ class _NewPrescriptionScreenState extends State { 13.5, ), AppText( - Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -250,7 +251,7 @@ class _NewPrescriptionScreenState extends State { .green, ), AppText( - Helpers.getTimeFormated(DateTime.parse(model + DateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -290,7 +291,7 @@ class _NewPrescriptionScreenState extends State { Expanded( child: AppText( - Helpers.getDateFormatted(DateTime.parse(model + DateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index 940cfc2a..d7b3e4fc 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -3,6 +3,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/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; @@ -128,7 +129,7 @@ class _NewPrescriptionHistoryScreenState 13.5, ), AppText( - Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -151,7 +152,7 @@ class _NewPrescriptionHistoryScreenState .green, ), AppText( - Helpers.getTimeFormated(DateTime.parse(model + DateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -190,7 +191,7 @@ class _NewPrescriptionHistoryScreenState Expanded( child: AppText( - Helpers.getDateFormatted(DateTime.parse(model + DateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart index 44bcab0c..f5773af8 100644 --- a/lib/screens/prescription/prescription_warnings.dart +++ b/lib/screens/prescription/prescription_warnings.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 7c1bc88e..27c56ed0 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -666,7 +666,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: Helpers .textFieldSelectorDecoration( - Helpers.getDateFormatted( + DateUtils.getDateFormatted( DateTime.parse( widget.startDate)), selectedDate != null @@ -1005,7 +1005,7 @@ class _UpdatePrescriptionFormState extends State { updatePrescriptionReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('Medication has been updated'); } diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 8fe7deea..92a74e77 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.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'; @@ -75,22 +76,22 @@ postProcedure( await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { - helpers.showErrorToast( + Helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); } } } else { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 29f01858..92f62746 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.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'; @@ -75,22 +76,22 @@ postProcedure( await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getLabs(patient); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getLabs(patient); } else if (model.state == ViewState.Idle) { - helpers.showErrorToast( + Helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); } } } else { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 9e614d44..1dd30467 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.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'; @@ -75,22 +76,22 @@ postProcedure( await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { - helpers.showErrorToast( + Helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); } } } else { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 0ccbc1e6..d9e8d8ab 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -170,7 +170,7 @@ class ProcedureScreen extends StatelessWidget { limetNo: model.procedureList[0].entityList[index] .lineItemNo); // } else - // helpers.showErrorToast( + // Helpers.showErrorToast( // 'You Cant Update This Procedure'); }, patient: patient, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index d9c6a20a..e1da3739 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_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/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -410,7 +411,7 @@ class _UpdateProcedureWidgetState extends State { mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been updated'); diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e2959c75..3ab34bea 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -11,12 +11,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/text_validator.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/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 0e1a8491..e05f6046 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -10,13 +10,12 @@ import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/text_validator.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/shared/Text.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_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index d55675c3..c4f187c5 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -320,4 +320,36 @@ class DateUtils { return false; } + + static String getDate(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + "," + + dateTime.year.toString(); + else + return ""; + } + + static String getDateFormatted(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return dateTime.day.toString() + + "/" + + dateTime.month.toString() + + "/" + + dateTime.year.toString(); + else + return ""; + } + + static String getTimeFormated(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return dateTime.hour.toString() + ":" + dateTime.minute.toString(); + else + return ""; + } } diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index bf91a11f..a8d2fc53 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -33,7 +33,7 @@ class DrAppToastMsg { textColor: Colors.white); } - void showShortToast(msg) { + static void showShortToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, @@ -50,7 +50,7 @@ class DrAppToastMsg { timeInSeconds: 1); } - void showCenterShortToast(msg) { + static void showCenterShortToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, @@ -59,7 +59,7 @@ class DrAppToastMsg { timeInSeconds: 1); } - void showCenterShortLoadingToast(msg) { + static void showCenterShortLoadingToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_LONG, @@ -72,7 +72,7 @@ class DrAppToastMsg { timeInSeconds: 2); } - void cancelToast(msg) { + static void cancelToast(msg) { FlutterFlexibleToast.cancel(); } } diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index 1c79f01c..26e49670 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,7 +1,3 @@ -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Extension for all classes objects. - extension Extension on Object { bool isNullOrEmpty() => this == null || this == ''; diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 6a57bcfa..97af8ef0 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -18,27 +18,11 @@ import 'dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: - *@return: - *@desc: This class will contian some Function will help developer - */ class Helpers { - int cupertinoPickerIndex = 0; + static int cupertinoPickerIndex = 0; get currentLanguage => null; - -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: context, items, decKey, onSelectFun - *@return: Container Widget - *@desc: showCupertinoPicker its a general function to show cupertino picker - */ - showCupertinoPicker(context, items, decKey, onSelectFun) { + static showCupertinoPicker(context, items, decKey, onSelectFun) { showModalBottomSheet( isDismissible: false, context: context, @@ -86,23 +70,14 @@ class Helpers { }); } - TextStyle textStyle(context) => + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: context, List items, decKey, onSelectFun - *@return: Container widget - *@desc: buildPickerIterm this function will build the items of the cupertino - */ - buildPickerItems(context, List items, decKey, onSelectFun) { + static buildPickerItems(context, List items, decKey, onSelectFun) { return CupertinoPicker( magnification: 1.5, scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), - - // backgroundColor: Colors.black87, children: items.map((item) { return Text( '${item["$decKey"]}', @@ -111,23 +86,14 @@ class Helpers { }).toList(), itemExtent: 25, - //height of each item looping: false, onSelectedItemChanged: (int index) { - // selectitem =index; cupertinoPickerIndex = index; }, ); } -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: msg - *@return: - *@desc: showErrorToast -*/ - showErrorToast([msg = null]) { + static showErrorToast([msg = null]) { String localMsg = generateContactAdminMsg(); if (msg != null) { @@ -136,14 +102,6 @@ class Helpers { DrAppToastMsg.showErrorToast(localMsg); } - -/* - *@author: Mohammad Aljammal - *@Date:27/4/2020 - *@param: - *@return: Boolean - *@desc: Check The Internet Connection - */ static Future checkConnection() async { ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); @@ -155,172 +113,6 @@ class Helpers { } } - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: date in String formatted - *@return: DateTime - *@desc: convert String to DateTime - */ - static DateTime convertStringToDate(String date) { - const start = "/Date("; - const end = "+0300)"; - final startIndex = date.indexOf(start); - final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); - } - - /* - *@author: Amjad Amireh - *@Date:5/5/2020 - *@param: checkDate - *@return: DateTime - *@desc: convert String to DateTime - */ - static String checkDate(String dateString) { - DateTime checkedTime = DateTime.parse(dateString); - DateTime currentTime = DateTime.now(); - - if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month) && - (currentTime.day == checkedTime.day)) { - return "Today"; - } else if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month)) { - if ((currentTime.day - checkedTime.day) == 1) { - return "YESTERDAY"; - } else if ((currentTime.day - checkedTime.day) == -1) { - return "Tomorrow"; - } - - if ((currentTime.day - checkedTime.day) <= -2) { - return "Next Week"; - } else { - return "Old Date"; - } - } - return "Old Date"; - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: month in int formatted - *@return: DateTime - *@desc: convert month in int to month name - */ - static getMonth(int month) { - switch (month) { - case 1: - return "Jan"; - case 2: - return "Feb"; - case 3: - return "Mar"; - case 4: - return "Apr"; - case 5: - return "May"; - case 6: - return "Jun"; - case 7: - return "Jul"; - case 8: - return "Aug"; - case 9: - return "Sep"; - case 10: - return "Oct"; - case 11: - return "Nov"; - case 12: - return "Dec"; - } - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: week day in int formatted - *@return: DateTime - *@desc: convert week day in int to week day name - */ - static getWeekDay(int weekDay) { - switch (weekDay) { - case 1: - return "Monday"; - case 2: - return "Tuesday"; - case 3: - return "Wednesday"; - case 4: - return "Thursday"; - case 5: - return "Friday"; - case 6: - return "Saturday "; - case 7: - return "Sunday"; - } - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: DateTime - *@return: data formatted like Apr 26,2020 - *@desc: convert DateTime to data formatted - */ - static String getDate(DateTime dateTime) { - print(dateTime); - if (dateTime != null) - return getMonth(dateTime.month) + - " " + - dateTime.day.toString() + - "," + - dateTime.year.toString(); - else - return ""; - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: DateTime - *@return: data formatted like 26/4/2020 - *@desc: convert DateTime to data formatted - */ - static String getDateFormatted(DateTime dateTime) { - print(dateTime); - if (dateTime != null) - return dateTime.day.toString() + - "/" + - dateTime.month.toString() + - "/" + - dateTime.year.toString(); - else - return ""; - } - - static String getTimeFormated(DateTime dateTime) { - print(dateTime); - if (dateTime != null) - return dateTime.hour.toString() + ":" + dateTime.minute.toString(); - else - return ""; - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: String workingHours - *@return: List - *@desc: convert workingHours string to List - */ static List getWorkingHours(String workingHours) { List myWorkingHours = []; List listOfHours = workingHours.split('a'); @@ -337,14 +129,7 @@ class Helpers { return myWorkingHours; } -/* - *@author: Elham Rababah - *@Date:12/5/2020 - *@param: - *@return: String - *@desc: generate Contact Admin Msg - */ - generateContactAdminMsg([err = null]) { + static generateContactAdminMsg([err = null]) { String localMsg = 'Something wrong happened, please contact the admin'; if (err != null) { localMsg = localMsg + '\n \n' + err.toString(); @@ -356,7 +141,7 @@ class Helpers { await sharedPref.clear(); } - logout() async { + static logout() async { DEVICE_TOKEN = ""; String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); @@ -378,7 +163,7 @@ class Helpers { (r) => false); } - String parseHtmlString(String htmlString) { + static String parseHtmlString(String htmlString) { final document = parse(htmlString); final String parsedString = parse(document.body.text).documentElement.text; diff --git a/lib/util/text_validator.dart b/lib/util/text_validator.dart deleted file mode 100644 index 1fe21c9e..00000000 --- a/lib/util/text_validator.dart +++ /dev/null @@ -1,37 +0,0 @@ - import '../util/extenstions.dart'; - - class TextValidator{ - -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Text Validator. - - String validateName(String value) { - if (value.isNullOrEmpty()||value.length < 3) - return 'Name must be more than 2 charater'; - else - return null; - } - - String validateMobile(String value) { - if (value.isNullOrEmpty()||value.length != 10) - return 'Mobile Number must be of 10 digit'; - else - return null; - } - - String validateIdNumber(String value) { - if (value.isNullOrEmpty()) - return 'Please input valid number'; - else - return null; - } - - String validateDate(String value) { - if (value.isNullOrEmpty()) - return 'Please input valid date'; - else - return null; - } - - } \ No newline at end of file diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index ef129e4a..122d8c49 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -2,8 +2,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -144,7 +144,7 @@ class _LoginFormState extends State { }, onFieldSubmitted: (_) { focusPass.nextFocus(); - helpers.showCupertinoPicker(context, projectsList, + Helpers.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject); }, onTap: () { @@ -177,7 +177,7 @@ class _LoginFormState extends State { borderColor: Colors.white, suffixIcon: Icons.arrow_drop_down, onTap: () { - helpers.showCupertinoPicker( + Helpers.showCupertinoPicker( context, projectsList, 'facilityName', diff --git a/lib/widgets/auth/show_timer_text.dart b/lib/widgets/auth/show_timer_text.dart index fd09ec25..a418e1b5 100644 --- a/lib/widgets/auth/show_timer_text.dart +++ b/lib/widgets/auth/show_timer_text.dart @@ -96,10 +96,10 @@ class _ShowTimerTextState extends State { if (res['MessageStatus'] == 1) {resendCode()} else - {helpers.showErrorToast(res['ErrorEndUserMessage'])} + {Helpers.showErrorToast(res['ErrorEndUserMessage'])} }) .catchError((err) { - helpers.showErrorToast(); + Helpers.showErrorToast(); }); } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index b2ff2ece..575bda08 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -341,11 +341,11 @@ class _VerifyAccountState extends State { } } else { changeLoadingStata(false); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { changeLoadingStata(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } } @@ -376,11 +376,11 @@ class _VerifyAccountState extends State { loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); } else { changeLoadingStata(false); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { changeLoadingStata(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } } diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index c3c59dde..56ad5c62 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart' import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart'; @@ -111,7 +112,7 @@ class _VerificationMethodsState extends State { return DrAppCircularProgressIndeicator(); default: if (snapshot.hasError) { - helpers.showErrorToast('Error: ${snapshot.error}'); + Helpers.showErrorToast('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}'); } else { return SingleChildScrollView( @@ -183,13 +184,13 @@ class _VerificationMethodsState extends State { child: ListTile( title: AppText( user.editedOn != null - ? getDate(Helpers + ? getDate(DateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getDate(Helpers + ? getDate(DateUtils .convertStringToDate( user.createdOn)) : '--', @@ -201,13 +202,13 @@ class _VerificationMethodsState extends State { ), subtitle: AppText( user.editedOn != null - ? getTime(Helpers + ? getTime(DateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getTime(Helpers + ? getTime(DateUtils .convertStringToDate( user.createdOn)) : '--', @@ -367,19 +368,19 @@ class _VerificationMethodsState extends State { this.startSMSService(oTPSendType, authProv); } else { print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { print('$err'); widget.changeLoadingStata(false); - helpers.showErrorToast(); + Helpers.showErrorToast(); }); } catch (e) {} } else { // TODO route to this page with parameters to inicate we should present 2 option if (Platform.isAndroid && oTPSendType == 3) { - helpers.showErrorToast('Your device not support this feature'); + Helpers.showErrorToast('Your device not support this feature'); } else { // Navigator.of(context).push(MaterialPageRoute( // builder: (BuildContext context) => @@ -425,13 +426,13 @@ class _VerificationMethodsState extends State { } } else { print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { print('$err'); widget.changeLoadingStata(false); - helpers.showErrorToast(); + Helpers.showErrorToast(); }); } catch (e) {} // } @@ -812,11 +813,11 @@ class _VerificationMethodsState extends State { } } else { Navigator.pop(context); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { Navigator.pop(context); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } @@ -847,11 +848,11 @@ class _VerificationMethodsState extends State { loginProcessCompleted(res['DoctorProfileList'][0], authProv); } else { // changeLoadingStata(false); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { // changeLoadingStata(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 1760c796..1d85574d 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index 41af8e1d..7665778a 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:flutter/cupertino.dart'; @@ -90,7 +91,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: Texts( - '${Helpers.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${Helpers.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index e654c760..060f9041 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -177,7 +177,7 @@ class _AppDrawerState extends State { ), onTap: () async { Navigator.pop(context); - await helpers.logout(); + await Helpers.logout(); projectsProvider.isLogin = false; }, ), 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 3e4d1186..e3581065 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -7,13 +7,13 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_er 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/new_text_Field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/new_text_Field.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'app-textfield-custom.dart'; +import 'user-guid/text_fields/app-textfield-custom.dart'; import 'app_texts_widget.dart'; import 'dialogs/master_key_dailog.dart'; import 'divider_with_spaces_around.dart'; @@ -81,7 +81,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState AppTextFieldCustom( height: MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).selectAllergy, - isDropDown: true, + isTextFieldHasSuffix: true, hasBorder: false, // controller: filteredSearchController, onChanged: (value) { @@ -284,7 +284,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ); } : null, - isDropDown: true, + isTextFieldHasSuffix: true, hintText: TranslationBase .of(context) diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index f0ef63bd..ea1fc70e 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'app-textfield-custom.dart'; +import 'user-guid/text_fields/app-textfield-custom.dart'; import 'app_texts_widget.dart'; class MasterKeyCheckboxSearchWidget extends StatefulWidget { @@ -75,7 +75,7 @@ class _MasterKeyCheckboxSearchWidgetState extends State { Container( height: widget.height != 0 ? widget.height + 8 : null, decoration: widget.hasBorder - ? containerBorderDecoration( + ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), widget.validationError == null ? Color(0xFFEFEFEF) @@ -87,7 +89,7 @@ class _AppTextFieldCustomState extends State { widget.dropDownText == null ? TextField( textAlign: TextAlign.left, - decoration: textFieldSelectorDecoration( + decoration: TextFieldsUtils.textFieldSelectorDecoration( widget.hintText, null, true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, @@ -119,7 +121,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - widget.isDropDown + widget.isTextFieldHasSuffix ? widget.suffixIcon != null ? widget.suffixIcon : Icon( @@ -134,91 +136,9 @@ class _AppTextFieldCustomState extends State { ), ), 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, - ), - ], - ), - ), + TextFieldsError(error: widget.validationError), ], ); } - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, - {double borderWidth = -1}) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(12)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: borderWidth == -1 ? 2.0 : borderWidth, - )), - ); - } - - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { - return InputDecoration( - isDense: true, - contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff)), - ), - disabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff)), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff)), - ), - border: UnderlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff)), - ), - /*focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ),*/ - hintText: selectedText != null ? selectedText : hintText, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - /*suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: dropDownColor != null ? dropDownColor : Colors.black, - ) - : null,*/ - // labelText: - // labelStyle: - ); - } } + diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/user-guid/text_fields/app_text_form_field.dart similarity index 100% rename from lib/widgets/shared/app_text_form_field.dart rename to lib/widgets/shared/user-guid/text_fields/app_text_form_field.dart diff --git a/lib/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart new file mode 100644 index 00000000..b31dce48 --- /dev/null +++ b/lib/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart @@ -0,0 +1,44 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../Text.dart'; + +class CustomAutoCompleteTextField extends StatelessWidget { + final bool isShowError; + final Widget child; + + const CustomAutoCompleteTextField({ + Key key, + this.isShowError, + this.child, + }) : super(key: key); + + + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Container( + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), + isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF), + ), + padding: + EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), + child: child, + ), + if (isShowError) + TextFieldsError( + error: TranslationBase.of(context).emptyMessage, + ) + ], + ), + ); + } +} diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/user-guid/text_fields/new_text_Field.dart similarity index 100% rename from lib/widgets/shared/new_text_Field.dart rename to lib/widgets/shared/user-guid/text_fields/new_text_Field.dart diff --git a/lib/widgets/shared/user-guid/text_fields/text_field_error.dart b/lib/widgets/shared/user-guid/text_fields/text_field_error.dart new file mode 100644 index 00000000..6108f997 --- /dev/null +++ b/lib/widgets/shared/user-guid/text_fields/text_field_error.dart @@ -0,0 +1,41 @@ +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 '../../app_texts_widget.dart'; + +class TextFieldsError extends StatelessWidget { + const TextFieldsError({ + Key key, + @required this.error, + }) : super(key: key); + + final String error; + + + @override + Widget build(BuildContext context) { + return 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( + error, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.red.shade700, + fontWeight: FontWeight.w700, + ), + ], + ), + ); + } +} diff --git a/lib/widgets/shared/user-guid/text_fields/text_fields_utils.dart b/lib/widgets/shared/user-guid/text_fields/text_fields_utils.dart new file mode 100644 index 00000000..ed0c427a --- /dev/null +++ b/lib/widgets/shared/user-guid/text_fields/text_fields_utils.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; + +class TextFieldsUtils{ + static BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, + {double borderWidth = -1}) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(12)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: borderWidth == -1 ? 2.0 : borderWidth, + )), + ); + } + + + + static InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData suffixIcon, Color dropDownColor}) { + return InputDecoration( + isDense: true, + contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + disabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + border: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + /*focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ),*/ + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), + + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} \ No newline at end of file