From 151351c0bf3d17a27f2911f9ddd79334e0df64b3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 11 Sep 2025 10:45:35 +0300 Subject: [PATCH] medical file updates --- assets/images/svg/all_medications_icon.svg | 5 + lib/core/app_assets.dart | 1 + .../lab/collapsing_list_view.dart | 8 +- .../medical_file/medical_file_page.dart | 112 ++++++++++-------- 4 files changed, 74 insertions(+), 52 deletions(-) create mode 100644 assets/images/svg/all_medications_icon.svg diff --git a/assets/images/svg/all_medications_icon.svg b/assets/images/svg/all_medications_icon.svg new file mode 100644 index 0000000..3d3449b --- /dev/null +++ b/assets/images/svg/all_medications_icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart index 23945d0..f0d0254 100644 --- a/lib/core/app_assets.dart +++ b/lib/core/app_assets.dart @@ -100,6 +100,7 @@ class AppAssets { static const String forward_chevron_icon = '$svgBasePath/forward_chevron_icon.svg'; static const String logout = '$svgBasePath/logout.svg'; static const String alarm_clock_icon = '$svgBasePath/alarm_clock_icon.svg'; + static const String all_medications_icon = '$svgBasePath/all_medications_icon.svg'; //bottom navigation// static const String homeBottom = '$svgBasePath/home_bottom.svg'; diff --git a/lib/presentation/lab/collapsing_list_view.dart b/lib/presentation/lab/collapsing_list_view.dart index c7f1540..f84872d 100644 --- a/lib/presentation/lab/collapsing_list_view.dart +++ b/lib/presentation/lab/collapsing_list_view.dart @@ -21,8 +21,9 @@ class CollapsingListView extends StatelessWidget { VoidCallback? history; Widget? bottomChild; bool isClose; + bool isLeading; - CollapsingListView({required this.title, this.child, this.search, this.isClose = false, this.bottomChild, this.report, this.logout, this.history}); + CollapsingListView({required this.title, this.child, this.search, this.isClose = false, this.bottomChild, this.report, this.logout, this.history, this.isLeading = true}); @override Widget build(BuildContext context) { @@ -33,17 +34,18 @@ class CollapsingListView extends StatelessWidget { CustomScrollView( slivers: [ SliverAppBar( + automaticallyImplyLeading: false, pinned: true, expandedHeight: 100, stretch: true, systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light), surfaceTintColor: Colors.transparent, backgroundColor: AppColors.bgScaffoldColor, - leading: IconButton( + leading: isLeading ? IconButton( icon: Utils.buildSvgWithAssets(icon: isClose ? AppAssets.closeBottomNav : AppAssets.arrow_back, width: 32.h, height: 32.h), padding: EdgeInsets.only(left: 12), onPressed: () => Navigator.pop(context), - ), + ) : SizedBox.shrink(), flexibleSpace: LayoutBuilder( builder: (context, constraints) { final double maxHeight = 100; diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 4860bb1..37fce64 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -22,14 +22,17 @@ import 'package:hmg_patient_app_new/presentation/insurance/widgets/patient_insur import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/widgets/lab_rad_card.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/widgets/medical_file_card.dart'; +import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; +import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:provider/provider.dart'; +import '../prescriptions/prescription_detail_page.dart'; import 'widgets/medical_file_appointment_card.dart'; class MedicalFilePage extends StatefulWidget { @@ -61,13 +64,13 @@ class _MedicalFilePageState extends State { appState = getIt.get(); return Scaffold( backgroundColor: AppColors.bgScaffoldColor, - body: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.only(top: 80.0), + body: CollapsingListView( + title: LocaleKeys.medicalFile.tr(context: context), + isLeading: false, + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.medicalFile.tr(context: context).toText22(isBold: true).paddingSymmetrical(24.h, 0.0), SizedBox(height: 16.h), TextInputWidget( labelText: LocaleKeys.search.tr(context: context), @@ -342,37 +345,36 @@ class _MedicalFilePageState extends State { child: FadeInAnimation( child: Row( children: [ - Utils.buildSvgWithAssets( - icon: AppAssets.prescription_item_icon, - width: 40.h, - height: 40.h, - ), - SizedBox(width: 8.h), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Column( - children: [ - // SizedBox(width: 150.h, child: prescriptionVM.prescriptionDetailsList[index].itemDescription!.toText12(isBold: true, maxLine: 1)), - // SizedBox( - // width: 150.h, - // child: - // "Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}" - // .needTranslation - // .toText10(weight: FontWeight.w500, color: AppColors.greyTextColor, letterSpacing: -0.4), - // ), - ], - ), - SizedBox(width: 68.h), - Utils.buildSvgWithAssets( - icon: AppAssets.forward_arrow_icon, - iconColor: AppColors.blackColor, - width: 18.h, - height: 13.h, - fit: BoxFit.contain, - ), - ], + Image.network( + prescriptionVM.patientPrescriptionOrders[index].doctorImageURL!, + width: 63.h, + height: 63.h, + fit: BoxFit.fill, + ).circle(100), + SizedBox(width: 16.h), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + prescriptionVM.patientPrescriptionOrders[index].doctorName!.toText16(isBold: true), + SizedBox(height: 4.h), + Wrap( + direction: Axis.horizontal, + spacing: 3.h, + runSpacing: 4.h, + children: [ + AppCustomChipWidget(labelText: prescriptionVM.patientPrescriptionOrders[index].clinicDescription!), + AppCustomChipWidget( + icon: AppAssets.doctor_calendar_icon, + labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(prescriptionVM.patientPrescriptionOrders[index].appointmentDate), false), + ), + ], + ), + ], + ), ), + SizedBox(width: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor), ], ), ), @@ -382,11 +384,11 @@ class _MedicalFilePageState extends State { separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), ).onPress(() { prescriptionVM.setPrescriptionsDetailsLoading(); - // Navigator.of(context).push( - // FadePage( - // page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()), - // ), - // ); + Navigator.of(context).push( + FadePage( + page: PrescriptionDetailPage(prescriptionsResponseModel: prescriptionVM.patientPrescriptionOrders[index]), + ), + ); }), SizedBox(height: 16.h), const Divider(color: AppColors.dividerColor), @@ -397,16 +399,11 @@ class _MedicalFilePageState extends State { child: CustomButton( text: "All Prescriptions".needTranslation, onPressed: () { - // Navigator.of(context) - // .push( - // FadePage( - // page: PrescriptionsListPage(), - // ), - // ) - // .then((val) { - // prescriptionsViewModel.setPrescriptionsDetailsLoading(); - // prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); - // }); + Navigator.of(context).push( + FadePage( + page: PrescriptionsListPage(), + ), + ); }, backgroundColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor, @@ -420,6 +417,23 @@ class _MedicalFilePageState extends State { iconSize: 16.h, ), ), + SizedBox(width: 10.h), + Expanded( + child: CustomButton( + text: "All Medications".needTranslation, + onPressed: () {}, + backgroundColor: AppColors.secondaryLightRedColor, + borderColor: AppColors.secondaryLightRedColor, + textColor: AppColors.primaryRedColor, + fontSize: 14, + fontWeight: FontWeight.w500, + borderRadius: 12.h, + height: 40.h, + icon: AppAssets.all_medications_icon, + iconColor: AppColors.primaryRedColor, + iconSize: 16.h, + ), + ), ], ), ],