diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index 78bc9105..c47a813a 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -86,7 +86,7 @@ class Prescriptions { clinicID = json['ClinicID']; companyName = json['CompanyName']; despensedStatus = json['Despensed_Status']; - dischargeDate = DateUtils.convertStringToDate(json['DischargeDate']); + dischargeDate = AppDateUtils.convertStringToDate(json['DischargeDate']); dischargeNo = json['DischargeNo']; doctorID = json['DoctorID']; doctorImageURL = json['DoctorImageURL']; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index 4f77f7ec..f51420ec 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -79,10 +79,10 @@ class PrescriptionsOrder { status = json['Status']; description = json['Description']; descriptionN = json['DescriptionN']; - createdOn = DateUtils.convertStringToDate(json['CreatedOn']); + createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']); serviceID = json['ServiceID']; createdBy = json['CreatedBy']; - editedOn = DateUtils.convertStringToDate(json['EditedOn']); + editedOn = AppDateUtils.convertStringToDate(json['EditedOn']); editedBy = json['EditedBy']; channel = json['Channel']; clientRequestID = json['ClientRequestID']; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 6f989543..af60f86f 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -95,7 +95,7 @@ class PatientLabOrders { isRead = json['IsRead']; nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; - orderDate = DateUtils.convertStringToDate(json['OrderDate']); + orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); orderNo = json['OrderNo'].toString(); patientID = json['PatientID'].toString(); projectID = json['ProjectID'].toString(); diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 8b10de83..401fd1a7 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -42,7 +42,7 @@ class PatientMuseResultsModel { imageURL = json['ImageURL']; createdBy = json['CreatedBy']; createdOn = json['CreatedOn']; - createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']); + createdOnDateTime = AppDateUtils.getDateTimeFromServerFormat(json['CreatedOn']); } Map toJson() { diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index fdccf5f5..e09f269a 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -96,8 +96,8 @@ class FinalRadiology { invoiceNo = json['InvoiceNo']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; - orderDate = DateUtils.convertStringToDate(json['OrderDate']); - reportDate = DateUtils.convertStringToDate(json['ReportDate']); + orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); + reportDate = AppDateUtils.convertStringToDate(json['ReportDate']); reportData = json['ReportData']; imageURL = json['ImageURL']; procedureID = json['ProcedureID']; diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index 523d8d0a..dff63bfc 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -139,7 +139,7 @@ class DischargeReferralPatient { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; referralStatus = json['ReferralStatus']; - referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index f2c9c425..797109dd 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -159,7 +159,7 @@ class MyReferralPatientModel { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; referralStatus = json['ReferralStatus']; - referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index daca52b9..ffbcae9b 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -2,13 +2,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; - import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; - import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; @@ -220,7 +218,7 @@ class PrescriptionService extends LookupService { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": DateUtils.convertDateFromServerFormat( + "Age": AppDateUtils.convertDateFromServerFormat( patient.dateofBirth, 'dd/MM/yyyy') }, "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 7a145fff..a0cd68d9 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -98,24 +98,24 @@ class PatientSearchViewModel extends BaseViewModel { DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedToDate = DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); - dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); + dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { - dateTo = DateUtils.convertDateToFormat( + dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); - dateFrom = DateUtils.convertDateToFormat( + dateFrom = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); } else { - dateFrom = DateUtils.convertDateToFormat( + dateFrom = AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); - dateTo = DateUtils.convertDateToFormat( + dateTo = AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index cada20f6..b6887061 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -61,10 +61,10 @@ class UcafViewModel extends BaseViewModel { String from; String to; if (from == null || from == "0") { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (to == null || to == "0") { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } // await _ucafService.getPatientVitalSignsHistory(patient, from, to); diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 98b45c41..7ce4582a 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -46,10 +46,10 @@ class VitalSignsViewModel extends BaseViewModel { String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (to == null || to == "0") { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (isInPatient) { diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 89c7c182..902268da 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.d import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; + import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 9b64e588..4712d285 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -15,7 +15,7 @@ class ListDoctorWorkingHoursTable { }); ListDoctorWorkingHoursTable.fromJson(Map json) { - date = DateUtils.convertStringToDate(json['Date']); + date = AppDateUtils.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 33a314e3..35d09812 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -70,7 +70,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = DateUtils.convertStringToDate(json['RequestDate']) ; + requestDate = AppDateUtils.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 893b49ae..7f463933 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -62,7 +62,7 @@ class LabOrdersResModel { status = json['Status']; createdBy = json['CreatedBy']; createdByN = json['CreatedByN']; - createdOn = DateUtils.convertStringToDate(json['CreatedOn']); + createdOn = AppDateUtils.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 ab14a82f..f1506f8e 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -142,7 +142,7 @@ class MyReferralPatientModel { referralResponseOn = json['ReferralResponseOn']; priority = json['Priority']; frequency = json['Frequency']; - mAXResponseTime = DateUtils.convertStringToDate(json['MAXResponseTime']); + mAXResponseTime = AppDateUtils.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 8e643866..21cb13b1 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -125,7 +125,7 @@ class PrescriptionReportForInPatient { orderNo = json['OrderNo']; patientID = json['PatientID']; pharmacyRemarks = json['PharmacyRemarks']; - prescriptionDatetime = DateUtils.convertStringToDate(json['PrescriptionDatetime']); + prescriptionDatetime = AppDateUtils.convertStringToDate(json['PrescriptionDatetime']); prescriptionNo = json['PrescriptionNo']; processedBy = json['ProcessedBy']; projectID = json['ProjectID']; @@ -138,11 +138,11 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = DateUtils.convertStringToDate(json['StartDatetime']) ; + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; - stopDatetime = DateUtils.convertStringToDate(json['StopDatetime']); + stopDatetime = AppDateUtils.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 09bb1797..78af108d 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -170,7 +170,7 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? DateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 1c019ca6..14e446e8 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -164,14 +164,14 @@ class DoctorReplayChat extends StatelessWidget { children: [ AppText( - reply.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, color: Colors.white, fontSize: 14, ), AppText( - reply.createdOn !=null?DateUtils.getHour(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getHour(DateTime.now()), + reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), fontSize: 14, fontFamily: 'Poppins', color: Colors.white, diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index e4f933e7..5ef8b617 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -24,9 +24,9 @@ class _PatientArrivalScreen extends State PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 4a375d6d..5da822c6 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -303,7 +303,7 @@ class _HomeScreenState extends State { .myOutPatient, onTap: () { String date = - DateUtils.convertDateToFormat( + AppDateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index 3096e775..ad7f13cb 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -170,7 +170,7 @@ class _HealthSummaryPageState extends State { .timelines[index] .doctorImage, appointmentDate: - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( model.medicalFileList[0].entityList[0] .timelines[index].date, ), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 1c06fd0c..9bfde511 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -113,7 +113,7 @@ class _MedicalFileDetailsState extends State { isMedicalFile: true, episode: episode, vistDate: - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( vistDate, ), isArabic: projectViewModel.isArabic)}', ), @@ -629,7 +629,7 @@ class _MedicalFileDetailsState extends State { ": ", ), AppText( - DateUtils.getDateFormatted( + AppDateUtils.getDateFormatted( DateTime .parse( model diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index e4138305..7f314c0e 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -277,7 +277,7 @@ class _DischargedPatientState extends State { style: TextStyle(fontSize: 14)), new TextSpan( text: model.filterData[index].admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -301,7 +301,7 @@ class _DischargedPatientState extends State { style: TextStyle(fontSize: 14)), new TextSpan( text: model.filterData[index].dischargeDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -316,7 +316,7 @@ class _DischargedPatientState extends State { fontSize: 14,fontWeight: FontWeight.w300, ), AppText( - "${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], @@ -332,11 +332,12 @@ class _DischargedPatientState extends State { )), ], ), - )) - ], + + ), - ), + ),], ), + ),) ); } diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 6d1b5370..33692628 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -100,8 +100,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - AppText('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 9cdd8615..f78752ec 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -77,9 +77,9 @@ class ReferralDischargedPatientDetails extends StatelessWidget { "isInpatient": true, "arrivalType": "1", "isDischargedPatient": true, - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -126,7 +126,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDayMonthYearDateFormatted( referredPatient.referralDate, ), fontFamily: 'Poppins', @@ -149,7 +149,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.admissionDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -174,7 +174,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.dischargeDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -199,7 +199,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -435,7 +435,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, "dd MMM,yyyy"), fontFamily: 'Poppins', diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index b9860af8..92f92f87 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -67,8 +67,8 @@ class _ReferralDischargedPatientPageState extends State { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -291,7 +291,7 @@ class _InsuranceApprovalsDetailsState extends State { color: Colors.grey[500], ), AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -650,7 +650,7 @@ class _InsuranceApprovalsDetailsState extends State { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -673,7 +673,7 @@ class _InsuranceApprovalsDetailsState extends State { .expiryDate != null) AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index c00d362a..14ae707b 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -73,7 +73,7 @@ class _FilterDatePageState extends State { widget.patientSearchViewModel .selectedFromDate != null - ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -102,7 +102,7 @@ class _FilterDatePageState extends State { widget.patientSearchViewModel .selectedToDate != null - ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -161,10 +161,10 @@ class _FilterDatePageState extends State { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { - String dateTo = DateUtils.convertDateToFormat( + String dateTo = AppDateUtils.convertDateToFormat( widget.patientSearchViewModel.selectedToDate, 'yyyy-MM-dd'); - String dateFrom = DateUtils.convertDateToFormat( + String dateFrom = AppDateUtils.convertDateToFormat( widget.patientSearchViewModel.selectedFromDate, 'yyyy-MM-dd'); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 5c16d063..503e4efd 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -110,7 +110,7 @@ class _UCAFInputScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CheckboxListTile( + /*CheckboxListTile( title: AppText( TranslationBase.of(context).inPatient, fontWeight: FontWeight.normal, @@ -158,7 +158,7 @@ class _UCAFInputScreenState extends State { ), SizedBox( height: 16, - ), + ),*/ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -289,7 +289,7 @@ class _UCAFInputScreenState extends State { minLines: 1, maxLines: 20, ), - SizedBox( + /*SizedBox( height: 16, ), AppText( @@ -319,11 +319,11 @@ class _UCAFInputScreenState extends State { controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), - )), + )),*/ SizedBox( height: 8, ), - AppTextFieldCustom( + /* AppTextFieldCustom( hintText: TranslationBase.of(context).other, dropDownText: TranslationBase.of(context).none, enabled: false, @@ -392,7 +392,7 @@ class _UCAFInputScreenState extends State { TranslationBase.of(context).backAbdomen, dropDownText: "BackLNeck", enabled: false, - ), + ),*/ ], ), ), diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 20a93ff6..bbc968b0 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -96,7 +96,7 @@ class _AdmissionRequestDetailScreenState Helpers.textFieldSelectorDecoration( TranslationBase.of(context).date, selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( 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 90131c03..8627d224 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 @@ -195,7 +195,7 @@ class _AdmissionRequestSecondScreenState hintText: TranslationBase.of(context) .expectedAdmissionDate, dropDownText: _expectedAdmissionDate != null - ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 112680e8..697d16d2 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -87,14 +87,14 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResult.forEach((vital) { - var date = DateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic? DateUtils.getWeekDayArabic(date.weekday): DateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtils.getMonthArabic(date.month) : DateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 2734286d..89860f44 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -105,7 +105,7 @@ class LineChartCurvedState extends State { rotateAngle:-65, getTitles: (value) { print(value); - DateTime date = DateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 173115f9..668e5a44 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -502,9 +502,8 @@ class _ProgressNoteState extends State { index] .createdOn != null - ? DateUtils - .getDayMonthYearDateFormatted( - DateUtils + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils .getDateTimeFromServerFormat( model .patientProgressNoteList[ @@ -513,7 +512,7 @@ class _ProgressNoteState extends State { isArabic: projectViewModel .isArabic) - : DateUtils + : AppDateUtils .getDayMonthYearDateFormatted( DateTime.now(), isArabic: @@ -528,13 +527,13 @@ class _ProgressNoteState extends State { index] .createdOn != null - ? DateUtils.getHour(DateUtils + ? AppDateUtils.getHour(AppDateUtils .getDateTimeFromServerFormat( model .patientProgressNoteList[ index] .createdOn)) - : DateUtils.getHour( + : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, @@ -584,7 +583,7 @@ class _ProgressNoteState extends State { showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, - child: Center( + builder: (ctx) => Center( child: Container( width: MediaQuery .of(context) @@ -678,6 +677,7 @@ class _ProgressNoteState extends State { ), ), ), - )); + ) + ); } } 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 a7aab586..ca8be2c0 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 @@ -96,11 +96,11 @@ class _InpatientPrescriptionDetailsScreenState key: 'UOM'), buildTableRow( des: - '${DateUtils.getDate(prescription.startDatetime)}', + '${AppDateUtils.getDate(prescription.startDatetime)}', key: 'Start Date'), buildTableRow( des: - '${DateUtils.getDate(prescription.stopDatetime)}', + '${AppDateUtils.getDate(prescription.stopDatetime)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', @@ -115,7 +115,7 @@ class _InpatientPrescriptionDetailsScreenState key: 'Pharmacy Remarks'), buildTableRow( des: - '${DateUtils.getDate(prescription.prescriptionDatetime)}', + '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 71edabb6..2adef799 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -30,10 +30,10 @@ class MyReferralDetailScreen extends StatelessWidget { return BaseView( onModelReady: (model) => model.getPatientDetails( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), "yyyy-MM-dd"), - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( DateTime.now().toString(), "yyyy-MM-dd"), pendingReferral.patientID, pendingReferral.sourceAppointmentNo), diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index f3bbf698..fcbd11b7 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -64,8 +64,8 @@ class MyReferralInPatientScreen extends StatelessWidget { referralStatusCode: model.myReferralPatients[index].referralStatus, patientName: model.myReferralPatients[index].patientName, patientGender: model.myReferralPatients[index].gender, - referredDate: DateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), - referredTime: DateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, isReferral: true, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 2d9ca8dc..6a25b9a1 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -434,7 +434,7 @@ class _PatientMakeReferralScreenState extends State { height: screenSize.height * 0.075, hintText: TranslationBase.of(context).date, dropDownText: appointmentDate != null - ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" + ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index a7a6677d..a949036b 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -77,9 +77,9 @@ class ReferralPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -105,9 +105,9 @@ class ReferralPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -158,7 +158,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDayMonthYearDateFormatted( referredPatient.referralDate, ), fontFamily: 'Poppins', @@ -196,7 +196,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), AppText( - DateUtils.getTimeHHMMA( + AppDateUtils.getTimeHHMMA( referredPatient.referralDate, ), fontFamily: 'Poppins', @@ -342,7 +342,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, "dd MMM,yyyy"), fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 4b06b6b9..dc2bf798 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -74,12 +74,12 @@ class ReferredPatientScreen extends StatelessWidget { "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", patientGender: model.getReferredPatientItem(index).gender, - referredDate: DateUtils.convertDateFromServerFormat( + referredDate: AppDateUtils.convertDateFromServerFormat( model .getReferredPatientItem(index) .referralDate, "dd/MM/yyyy"), - referredTime: DateUtils.convertDateFromServerFormat( + referredTime: AppDateUtils.convertDateFromServerFormat( model .getReferredPatientItem(index) .referralDate, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index a37803dd..b4e1ddc5 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -76,9 +76,9 @@ class ReferredPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -102,9 +102,9 @@ class ReferredPatientDetailScreen extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": DateUtils.convertDateToFormat( + "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), - "to": DateUtils.convertDateToFormat( + "to": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), }); }, @@ -157,7 +157,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.referralDate, "dd MMM,yyyy"), fontFamily: 'Poppins', @@ -194,7 +194,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.referralDate, "hh:mm a"), fontFamily: 'Poppins', @@ -337,7 +337,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, "dd MMM,yyyy"), fontFamily: 'Poppins', 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 1c3c7e3f..4f48ff27 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 @@ -389,12 +389,12 @@ class _UpdateAssessmentPageState extends State { children: [ AppText( assessment.createdOn != null - ? DateUtils + ? AppDateUtils .getDayMonthYearDateFormatted( DateTime.parse( assessment .createdOn)) - : DateUtils + : AppDateUtils .getDayMonthYearDateFormatted( DateTime.now()), fontWeight: FontWeight @@ -402,11 +402,11 @@ class _UpdateAssessmentPageState extends State { fontSize: 14, ), AppText( assessment.createdOn != null - ? DateUtils.getHour( + ? AppDateUtils.getHour( DateTime.parse( assessment .createdOn)) - : DateUtils.getHour( + : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight .w600, 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 8e7e3f98..87ea1e4d 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 @@ -169,7 +169,7 @@ class _UpdatePlanPageState extends State { ], ), AppText( - widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), + widget.patientProgressNote.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, fontSize: 14, @@ -192,7 +192,7 @@ class _UpdatePlanPageState extends State { ], ), AppText( - widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()), + widget.patientProgressNote.createdOn !=null?AppDateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, ) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index ef6bc48f..ffd8422d 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -251,7 +251,7 @@ class VitalSignDetailPainScale extends StatelessWidget { padding: EdgeInsets.all(8), child: Center( child: AppText( - "${DateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), fontSize: SizeConfig.textMultiplier * 1.6, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index a6170f6f..1e593af7 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -154,7 +154,7 @@ class _VitalSignDetailsWidgetState extends State { widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( @@ -162,7 +162,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${DateUtils.getHour(elementDate)}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index f058ac3e..cec53580 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -111,7 +111,7 @@ class _VitalSignDetailsWidgetState extends State { widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( @@ -119,7 +119,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${DateUtils.getHour(elementDate)}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index 2d4abec8..ef8049ce 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -101,7 +101,7 @@ class VitalSingChartAndDetials extends StatelessWidget { vitalList.reversed.toList().forEach( (element) { DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(element.createdOn); + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 0ac2f18b..d0416539 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -116,7 +116,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { vitalList.reversed.toList().forEach( (element) { DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(element.createdOn); + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index aabf7b2f..fe09c916 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -446,85 +446,40 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - // height: MediaQuery.of(context) - // .size - // .height * - // 0.02, + color: Colors.white, width: MediaQuery.of(context) .size .width * 0.35, - child: AppTextFieldCustom( - isPrscription: true, - inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), - // WhitelistingTextInputFormatter - // .digitsOnly - ], - hintText: - TranslationBase.of( - context) - .strength, - - // fontWeight: FontWeight.w500, - // fontSize: 14.0, - // borderWidth: 0.2, - - controller: - strengthController, - // keyboardType: TextInputType - // .numberWithOptions( - // decimal: true, - // ), - onChanged: (String value) { - setState(() { - strengthChar = - value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, - ); - } - }, - // onClick: (_) { - // if (_selectedMedication != - // null && - // duration != null && - // frequency != null && - // strengthController - // .text != - // null) { - // model.getBoxQuantity( - // freq: frequency[ - // 'parameterCode'], - // duration: - // duration['id'], - // itemCode: - // _selectedMedication - // .itemId, - // strength: double.parse( - // strengthController - // .text)); - // box = model.boxQuintity; - // - // return; - // } - // }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), + child: TextField( + decoration: + textFieldSelectorDecorationStreangrh( + strengthController + .text, + 'Strength', //strengthController.text, + false), + enabled: true, + controller: + strengthController, + onChanged: + (String value) { + setState(() { + strengthChar = + value.length; + }); + if (strengthChar >= 5) { + DrAppToastMsg + .showErrorToast( + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, + ); + } + }, + keyboardType: TextInputType + .numberWithOptions( + decimal: true, + )), ), SizedBox( width: 5.0, @@ -925,7 +880,7 @@ class _PrescriptionFormWidgetState extends State { context) .date, selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( @@ -1394,6 +1349,48 @@ class _PrescriptionFormWidgetState extends State { ); } + InputDecoration textFieldSelectorDecorationStreangrh( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + hintText: selectedText == null || selectedText == "" ? hintText : null, + labelText: + selectedText != null && selectedText != "" ? '\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 15, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } + openDrugToDrug(model) { showModalBottomSheet( context: context, diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index b29a2169..4828608a 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -321,7 +321,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, @@ -337,7 +337,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 06d9634c..8051beae 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -34,7 +34,7 @@ class PrescriptionItemsPage extends StatelessWidget { clinic: prescriptions.clinicDescription, branch: prescriptions.name, isPrescriptions: true, - appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, ), @@ -75,7 +75,7 @@ class PrescriptionItemsPage extends StatelessWidget { onTap: (){ showDialog( context: context, - child: ShowImageDialog( + builder: (ctx) => ShowImageDialog( imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, ) ); @@ -164,7 +164,7 @@ class PrescriptionItemsPage extends StatelessWidget { onTap: (){ showDialog( context: context, - child: ShowImageDialog( + builder: (ctx) => ShowImageDialog( imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, ) ); diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 3b207d5a..6608f108 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -226,7 +226,7 @@ class _NewPrescriptionScreenState extends State { 13.5, ), AppText( - DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != + AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -249,7 +249,7 @@ class _NewPrescriptionScreenState extends State { .green, ), AppText( - DateUtils.getTimeFormated(DateTime.parse(model + AppDateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -289,7 +289,7 @@ class _NewPrescriptionScreenState extends State { Expanded( child: AppText( - DateUtils.getDateFormatted(DateTime.parse(model + AppDateUtils.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 cf038ff6..5ce98c54 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -125,7 +125,7 @@ class _NewPrescriptionHistoryScreenState 13.5, ), AppText( - DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != + AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -148,7 +148,7 @@ class _NewPrescriptionHistoryScreenState .green, ), AppText( - DateUtils.getTimeFormated(DateTime.parse(model + AppDateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -187,7 +187,7 @@ class _NewPrescriptionHistoryScreenState Expanded( child: AppText( - DateUtils.getDateFormatted(DateTime.parse(model + AppDateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 19620dda..a7367cf3 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -128,7 +128,7 @@ class PrescriptionsPage extends StatelessWidget { .clinicDescription, isPrescriptions: true, appointmentDate: - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( model.prescriptionsList[index] .appointmentDate, ), @@ -176,12 +176,12 @@ class PrescriptionsPage extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - startOn: DateUtils + startOn: AppDateUtils .getDateTimeFromServerFormat( model.inPatientPrescription[index] .startDatetime, ), - stopOn: DateUtils + stopOn: AppDateUtils .getDateTimeFromServerFormat( model.inPatientPrescription[index] .stopDatetime, @@ -197,7 +197,7 @@ class PrescriptionsPage extends StatelessWidget { clinic: 'basheer', isPrescriptions: true, appointmentDate: - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( model.inPatientPrescription[index] .prescriptionDatetime, ), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 5d4c6a5b..01ba6a91 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -665,11 +665,11 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: Helpers .textFieldSelectorDecoration( - DateUtils.getDateFormatted( + AppDateUtils.getDateFormatted( DateTime.parse( widget.startDate)), selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 5b882c94..f18422ee 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -99,13 +99,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index c7c52745..2e0a284f 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -90,7 +90,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { padding: EdgeInsets.only(top: 10), child: AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.createdOn, 'yyyy-MM-dd HH:mm'), @@ -124,7 +124,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(TranslationBase.of(context) .startDate), AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, @@ -145,7 +145,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(TranslationBase.of(context) .endDate), AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.dateTimeTo, 'yyyy-MM-dd HH:mm'), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index c7f6d993..734e849a 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -18,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -// ignore: must_be_immutable class AddSickLeavScreen extends StatelessWidget { PatiantInformtion patient; @override @@ -195,8 +194,8 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted( - DateUtils + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils .convertStringToDate( item.startDate)), fontWeight: @@ -208,16 +207,15 @@ class AddSickLeavScreen extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of( - context) + TranslationBase.of(context) .endDate + ' ', ), Flexible( child: AppText( - DateUtils + AppDateUtils .getDayMonthYearDateFormatted( - DateUtils + AppDateUtils .convertStringToDate( item.endDate, )), diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 31f186f1..3fbb3287 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -117,7 +117,7 @@ class ShowSickLeaveScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils + AppDateUtils .convertStringToDateFormat( item.startDate, 'dd-MMM-yyyy'), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index cd92f71b..44e7bffe 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:intl/intl.dart'; -class DateUtils { +class AppDateUtils { static String convertDateToFormat(DateTime dateTime, String dateFormat) { return DateFormat(dateFormat).format(dateTime); } @@ -307,7 +307,7 @@ class DateUtils { static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart - DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); + DateTime birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); final now = DateTime.now(); int years = now.year - birthDate.year; int months = now.month - birthDate.month; diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 8162d4ba..2d8c4199 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -183,13 +183,13 @@ class _VerificationMethodsState extends State { child: ListTile( title: AppText( user.editedOn != null - ? getDate(DateUtils + ? getDate(AppDateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getDate(DateUtils + ? getDate(AppDateUtils .convertStringToDate( user.createdOn)) : '--', @@ -201,13 +201,13 @@ class _VerificationMethodsState extends State { ), subtitle: AppText( user.editedOn != null - ? getTime(DateUtils + ? getTime(AppDateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getTime(DateUtils + ? getTime(AppDateUtils .convertStringToDate( user.createdOn)) : '--', diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 55173809..7817ba3c 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -66,19 +66,19 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .day .toString() + " " + - DateUtils.getMonth( - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getMonth( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .month) .toString() .substring(0, 3) + ' ' + - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .year .toString(), @@ -86,12 +86,12 @@ class _DoctorReplyWidgetState extends State { fontWeight: FontWeight.w600, ), AppText( - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .hour .toString() + ":"+ - DateUtils.getDateTimeFromServerFormat( + AppDateUtils.getDateTimeFromServerFormat( widget.reply.createdOn) .minute .toString(), @@ -216,7 +216,7 @@ class _DoctorReplyWidgetState extends State { style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index e4112cf2..54df8cd9 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -33,13 +33,13 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic?DateUtils.getWeekDayArabic(workingHoursTable.date.weekday): DateUtils.getWeekDay(workingHoursTable.date.weekday) , + projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -51,7 +51,7 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: DateUtils.isToday(workingHoursTable.date) + bgColor: AppDateUtils.isToday(workingHoursTable.date) ? Colors.green[500] : Colors.transparent, // hasBorder: false, @@ -59,7 +59,7 @@ class MyScheduleWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (DateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable.date)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index e02ebb5b..179633e7 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -134,8 +134,8 @@ class PatientCard extends StatelessWidget { ) : patientInfo.arrivedOn != null ? AppText( - DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) - )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", + AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.arrivedOn,) + )+" "+ "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -143,7 +143,7 @@ class PatientCard extends StatelessWidget { : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? AppText( - "${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -299,7 +299,7 @@ class PatientCard extends StatelessWidget { style: TextStyle(fontSize: 12)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), @@ -328,7 +328,7 @@ class PatientCard extends StatelessWidget { new TextSpan( text: patientInfo.admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), @@ -348,7 +348,7 @@ class PatientCard extends StatelessWidget { text: TranslationBase.of(context).numOfDays + " : ", style: TextStyle(fontSize: 12)), new TextSpan( - text: "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + text: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index dc1a9910..2cf9a5ca 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -119,10 +119,10 @@ class PatientProfileButton extends StatelessWidget { if (route == null) return; if (from == null) { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (to == null) { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } if (arrivalType == null) { arrivalType = "0"; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index d5c43892..07bfe8f7 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -141,7 +141,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ) : AppText( patient.arrivedOn != null - ? DateUtils.convertStringToDateFormat( + ? AppDateUtils.convertStringToDateFormat( patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', @@ -260,7 +260,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], @@ -291,7 +291,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget new TextSpan( text: patient.admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), @@ -305,12 +305,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), if(isDischargedPatient && patient.dischargeDate!=null) AppText( - "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700) else AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index b4d8ce17..1db29087 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -140,7 +140,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { fontWeight: FontWeight.w600, ) : AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(patient.arrivedOn)), + AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.arrivedOn)), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) @@ -259,7 +259,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart index 557f78ce..c3a8638f 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -125,7 +125,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( children: [ AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( patient.admissionDate, "hh:mm a"), fontWeight: FontWeight.bold, fontSize: 1.4 * SizeConfig.textMultiplier, @@ -145,7 +145,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( - DateUtils.convertDateFromServerFormat( + AppDateUtils.convertDateFromServerFormat( patient.admissionDate, "dd MMM,yyyy"), fontSize: 1.4 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700), @@ -187,7 +187,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 1.4 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700), ], diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart index acbb5f05..f3e01316 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -174,7 +174,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { FontWeight.w600, ) : AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( patient .arrivedOn, 'MM-dd-yyyy HH:mm'), @@ -334,7 +334,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", style: TextStyle( fontWeight: FontWeight.w700, @@ -446,7 +446,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { ), Expanded( child: AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), ) ], diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 0adfac4d..2e47b211 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -164,7 +164,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget fontWeight: FontWeight.w600, ) : AppText( - DateUtils.convertStringToDateFormat( + AppDateUtils.convertStringToDateFormat( patient.arrivedOn, 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', @@ -284,7 +284,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], @@ -408,7 +408,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), ), AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', fontSize: 14, ) ], diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index 8635f597..b8314b03 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -90,7 +90,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 778ce3c8..2a98a381 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -68,14 +68,14 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), if (!isPrescriptions&& isShowTime) AppText( - '${DateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart index 9b45bba1..bf383fff 100644 --- a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart +++ b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart @@ -5,7 +5,7 @@ import 'gif_loader_container.dart'; class GifLoaderDialogUtils { static showMyDialog(BuildContext context) { - showDialog(context: context, child: GifLoaderContainer()); + showDialog(context: context, builder: (ctx) => GifLoaderContainer()); } static hideDialog(BuildContext context) { diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart index 47ced262..9197a4a1 100644 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -63,14 +63,14 @@ class InPatientDoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), if (!isPrescriptions) AppText( - '${DateUtils.getHour(appointmentDate)}', + '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, diff --git a/pubspec.lock b/pubspec.lock index 825db695..ee31002d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b4532e42..29c3f7b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,6 +16,11 @@ version: 1.2.2+2 environment: sdk: ">=2.8.0 <3.0.0" + +#dependency_overrides: +# intl: 0.17.0-nullsafety.2 + + dependencies: flutter: sdk: flutter