From 2ed3a5bf87d21e2e11b499822df07d1299b77796 Mon Sep 17 00:00:00 2001 From: "taha.alam@cloudsolutions.com.sa" Date: Wed, 11 Feb 2026 12:06:04 +0300 Subject: [PATCH 1/2] referral time display issue for out patient --- .../referred_patient_detail_in-paint.dart | 12 ++++++++++-- lib/screens/procedures/add_procedure_page.dart | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart index 542b182b..64a03586 100644 --- a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart @@ -148,7 +148,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { : Colors.red[700]!, ), AppText( - AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "dd MMM,yyyy"), + patientType == PatientType.IN_PATIENT + ? AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "dd MMM,yyyy") + :AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromString( + referredPatient.referralDate!, + )), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier!, @@ -179,7 +183,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "hh:mm a"), + patientType == PatientType.IN_PATIENT + ? AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate!, "hh:mm a") + :AppDateUtils.getTimeFormated(AppDateUtils.getDateTimeFromString( + referredPatient.referralDate!), + ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier!, diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index a87016cb..fb1adfdb 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -147,7 +147,7 @@ class _AddProcedurePageState extends State { EntityListCheckboxSearchWidget( model: widget.model, masterList: model.categoriesList[0].entityList!, - shouldDisplaySearchField: false, + shouldDisplaySearchField: procedureType != ProcedureType.PROCEDURE , removeProcedure: (item) { EntityList? itemToBeRemoved = entityList.firstWhere((element) => item.procedureId == element.procedureId, orElse: () => EntityList()); if (itemToBeRemoved.procedureId != null) { From 8404737af578abe575a2817e98af116d06e99c41 Mon Sep 17 00:00:00 2001 From: "taha.alam@cloudsolutions.com.sa" Date: Wed, 11 Feb 2026 17:56:35 +0300 Subject: [PATCH 2/2] loader and search field issue resolved. --- .../viewModel/patient-referral-viewmodel.dart | 3 +- .../doctor_replay/doctor_reply_widget.dart | 132 ++++----- .../profile/lab_result/labs_home_page.dart | 268 +++++++++--------- 3 files changed, 205 insertions(+), 198 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 4a855ba3..eebc25e0 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -103,13 +103,14 @@ class PatientReferralViewModel extends BaseViewModel { error = _referralPatientService.error; setState(ViewState.Error); } - // await getBranches(); + await getBranches(); } Future getBranches() async { setState(ViewState.BusyLocal); if( _hospitalService.hospitals.isNotEmpty){ mapHospitalToBranchList(); + setState(ViewState.Idle); return; } diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index 1747be59..69a362fe 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -193,74 +193,76 @@ class _DoctorReplyWidgetState extends State { SizedBox( width: 20, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomRow( - label: TranslationBase.of(context).fileNumber, - value: widget.reply.patientID.toString(), - isCopyable: false, - isExpanded: false, - ), - CustomRow( - label: TranslationBase.of(context).age + " : ", isCopyable: false, - isExpanded: false, - value: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", - ), - SizedBox( - height: 8, - ), - ], - ), - ], - ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + CustomRow( + label: TranslationBase.of(context).fileNumber, + value: widget.reply.patientID.toString(), + isCopyable: false, + isExpanded: false, + ), + CustomRow( + label: TranslationBase.of(context).age + " : ", isCopyable: false, + isExpanded: false, + value: + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", + ), + SizedBox( + height: 8, + ), + // ], + // ), + // ], + // ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - text: new TextSpan( - style: new TextStyle( - fontSize: 1.3 * SizeConfig.textMultiplier!, - color: Color(0xFF575757)), - children: [ - new TextSpan( - text: - TranslationBase.of(context).requestType + - ": ", - style: TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 2.8, - color: Color(0xFF575757), - //TranslationBase.of(context).doctorResponse + " : ", - )), - new TextSpan( - text: - "${widget.reply.requestTypeDescription}", - style: TextStyle( - fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - )), - ], + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier!, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: + TranslationBase.of(context).requestType + + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: + "${widget.reply.requestTypeDescription}", + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), ), ), - ), - ], + ], + ), ) ], ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 0d8a7daf..bdf7377e 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -63,149 +64,152 @@ class _LabsHomePageState extends State { // isInpatient: isInpatient!, // ), // body: - Material( - child: Column( - children: [ - PatientProfileAppBar( - patient!, - isInpatient: isInpatient!, - ), - Expanded( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: FractionallySizedBox( - widthFactor: 1.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43)) - ServiceTitle( - title: TranslationBase.of(context).lab, - subTitle: TranslationBase.of(context).result, + Material( + child: Column( + children: [ + PatientProfileAppBar( + patient!, + isInpatient: isInpatient!, + ), + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: NetworkBaseView( + baseViewModel: model, + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, ), - SizedBox( - height: 20, - ), - !model.isPrincipalCovered_ - ? Center( - child: AppText( - TranslationBase.of(context).principalCoveredOrNot, - color: Colors.red, - textAlign: TextAlign.center, - )) - : SizedBox(), - if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null)) - AddNewOrder( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient!, - previousProcedureViewModel: model, - procedureType: ProcedureType.LAB_RESULT, - ), - settings: RouteSettings(name: 'AddProcedureTabPage'), - ), - ); - }, - label: TranslationBase.of(context).applyForNewLabOrder, + if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43)) + ServiceTitle( + title: TranslationBase.of(context).lab, + subTitle: TranslationBase.of(context).result, + ), + SizedBox( + height: 20, ), - ...List.generate( - model.patientLabOrdersList.length, - (index) => Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), - ), - color: Colors.white), - child: Stack( - children: [ - Positioned( - bottom: 1, - top: 1, - left: 1, - child: Container( - width: 20, - decoration: BoxDecoration( - color: model.patientLabOrdersList![index].isLiveCareAppointment! - ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient! - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), + !model.isPrincipalCovered_ + ? Center( + child: AppText( + TranslationBase.of(context).principalCoveredOrNot, + color: Colors.red, + textAlign: TextAlign.center, + )) + : SizedBox(), + if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null)) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BaseAddProcedureTabPage( + patient: patient!, + previousProcedureViewModel: model, + procedureType: ProcedureType.LAB_RESULT, ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment! - ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient! - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), + settings: RouteSettings(name: 'AddProcedureTabPage'), + ), + ); + }, + label: TranslationBase.of(context).applyForNewLabOrder, + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), ), - ), - Container( - color: Colors.white, - padding: EdgeInsets.all(0), - margin: EdgeInsets.only(left: 20), - child: DoctorCard( - isNoMargin: true, - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: model.patientLabOrdersList[index], - patient: patient!, - isInpatient: isInpatient!, - arrivalType: arrivalType!, - patientType: patientType!, + color: Colors.white), + child: Stack( + children: [ + Positioned( + bottom: 1, + top: 1, + left: 1, + child: Container( + width: 20, + decoration: BoxDecoration( + color: model.patientLabOrdersList![index].isLiveCareAppointment! + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient! + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment! + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.all(0), + margin: EdgeInsets.only(left: 20), + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: model.patientLabOrdersList[index], + patient: patient!, + isInpatient: isInpatient!, + arrivalType: arrivalType!, + patientType: patientType!, + ), ), ), + doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName), + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription), + appointmentDate: model.patientLabOrdersList[index].createdOn, + orderNo: model.patientLabOrdersList[index].orderNo, + isShowTime: false, ), - doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName), - invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL, - branch: model.patientLabOrdersList[index].projectName, - clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription), - appointmentDate: model.patientLabOrdersList[index].createdOn, - orderNo: model.patientLabOrdersList[index].orderNo, - isShowTime: false, ), - ), - ], + ], + ), ), ), - ), - if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43) - Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, - )) - ], + if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43) + Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) + ], + ),) ), ), - ), - ), - ], - ), - ), - ); + ), + ], + ), + ), + ); + } }