From 7b7ce4e03765b35a8b832176bb86944388eef669 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 20 Apr 2021 15:06:34 +0300 Subject: [PATCH] refactor utils folder --- lib/client/base_app_client.dart | 6 +- lib/core/viewModel/auth_view_model.dart | 1 - lib/core/viewModel/imei_view_model.dart | 3 +- ...list_doctor_working_hours_table_model.dart | 3 +- .../list_gt_my_patients_question_model.dart | 3 +- .../lab_orders/lab_orders_res_model.dart | 13 +- .../my_referral_patient_model.dart | 3 +- .../prescription_report_for_in_patient.dart | 7 +- .../vital_sign/vital_sign_res_model.dart | 3 +- lib/screens/QR_reader_screen.dart | 2 +- lib/screens/doctor/doctor_repaly_chat.dart | 121 +-------- lib/screens/home/home_screen.dart | 2 +- lib/screens/live_care/video_call.dart | 8 +- .../medical-file/medical_file_details.dart | 2 +- .../medicine/medicine_search_screen.dart | 4 +- .../patients/patient_search_screen.dart | 4 +- lib/screens/patients/patients_screen.dart | 8 +- .../profile/UCAF/UCAF-input-screen.dart | 2 +- .../profile/lab_result/lab_orders_screen.dart | 3 +- ...n_patient_prescription_details_screen.dart | 7 +- .../assessment/add_assessment_details.dart | 5 +- .../assessment/update_assessment_page.dart | 3 +- .../objective/update_objective_page.dart | 7 +- .../soap_update/plan/update_plan_page.dart | 8 +- .../subjective/allergies/add_allergies.dart | 3 +- .../allergies/update_allergies_widget.dart | 3 +- .../subjective/update_subjective_page.dart | 16 +- .../prescription/add_prescription_form.dart | 8 +- .../prescription/prescription_screen.dart | 7 +- .../prescription_screen_history.dart | 7 +- .../update_prescription_form.dart | 4 +- .../procedures/add-procedure-form.dart | 9 +- lib/screens/procedures/add_lab_orders.dart | 9 +- .../procedures/add_radiology_order.dart | 9 +- lib/screens/procedures/procedure_screen.dart | 2 +- lib/screens/procedures/update-procedure.dart | 3 +- .../reschedule-leaves/reschedule_leave.dart | 1 - lib/screens/sick-leave/sick_leave.dart | 1 - lib/util/date-utils.dart | 32 +++ lib/util/dr_app_toast_msg.dart | 8 +- lib/util/extenstions.dart | 4 - lib/util/helpers.dart | 231 +----------------- lib/util/text_validator.dart | 37 --- lib/widgets/auth/login_form.dart | 4 +- lib/widgets/auth/show_timer_text.dart | 4 +- lib/widgets/auth/verfiy_account.dart | 8 +- lib/widgets/auth/verification_methods.dart | 29 +-- .../patients/vital_sign_details_wideget.dart | 3 +- lib/widgets/shared/app_drawer_widget.dart | 2 +- 49 files changed, 170 insertions(+), 502 deletions(-) delete mode 100644 lib/util/text_validator.dart 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/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 c1705deb..7325cd37 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.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 53a0e1c5..fe87e59a 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.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 ecdd29a7..c92eb066 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.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/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/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 59d03ed9..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,6 +13,7 @@ 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/app_buttons_widget.dart'; @@ -453,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/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index dfdb21f9..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'; @@ -255,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 ea30e9cb..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 @@ -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/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 2c8c5f54..397e1a60 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.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_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/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 9afd4e17..3ab34bea 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -11,7 +11,6 @@ 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'; diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index bee27a39..e05f6046 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -10,7 +10,6 @@ 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'; 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 1b054179..122d8c49 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.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/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; }, ),