@ -1,4 +1,5 @@
import ' dart:async ' ;
import ' dart:async ' ;
import ' dart:ui ' as ui ;
import ' package:easy_localization/easy_localization.dart ' ;
import ' package:easy_localization/easy_localization.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
@ -7,17 +8,13 @@ import 'package:get_it/get_it.dart';
import ' package:hmg_patient_app_new/core/app_assets.dart ' ;
import ' package:hmg_patient_app_new/core/app_assets.dart ' ;
import ' package:hmg_patient_app_new/core/app_export.dart ' ;
import ' package:hmg_patient_app_new/core/app_export.dart ' ;
import ' package:hmg_patient_app_new/core/app_state.dart ' ;
import ' package:hmg_patient_app_new/core/app_state.dart ' ;
import ' package:hmg_patient_app_new/core/cache_consts.dart ' ;
import ' package:hmg_patient_app_new/core/dependencies.dart ' ;
import ' package:hmg_patient_app_new/core/dependencies.dart ' ;
import ' package:hmg_patient_app_new/core/enums.dart ' ;
import ' package:hmg_patient_app_new/core/utils/date_util.dart ' ;
import ' package:hmg_patient_app_new/core/utils/date_util.dart ' ;
import ' package:hmg_patient_app_new/core/utils/size_config.dart ' ;
import ' package:hmg_patient_app_new/core/utils/size_config.dart ' ;
import ' package:hmg_patient_app_new/core/utils/utils.dart ' ;
import ' package:hmg_patient_app_new/core/utils/utils.dart ' ;
import ' package:hmg_patient_app_new/extensions/route_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/route_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/string_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/string_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/widget_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/widget_extensions.dart ' ;
import ' package:hmg_patient_app_new/features/active_prescriptions/models/active_prescriptions_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/ask_doctor/ask_doctor_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/book_appointments/models/resp_models/doctors_list_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart ' ;
@ -26,7 +23,6 @@ import 'package:hmg_patient_app_new/features/hmg_services/models/ui_models/vital
import ' package:hmg_patient_app_new/features/insurance/insurance_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/insurance/insurance_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/lab/lab_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/lab/lab_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/models/patient_sickleave_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/models/patient_sickleave_response_model.dart ' ;
import ' package:hmg_patient_app_new/features/monthly_report/monthly_report_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/monthly_report/monthly_report_view_model.dart ' ;
@ -37,12 +33,10 @@ import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_mo
import ' package:hmg_patient_app_new/features/todo_section/todo_section_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/todo_section/todo_section_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart ' ;
import ' package:hmg_patient_app_new/generated/locale_keys.g.dart ' ;
import ' package:hmg_patient_app_new/generated/locale_keys.g.dart ' ;
import ' package:hmg_patient_app_new/presentation/active_medication/active_medication_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/allergies/allergies_list_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/allergies/allergies_list_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/appointments/my_appointments_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/appointments/my_appointments_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/appointments/my_doctors_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/appointments/my_doctors_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor_request_type_select.dart ' ;
import ' package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor_request_type_select.dart ' ;
import ' package:hmg_patient_app_new/presentation/ask_doctor/ask_doctor_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart ' ;
@ -58,14 +52,11 @@ import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
import ' package:hmg_patient_app_new/presentation/medical_file/eye_measurements_appointments_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/eye_measurements_appointments_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/patient_sickleaves_list_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/patient_sickleaves_list_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/vaccine_list_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/vaccine_list_page.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/health_tracker_menu_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/widgets/health_tools_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/widgets/health_tools_card.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/medical_file/widgets/medical_file_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/widgets/medical_report_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/widgets/medical_report_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/widgets/patient_sick_leave_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_file/widgets/patient_sick_leave_card.dart ' ;
import ' package:hmg_patient_app_new/presentation/medical_report/medical_reports_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/monthly_report/monthly_report.dart ' ;
import ' package:hmg_patient_app_new/presentation/my_family/my_family.dart ' ;
import ' package:hmg_patient_app_new/presentation/my_family/my_family.dart ' ;
import ' package:hmg_patient_app_new/presentation/my_invoices/my_invoices_list.dart ' ;
import ' package:hmg_patient_app_new/presentation/my_invoices/my_invoices_list.dart ' ;
import ' package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart ' ;
@ -73,7 +64,6 @@ import 'package:hmg_patient_app_new/presentation/radiology/radiology_orders_page
import ' package:hmg_patient_app_new/presentation/todo_section/todo_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/todo_section/todo_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/vital_sign/vital_sign_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/vital_sign/vital_sign_page.dart ' ;
import ' package:hmg_patient_app_new/services/cache_service.dart ' ;
import ' package:hmg_patient_app_new/services/cache_service.dart ' ;
import ' package:hmg_patient_app_new/services/dialog_service.dart ' ;
import ' package:hmg_patient_app_new/services/navigation_service.dart ' ;
import ' package:hmg_patient_app_new/services/navigation_service.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
import ' package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart ' ;
import ' package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart ' ;
@ -81,20 +71,16 @@ 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/chip/app_custom_chip_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/common_bottom_sheet.dart ' ;
import ' package:hmg_patient_app_new/widgets/common_bottom_sheet.dart ' ;
import ' package:hmg_patient_app_new/widgets/expandable_list_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/expandable_list_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/input_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart ' ;
import ' package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart ' ;
import ' package:hmg_patient_app_new/widgets/routes/custom_page_route.dart ' ;
import ' package:hmg_patient_app_new/widgets/routes/custom_page_route.dart ' ;
import ' package:hmg_patient_app_new/widgets/shimmer/common_shimmer_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/shimmer/common_shimmer_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/user_avatar_widget.dart ' ;
import ' package:hmg_patient_app_new/widgets/user_avatar_widget.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:provider/provider.dart ' ;
import ' package:url_launcher/url_launcher.dart ' ;
import ' ../../features/active_prescriptions/active_prescriptions_view_model.dart ' ;
import ' ../../features/active_prescriptions/active_prescriptions_view_model.dart ' ;
import ' ../prescriptions/prescription_detail_page.dart ' ;
import ' ../prescriptions/prescription_detail_page.dart ' ;
import ' widgets/medical_file_appointment_card.dart ' ;
import ' widgets/medical_file_appointment_card.dart ' ;
import ' dart:ui ' as ui ;
class MedicalFilePage extends StatefulWidget {
class MedicalFilePage extends StatefulWidget {
bool showBackIcon ;
bool showBackIcon ;
@ -121,10 +107,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
int currentIndex = 0 ;
int currentIndex = 0 ;
/ / Used to make the PageView height follow the card ' s intrinsic height
final GlobalKey _vitalSignMeasureKey = GlobalKey ( ) ;
double ? _vitalSignMeasuredHeight ;
@ override
@ override
void initState ( ) {
void initState ( ) {
appState = getIt . get < AppState > ( ) ;
appState = getIt . get < AppState > ( ) ;
@ -145,22 +127,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
super . initState ( ) ;
super . initState ( ) ;
}
}
void _scheduleVitalSignMeasure ( ) {
WidgetsBinding . instance . addPostFrameCallback ( ( _ ) {
final ctx = _vitalSignMeasureKey . currentContext ;
if ( ctx = = null ) return ;
final box = ctx . findRenderObject ( ) ;
if ( box is RenderBox ) {
final h = box . size . height ;
if ( h > 0 & & h ! = _vitalSignMeasuredHeight ) {
setState ( ( ) {
_vitalSignMeasuredHeight = h ;
} ) ;
}
}
} ) ;
}
@ override
@ override
Widget build ( BuildContext context ) {
Widget build ( BuildContext context ) {
labViewModel = Provider . of < LabViewModel > ( context , listen: false ) ;
labViewModel = Provider . of < LabViewModel > ( context , listen: false ) ;
@ -253,7 +219,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
UserAvatarWidget (
UserAvatarWidget (
width: 56. w ,
width: 56. h ,
height: 56. h ,
height: 56. h ,
fit: BoxFit . cover ,
fit: BoxFit . cover ,
isCircular: true ,
isCircular: true ,
@ -275,7 +241,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [
children: [
AppCustomChipWidget (
AppCustomChipWidget (
icon: AppAssets . file_icon ,
icon: AppAssets . file_icon ,
richText: " ${ LocaleKeys . fileno . tr ( context: context ) } : ${ appState . getAuthenticatedUser ( ) ! . patientId } " . toText10 ( isEnglishOnly: true ) ,
richText: " ${ LocaleKeys . fileno . tr ( context: context ) } : ${ appState . getAuthenticatedUser ( ) ! . patientId } "
. toText10 ( isEnglishOnly: true ) ,
labelPadding: EdgeInsetsDirectional . only ( start: - 4. w , end: 6. w ) ,
labelPadding: EdgeInsetsDirectional . only ( start: - 4. w , end: 6. w ) ,
) ,
) ,
AppCustomChipWidget (
AppCustomChipWidget (
@ -299,7 +266,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
runSpacing: 4. h ,
runSpacing: 4. h ,
children: [
children: [
AppCustomChipWidget (
AppCustomChipWidget (
labelText: LocaleKeys . ageYearsOld . tr ( namedArgs: { ' age ' : ' ${ appState . getAuthenticatedUser ( ) ! . age } ' , ' yearsOld ' : LocaleKeys . yearsOld . tr ( context: context ) } , context: context ) ,
labelText: LocaleKeys . ageYearsOld . tr (
namedArgs: { ' age ' : ' ${ appState . getAuthenticatedUser ( ) ! . age } ' , ' yearsOld ' : LocaleKeys . yearsOld . tr ( context: context ) } ,
context: context ) ,
labelPadding: EdgeInsetsDirectional . only ( start: 8. w , end: 8. w ) ,
labelPadding: EdgeInsetsDirectional . only ( start: 8. w , end: 8. w ) ,
) ,
) ,
AppCustomChipWidget (
AppCustomChipWidget (
@ -342,9 +311,14 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
onChipTap: ( ) {
onChipTap: ( ) {
if ( ! insuranceVM . isInsuranceActive ) {
if ( ! insuranceVM . isInsuranceActive ) {
insuranceVM . setIsInsuranceUpdateDetailsLoading ( true ) ;
insuranceVM . setIsInsuranceUpdateDetailsLoading ( true ) ;
insuranceVM . getPatientInsuranceDetailsForUpdate (
insuranceVM . getPatientInsuranceDetailsForUpdate ( appState . getAuthenticatedUser ( ) ! . patientId . toString ( ) ,
appState . getAuthenticatedUser ( ) ! . patientId . toString ( ) , appState . getAuthenticatedUser ( ) ! . patientIdentificationNo . toString ( ) ) ;
appState . getAuthenticatedUser ( ) ! . patientIdentificationNo . toString ( ) ) ;
showCommonBottomSheetWithoutHeight ( context , child: PatientInsuranceCardUpdateCard ( ) , callBackFunc: ( ) { } , title: " " , isCloseButtonVisible: false , isFullScreen: false ) ;
showCommonBottomSheetWithoutHeight ( context ,
child: PatientInsuranceCardUpdateCard ( ) ,
callBackFunc: ( ) { } ,
title: " " ,
isCloseButtonVisible: false ,
isFullScreen: false ) ;
/ / showCommonBottomSheetWithoutHeight (
/ / showCommonBottomSheetWithoutHeight (
/ / title: LocaleKeys . notice . tr ( context: navigationService . navigatorKey . currentContext ! ) ,
/ / title: LocaleKeys . notice . tr ( context: navigationService . navigatorKey . currentContext ! ) ,
/ / navigationService . navigatorKey . currentContext ! ,
/ / navigationService . navigatorKey . currentContext ! ,
@ -440,17 +414,16 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
) ;
) ;
}
}
/ / The cards define their own height ; measure the first rendered page once
/ / Responsive PageView with dynamic height constraint
_scheduleVitalSignMeasure ( ) ;
return ConstrainedBox (
final double hostHeight = _vitalSignMeasuredHeight ? ? ( 135. h ) ;
constraints: BoxConstraints (
minHeight: 135. h ,
return SizedBox (
maxHeight: isFoldable ? 160. h : ( isTablet ? 165. h : 135. h ) ,
height: hostHeight ,
) ,
child: PageView (
child: PageView (
controller: hmgServicesVM . vitalSignPageController ,
controller: hmgServicesVM . vitalSignPageController ,
onPageChanged: ( index ) {
onPageChanged: ( index ) {
hmgServicesVM . setVitalSignCurrentPage ( index ) ;
hmgServicesVM . setVitalSignCurrentPage ( index ) ;
_scheduleVitalSignMeasure ( ) ;
} ,
} ,
children: _buildVitalSignPages (
children: _buildVitalSignPages (
vitalSign: hmgServicesVM . vitalSignList . first ,
vitalSign: hmgServicesVM . vitalSignList . first ,
@ -461,7 +434,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
) ,
) ,
) ;
) ;
} ,
} ,
measureKey: _vitalSignMeasureKey ,
currentPageIndex: hmgServicesVM . vitalSignCurrentPage ,
currentPageIndex: hmgServicesVM . vitalSignCurrentPage ,
) ,
) ,
) ,
) ,
@ -519,7 +491,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
getSelectedTabData ( 0 ) ,
getSelectedTabData ( 0 ) ,
] ,
] ,
) ,
) ,
ExpandableListItem ( title: LocaleKeys . medicalReports . tr ( context: context ) . toText18 ( isBold: true ) , expandedBackgroundColor: Colors . transparent ,
ExpandableListItem (
title: LocaleKeys . medicalReports . tr ( context: context ) . toText18 ( isBold: true ) ,
expandedBackgroundColor: Colors . transparent ,
children: [
children: [
SizedBox ( height: 10. h ) ,
SizedBox ( height: 10. h ) ,
getSelectedTabData ( 2 ) ,
getSelectedTabData ( 2 ) ,
@ -590,10 +564,137 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
} ) ;
} ) ;
}
}
Widget getSelectedTabData ( int index ) {
Widget buildInsuranceTab ( int index ) {
switch ( index ) {
return Column (
case 0 :
children: [
/ / General Tab Data
Consumer < InsuranceViewModel > ( builder: ( context , insuranceVM , child ) {
return insuranceVM . isInsuranceLoading
? LabResultItemView (
onTap: ( ) { } ,
labOrder: null ,
index: index ,
isLoading: true ,
) . paddingSymmetrical ( 0. w , 0.0 )
: insuranceVM . patientInsuranceList . isNotEmpty
? PatientInsuranceCard (
insuranceCardDetailsModel: insuranceVM . patientInsuranceList . first ,
isInsuranceExpired: DateTime . now ( ) . isAfter (
DateUtil . convertStringToDate ( insuranceVM . patientInsuranceList . first . cardValidTo ) ,
) ,
)
: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . bgRedLightColor ,
borderRadius: 12. r ,
hasShadow: false ,
) ,
child: Utils . getNoDataWidget (
context ,
noDataText: LocaleKeys . noInsuranceWithHMG . tr ( context: context ) ,
isSmallWidget: true ,
width: 62. w ,
height: 62. h ,
callToActionButton: CustomButton (
icon: AppAssets . update_insurance_card_icon ,
iconColor: AppColors . successColor ,
iconSize: 15. h ,
text: " ${ LocaleKeys . updateInsurance . tr ( context: context ) } ${ LocaleKeys . updateInsuranceSubtitle . tr ( context: context ) } " ,
onPressed: ( ) {
insuranceViewModel . setIsInsuranceUpdateDetailsLoading ( true ) ;
insuranceViewModel . getPatientInsuranceDetailsForUpdate ( appState . getAuthenticatedUser ( ) ! . patientId . toString ( ) ,
appState . getAuthenticatedUser ( ) ! . patientIdentificationNo . toString ( ) ) ;
showCommonBottomSheetWithoutHeight ( context ,
child: PatientInsuranceCardUpdateCard ( ) ,
callBackFunc: ( ) { } ,
title: " " ,
isCloseButtonVisible: false ,
isFullScreen: false ) ;
} ,
backgroundColor: AppColors . bgGreenColor . withOpacity ( 0.20 ) ,
borderColor: AppColors . bgGreenColor . withOpacity ( 0.0 ) ,
textColor: AppColors . bgGreenColor ,
fontSize: 14. f ,
fontWeight: FontWeight . w600 ,
borderRadius: 12. r ,
padding: EdgeInsets . fromLTRB ( 10. w , 0 , 10. w , 0 ) ,
height: isFoldable ? 50. h : 40. h ,
) . paddingOnly ( left: 12. w , right: 12. w , bottom: 12. h ) ,
) ,
) . paddingSymmetrical ( 0. w , 0. h ) ;
} ) ,
SizedBox ( height: 10. h ) ,
GridView (
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: 3 ,
crossAxisSpacing: 10. h ,
mainAxisSpacing: 16. w ,
/ / mainAxisExtent: 120. h ,
) ,
physics: NeverScrollableScrollPhysics ( ) ,
padding: EdgeInsets . only ( top: 12. h ) ,
shrinkWrap: true ,
children: [
MedicalFileCard (
label: LocaleKeys . updateInsuranceInfo . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . update_insurance_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push ( CustomPageRoute ( page: InsuranceHomePage ( ) ) ) ;
} ) ,
MedicalFileCard (
label: " ${ LocaleKeys . approvals1 . tr ( context: context ) } ${ LocaleKeys . insurance . tr ( context: context ) } " ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . insurance_approval_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push (
CustomPageRoute (
page: InsuranceApprovalsPage ( ) ,
) ,
) ;
} ) ,
MedicalFileCard (
label: LocaleKeys . myInvoicesList . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . invoices_list_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push (
CustomPageRoute (
page: MyInvoicesList ( ) ,
) ,
) ;
} ) ,
MedicalFileCard (
label: LocaleKeys . ancillaryOrdersListNew . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . ancillary_orders_list_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
getIt . get < TodoSectionViewModel > ( ) . setIsAncillaryOrdersNeedReloading ( true ) ;
Navigator . of ( context ) . push (
CustomPageRoute (
page: ToDoPage ( ) ,
) ,
) ;
} ) ,
] ,
) . paddingSymmetrical ( 0. w , 0.0 ) ,
SizedBox ( height: 16. h ) ,
] ,
) ;
}
Widget buildMedicalServicesTab ( ) {
return Column (
return Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
@ -610,17 +711,16 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
) ,
) ,
] ,
] ,
) . paddingSymmetrical ( 0. w , 0. h ) . onPress ( ( ) {
) . paddingSymmetrical ( 0. w , 0. h ) . onPress ( ( ) {
Navigator . of ( context ) . push (
Navigator . of ( context ) . push ( CustomPageRoute ( page: MyAppointmentsPage ( ) ) ) ;
CustomPageRoute (
page: MyAppointmentsPage ( ) ,
) ,
) ;
} ) ,
} ) ,
SizedBox ( height: 16. h ) ,
SizedBox ( height: 16. h ) ,
Consumer < MyAppointmentsViewModel > ( builder: ( context , myAppointmentsVM , child ) {
Consumer < MyAppointmentsViewModel > ( builder: ( context , myAppointmentsVM , child ) {
/ / Provide an explicit height so the horizontal ListView has a bounded height
/ / Dynamic height that adapts to device and content
return SizedBox (
return ConstrainedBox (
height: 192. h ,
constraints: BoxConstraints (
minHeight: 150. h ,
maxHeight: isFoldable ? 230. h : ( isTablet ? 240. h : 180. h ) ,
) ,
child: myAppointmentsVM . isMyAppointmentsLoading
child: myAppointmentsVM . isMyAppointmentsLoading
? MedicalFileAppointmentCard (
? MedicalFileAppointmentCard (
patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel ( ) ,
patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel ( ) ,
@ -632,7 +732,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
? Container (
? Container (
padding: EdgeInsets . all ( 12. w ) ,
padding: EdgeInsets . all ( 12. w ) ,
width: MediaQuery . of ( context ) . size . width ,
width: MediaQuery . of ( context ) . size . width ,
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration ( color: AppColors . whiteColor , borderRadius: 12. r , hasShadow: false ) ,
decoration:
RoundedRectangleBorder ( ) . toSmoothCornerDecoration ( color: AppColors . whiteColor , borderRadius: 12. r , hasShadow: false ) ,
child: Column (
child: Column (
children: [
children: [
Utils . buildSvgWithAssets ( icon: AppAssets . home_calendar_icon , width: 32. h , height: 32. h ) ,
Utils . buildSvgWithAssets ( icon: AppAssets . home_calendar_icon , width: 32. h , height: 32. h ) ,
@ -791,7 +892,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
? const CommonShimmerWidget ( ) . paddingSymmetrical ( 0. w , 0. h )
? const CommonShimmerWidget ( ) . paddingSymmetrical ( 0. w , 0. h )
: prescriptionVM . patientPrescriptionOrders . isNotEmpty
: prescriptionVM . patientPrescriptionOrders . isNotEmpty
? Container (
? Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration ( color: AppColors . whiteColor , borderRadius: 20. r , hasShadow: false ) ,
decoration:
RoundedRectangleBorder ( ) . toSmoothCornerDecoration ( color: AppColors . whiteColor , borderRadius: 20. r , hasShadow: false ) ,
child: Padding (
child: Padding (
padding: EdgeInsets . all ( 16. w ) ,
padding: EdgeInsets . all ( 16. w ) ,
child: Column (
child: Column (
@ -812,7 +914,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [
children: [
Image . network (
Image . network (
prescriptionVM . patientPrescriptionOrders [ index ] . doctorImageURL ! ,
prescriptionVM . patientPrescriptionOrders [ index ] . doctorImageURL ! ,
width: 40. w ,
width: 40. h ,
height: 40. h ,
height: 40. h ,
fit: BoxFit . cover ,
fit: BoxFit . cover ,
) . circle ( 100. r ) ,
) . circle ( 100. r ) ,
@ -828,13 +930,15 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
spacing: 3. w ,
spacing: 3. w ,
runSpacing: 4. w ,
runSpacing: 4. w ,
children: [
children: [
AppCustomChipWidget ( labelText: prescriptionVM . patientPrescriptionOrders [ index ] . clinicDescription ! ) ,
AppCustomChipWidget (
labelText: prescriptionVM . patientPrescriptionOrders [ index ] . clinicDescription ! ) ,
Directionality (
Directionality (
textDirection: ui . TextDirection . ltr ,
textDirection: ui . TextDirection . ltr ,
child: AppCustomChipWidget (
child: AppCustomChipWidget (
icon: AppAssets . doctor_calendar_icon ,
icon: AppAssets . doctor_calendar_icon ,
labelText: DateUtil . formatDateToDate (
labelText: DateUtil . formatDateToDate (
DateUtil . convertStringToDate ( prescriptionVM . patientPrescriptionOrders [ index ] . appointmentDate ) ,
DateUtil . convertStringToDate (
prescriptionVM . patientPrescriptionOrders [ index ] . appointmentDate ) ,
false ,
false ,
) ,
) ,
isEnglishOnly: true ,
isEnglishOnly: true ,
@ -849,13 +953,19 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Transform . flip (
Transform . flip (
flipX: appState . isArabic ( ) ,
flipX: appState . isArabic ( ) ,
child: Utils . buildSvgWithAssets (
child: Utils . buildSvgWithAssets (
icon: AppAssets . forward_arrow_icon_small , width: 15. w , height: 15. h , fit: BoxFit . contain , iconColor: AppColors . textColor ) ) ,
icon: AppAssets . forward_arrow_icon_small ,
width: 15. w ,
height: 15. h ,
fit: BoxFit . contain ,
iconColor: AppColors . textColor ) ) ,
] ,
] ,
) . onPress ( ( ) {
) . onPress ( ( ) {
prescriptionVM . setPrescriptionsDetailsLoading ( ) ;
prescriptionVM . setPrescriptionsDetailsLoading ( ) ;
Navigator . of ( context ) . push (
Navigator . of ( context ) . push (
CustomPageRoute (
CustomPageRoute (
page: PrescriptionDetailPage ( isFromAppointments: false , prescriptionsResponseModel: prescriptionVM . patientPrescriptionOrders [ index ] ) ,
page: PrescriptionDetailPage (
isFromAppointments: false ,
prescriptionsResponseModel: prescriptionVM . patientPrescriptionOrders [ index ] ) ,
) ,
) ,
) ;
) ;
} ) ,
} ) ,
@ -963,7 +1073,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [
children: [
Image . network (
Image . network (
" https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png " ,
" https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png " ,
width: 64. w ,
width: 64. h ,
height: 64. h ,
height: 64. h ,
fit: BoxFit . cover ,
fit: BoxFit . cover ,
) . circle ( 100 ) . toShimmer2 ( isShow: true , radius: 50. r ) ,
) . circle ( 100 ) . toShimmer2 ( isShow: true , radius: 50. r ) ,
@ -987,8 +1097,11 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
height: 62. h ,
height: 62. h ,
) ,
) ,
) . paddingSymmetrical ( 0. w , 0. h )
) . paddingSymmetrical ( 0. w , 0. h )
: SizedBox (
: ConstrainedBox (
height: 110. h ,
constraints: BoxConstraints (
minHeight: 100. h ,
maxHeight: isFoldable ? 130. h : ( isTablet ? 140. h : 115. h ) ,
) ,
child: ListView . separated (
child: ListView . separated (
scrollDirection: Axis . horizontal ,
scrollDirection: Axis . horizontal ,
itemCount: myAppointmentsVM . patientMyDoctorsList . length ,
itemCount: myAppointmentsVM . patientMyDoctorsList . length ,
@ -1007,7 +1120,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [
children: [
Image . network (
Image . network (
myAppointmentsVM . patientMyDoctorsList [ index ] . doctorImageURL ! ,
myAppointmentsVM . patientMyDoctorsList [ index ] . doctorImageURL ! ,
width: 64. w ,
width: 64. h ,
height: 64. h ,
height: 64. h ,
fit: BoxFit . cover ,
fit: BoxFit . cover ,
) . circle ( 100 ) . toShimmer2 ( isShow: false , radius: 50. r ) ,
) . circle ( 100 ) . toShimmer2 ( isShow: false , radius: 50. r ) ,
@ -1015,7 +1128,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
SizedBox (
SizedBox (
width: 80. w ,
width: 80. w ,
child: ( myAppointmentsVM . patientMyDoctorsList [ index ] . doctorName )
child: ( myAppointmentsVM . patientMyDoctorsList [ index ] . doctorName )
. toString ( ) . toText12 ( isBold: true , isCenter: true , maxLine: 2 ) . toShimmer2 ( isShow: false ) ,
. toString ( )
. toText12 ( isBold: true , isCenter: true , maxLine: 2 )
. toShimmer2 ( isShow: false ) ,
) ,
) ,
] ,
] ,
) ,
) ,
@ -1030,7 +1145,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
LoaderBottomSheet . hideLoader ( ) ;
LoaderBottomSheet . hideLoader ( ) ;
Navigator . of ( context ) . push (
Navigator . of ( context ) . push (
CustomPageRoute (
CustomPageRoute (
page: DoctorProfilePage ( isDoctorAllowedToBook: ! ( myAppointmentsVM . patientMyDoctorsList [ index ] . isLiveCareClinic ? ? false ) ) ,
page: DoctorProfilePage (
isDoctorAllowedToBook: ! ( myAppointmentsVM . patientMyDoctorsList [ index ] . isLiveCareClinic ? ? false ) ) ,
) ,
) ,
) ;
) ;
} , onError: ( err ) {
} , onError: ( err ) {
@ -1057,9 +1173,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
GridView (
GridView (
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: 3 ,
crossAxisCount: 3 ,
childAspectRatio: 1 ,
crossAxisSpacing: 10. h ,
crossAxisSpacing: 10. h ,
mainAxisSpacing: 16. w ,
mainAxisExtent: 115. h ,
) ,
) ,
physics: NeverScrollableScrollPhysics ( ) ,
physics: NeverScrollableScrollPhysics ( ) ,
padding: EdgeInsets . zero ,
padding: EdgeInsets . zero ,
@ -1116,142 +1231,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
SizedBox ( height: 24. h ) ,
SizedBox ( height: 24. h ) ,
] ,
] ,
) ;
) ;
case 1 :
}
/ / Insurance Tab Data
return Column (
Widget buildRequestsTab ( ) {
children: [
Consumer < InsuranceViewModel > ( builder: ( context , insuranceVM , child ) {
return insuranceVM . isInsuranceLoading
? LabResultItemView (
onTap: ( ) { } ,
labOrder: null ,
index: index ,
isLoading: true ,
) . paddingSymmetrical ( 0. w , 0.0 )
: insuranceVM . patientInsuranceList . isNotEmpty
? PatientInsuranceCard (
insuranceCardDetailsModel: insuranceVM . patientInsuranceList . first ,
isInsuranceExpired: DateTime . now ( ) . isAfter (
DateUtil . convertStringToDate ( insuranceVM . patientInsuranceList . first . cardValidTo ) ,
) ,
)
: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. r ,
hasShadow: false ,
) ,
child: Utils . getNoDataWidget (
context ,
noDataText: LocaleKeys . noInsuranceWithHMG . tr ( context: context ) ,
isSmallWidget: true ,
width: 62. w ,
height: 62. h ,
callToActionButton: CustomButton (
icon: AppAssets . update_insurance_card_icon ,
iconColor: AppColors . successColor ,
iconSize: 15. h ,
text: " ${ LocaleKeys . updateInsurance . tr ( context: context ) } ${ LocaleKeys . updateInsuranceSubtitle . tr ( context: context ) } " ,
onPressed: ( ) {
insuranceViewModel . setIsInsuranceUpdateDetailsLoading ( true ) ;
insuranceViewModel . getPatientInsuranceDetailsForUpdate (
appState . getAuthenticatedUser ( ) ! . patientId . toString ( ) , appState . getAuthenticatedUser ( ) ! . patientIdentificationNo . toString ( ) ) ;
showCommonBottomSheetWithoutHeight ( context , child: PatientInsuranceCardUpdateCard ( ) , callBackFunc: ( ) { } , title: " " , isCloseButtonVisible: false , isFullScreen: false ) ;
} ,
backgroundColor: AppColors . bgGreenColor . withOpacity ( 0.20 ) ,
borderColor: AppColors . bgGreenColor . withOpacity ( 0.0 ) ,
textColor: AppColors . bgGreenColor ,
fontSize: 14. f ,
fontWeight: FontWeight . w600 ,
borderRadius: 12. r ,
padding: EdgeInsets . fromLTRB ( 10. w , 0 , 10. w , 0 ) ,
height: isFoldable ? 50. h : 40. h ,
) . paddingOnly ( left: 12. w , right: 12. w , bottom: 12. h ) ,
) ,
) . paddingSymmetrical ( 0. w , 0. h ) ;
} ) ,
SizedBox ( height: 10. h ) ,
GridView (
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: 3 ,
crossAxisSpacing: 10. h ,
mainAxisSpacing: 16. w ,
mainAxisExtent: 120. h ,
) ,
physics: NeverScrollableScrollPhysics ( ) ,
padding: EdgeInsets . only ( top: 12. h ) ,
shrinkWrap: true ,
children: [
MedicalFileCard (
label: LocaleKeys . updateInsuranceInfo . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . update_insurance_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push ( CustomPageRoute ( page: InsuranceHomePage ( ) ) ) ;
} ) ,
MedicalFileCard (
label: " ${ LocaleKeys . approvals1 . tr ( context: context ) } ${ LocaleKeys . insurance . tr ( context: context ) } " ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . insurance_approval_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push (
CustomPageRoute (
page: InsuranceApprovalsPage ( ) ,
) ,
) ;
} ) ,
MedicalFileCard (
label: LocaleKeys . myInvoicesList . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . invoices_list_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push (
CustomPageRoute (
page: MyInvoicesList ( ) ,
) ,
) ;
} ) ,
MedicalFileCard (
label: LocaleKeys . ancillaryOrdersListNew . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . ancillary_orders_list_icon ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
getIt . get < TodoSectionViewModel > ( ) . setIsAncillaryOrdersNeedReloading ( true ) ;
Navigator . of ( context ) . push (
CustomPageRoute (
page: ToDoPage ( ) ,
) ,
) ;
} ) ,
MedicalFileCard (
label: LocaleKeys . habibWallet . tr ( context: context ) ,
textColor: AppColors . blackColor ,
backgroundColor: AppColors . whiteColor ,
svgIcon: AppAssets . wallet ,
isLargeText: true ,
iconSize: 36. w ,
) . onPress ( ( ) {
Navigator . of ( context ) . push ( CustomPageRoute ( page: HabibWalletPage ( ) ) ) ;
} ) ,
] ,
) . paddingSymmetrical ( 0. w , 0.0 ) ,
SizedBox ( height: 16. h ) ,
] ,
) ;
case 2 :
/ / Requests Tab Data
return Column (
return Column (
children: [
children: [
Row (
Row (
@ -1301,79 +1283,23 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
) . paddingSymmetrical ( 0. w , 0. h ) ;
) . paddingSymmetrical ( 0. w , 0. h ) ;
} ) ,
} ) ,
SizedBox ( height: 16. h ) ,
SizedBox ( height: 16. h ) ,
Selector < MedicalFileViewModel , ( { bool isLoading , List < PatientMedicalReportResponseModel > listRequest , List < PatientMedicalReportResponseModel > listReady } ) > (
Selector < MedicalFileViewModel ,
selector: ( context , vm ) = > ( isLoading: vm . isPatientMedicalReportsListLoading , listRequest: vm . patientMedicalReportRequestedList , listReady: vm . patientMedicalReportReadyList ) ,
( { bool isLoading , List < PatientMedicalReportResponseModel > listRequest , List < PatientMedicalReportResponseModel > listReady } ) > (
builder: ( context , data , _ ) {
selector: ( context , vm ) = > (
return MedicalReportCard (
isLoading: vm . isPatientMedicalReportsListLoading ,
isLoading: data . isLoading , listRequest: data . listRequest , listReady: data . listReady
listRequest: vm . patientMedicalReportRequestedList ,
) ;
listReady: vm . patientMedicalReportReadyList
) ,
builder: ( context , data , _ ) {
return MedicalReportCard ( isLoading: data . isLoading , listRequest: data . listRequest , listReady: data . listReady ) ;
} ,
} ,
)
) ,
/ / GridView (
SizedBox ( height: 24. h ) ,
/ / gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
/ / crossAxisCount: 3 ,
/ / crossAxisSpacing: 10. h ,
/ / mainAxisSpacing: 16. w ,
/ / mainAxisExtent: 110. h ,
/ / ) ,
/ / physics: NeverScrollableScrollPhysics ( ) ,
/ / padding: EdgeInsets . zero ,
/ / shrinkWrap: true ,
/ / children: [
/ / / / MedicalFileCard (
/ / / / label: LocaleKeys . monthlyReports . tr ( context: context ) ,
/ / / / textColor: AppColors . blackColor ,
/ / / / backgroundColor: AppColors . whiteColor ,
/ / / / svgIcon: AppAssets . monthly_reports_icon ,
/ / / / isLargeText: true ,
/ / / / iconSize: 36. h ,
/ / / / ) . onPress ( ( ) {
/ / / / monthlyReportViewModel . setHealthSummaryEnabled ( cacheService . getBool ( key: CacheConst . isMonthlyReportEnabled ) ? ? false ) ;
/ / / / Navigator . of ( context ) . push (
/ / / / CustomPageRoute (
/ / / / page: MonthlyReport ( ) ,
/ / / / ) ,
/ / / / ) ;
/ / / / } ) ,
/ / / / / todo te changes of the medical report should be displayed here .
/ / / / /
/ /
/ / / / MedicalFileCard (
/ / / / label: LocaleKeys . medicalReports . tr ( context: context ) ,
/ / / / textColor: AppColors . blackColor ,
/ / / / backgroundColor: AppColors . whiteColor ,
/ / / / svgIcon: AppAssets . medical_reports_icon ,
/ / / / isLargeText: true ,
/ / / / iconSize: 36. w ,
/ / / / ) . onPress ( ( ) {
/ / / /
/ / / / Navigator . of ( context ) . push (
/ / / / CustomPageRoute (
/ / / / page: MedicalReportsPage ( ) ,
/ / / / ) ,
/ / / / ) ;
/ / / / } ) ,
/ / / / MedicalFileCard (
/ / / / label: LocaleKeys . sickLeaveReport . tr ( context: context ) ,
/ / / / textColor: AppColors . blackColor ,
/ / / / backgroundColor: AppColors . whiteColor ,
/ / / / svgIcon: AppAssets . sick_leave_report_icon ,
/ / / / isLargeText: true ,
/ / / / iconSize: 36. h ,
/ / / / ) . onPress ( ( ) {
/ / / / Navigator . of ( context ) . push (
/ / / / CustomPageRoute (
/ / / / page: PatientSickleavesListPage ( ) ,
/ / / / ) ,
/ / / / ) ;
/ / / / } ) ,
/ / ] ,
/ / ) . paddingSymmetrical ( 0. w , 0.0 ) ,
, SizedBox ( height: 24. h ) ,
] ,
] ,
) ;
) ;
case 3 :
}
/ / Health Tools Tab Data
Widget buildHealthToolsTab ( ) {
return Column (
return Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
@ -1382,7 +1308,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
crossAxisCount: 3 ,
crossAxisCount: 3 ,
crossAxisSpacing: 10. h ,
crossAxisSpacing: 10. h ,
mainAxisSpacing: 16. w ,
mainAxisSpacing: 16. w ,
mainAxisExtent: 120. h ,
) ,
) ,
physics: NeverScrollableScrollPhysics ( ) ,
physics: NeverScrollableScrollPhysics ( ) ,
padding: EdgeInsets . only ( top: 12. h ) ,
padding: EdgeInsets . only ( top: 12. h ) ,
@ -1393,7 +1318,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
label: LocaleKeys . healthTrackers . tr ( context: context ) ,
label: LocaleKeys . healthTrackers . tr ( context: context ) ,
textColor: AppColors . blackColor ,
textColor: AppColors . blackColor ,
svgIcon: AppAssets . general_health ,
svgIcon: AppAssets . general_health ,
iconColor: null ,
iconColor: null ,
iconSize: 24. w ,
iconSize: 24. w ,
) . onPress ( ( ) {
) . onPress ( ( ) {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
@ -1465,6 +1390,22 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
SizedBox ( height: 24. h ) ,
SizedBox ( height: 24. h ) ,
] ,
] ,
) ;
) ;
}
Widget getSelectedTabData ( int index ) {
switch ( index ) {
case 0 :
/ / General Tab Data
return buildMedicalServicesTab ( ) ;
case 1 :
/ / Insurance Tab Data
return buildInsuranceTab ( index ) ;
case 2 :
/ / Requests Tab Data
return buildRequestsTab ( ) ;
case 3 :
/ / Health Tools Tab Data
return buildHealthToolsTab ( ) ;
default :
default :
return Container ( ) ;
return Container ( ) ;
}
}
@ -1550,13 +1491,12 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
List < Widget > _buildVitalSignPages ( {
List < Widget > _buildVitalSignPages ( {
required VitalSignResModel vitalSign ,
required VitalSignResModel vitalSign ,
required VoidCallback onTap ,
required VoidCallback onTap ,
required GlobalKey measureKey ,
required int currentPageIndex ,
required int currentPageIndex ,
} ) {
} ) {
return [
return [
/ / Page 1 : BMI + Height
/ / Page 1 : BMI + Height
Padding (
Padding (
padding: EdgeInsets . only( left : 24. w ) ,
padding: EdgeInsets . symmetric( horizontal : 24. w ) ,
child: Row (
child: Row (
children: [
children: [
Expanded (
Expanded (
@ -1586,7 +1526,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
) ,
) ,
/ / Page 2 : Weight + Blood Pressure
/ / Page 2 : Weight + Blood Pressure
Padding (
Padding (
padding: EdgeInsets . symmetric ( horizontal: 1 2.w ) ,
padding: EdgeInsets . symmetric ( horizontal: 24 .w ) ,
child: Row (
child: Row (
children: [
children: [
Expanded (
Expanded (
@ -1604,13 +1544,17 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: _buildVitalSignCard (
child: _buildVitalSignCard (
icon: AppAssets . bloodPressure ,
icon: AppAssets . bloodPressure ,
label: LocaleKeys . bloodPressure . tr ( context: context ) ,
label: LocaleKeys . bloodPressure . tr ( context: context ) ,
value: ( vitalSign . bloodPressureLower ! = null & & vitalSign . bloodPressureHigher ! = null & &
value: ( vitalSign . bloodPressureLower ! = null & &
vitalSign . bloodPressureLower ! = 0 & & vitalSign . bloodPressureHigher ! = 0 )
vitalSign . bloodPressureHigher ! = null & &
vitalSign . bloodPressureLower ! = 0 & &
vitalSign . bloodPressureHigher ! = 0 )
? " ${ vitalSign . bloodPressureHigher } / ${ vitalSign . bloodPressureLower } "
? " ${ vitalSign . bloodPressureHigher } / ${ vitalSign . bloodPressureLower } "
: ' -- ' ,
: ' -- ' ,
unit: ' ' ,
unit: ' ' ,
status: ( vitalSign . bloodPressureLower ! = null & & vitalSign . bloodPressureHigher ! = null & &
status: ( vitalSign . bloodPressureLower ! = null & &
vitalSign . bloodPressureLower ! = 0 & & vitalSign . bloodPressureHigher ! = 0 )
vitalSign . bloodPressureHigher ! = null & &
vitalSign . bloodPressureLower ! = 0 & &
vitalSign . bloodPressureHigher ! = 0 )
? _getBloodPressureStatus (
? _getBloodPressureStatus (
systolic: vitalSign . bloodPressureHigher ,
systolic: vitalSign . bloodPressureHigher ,
diastolic: vitalSign . bloodPressureLower ,
diastolic: vitalSign . bloodPressureLower ,
@ -1694,7 +1638,8 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
weight: FontWeight . w600 ,
weight: FontWeight . w600 ,
) ,
) ,
) ,
) ,
Utils . buildSvgWithAssets ( icon: getIt . get < AppState > ( ) . isArabic ( ) ? AppAssets . arrow_back : AppAssets . arrow_forward , width: 18. w , height: 18. h ) ,
Utils . buildSvgWithAssets (
icon: getIt . get < AppState > ( ) . isArabic ( ) ? AppAssets . arrow_back : AppAssets . arrow_forward , width: 18. w , height: 18. h ) ,
] ,
] ,
) ,
) ,
SizedBox ( height: 14. h ) ,
SizedBox ( height: 14. h ) ,
@ -1714,11 +1659,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
mainAxisSize: MainAxisSize . min ,
mainAxisSize: MainAxisSize . min ,
children: [
children: [
Flexible (
Flexible (
child: value . toText17 (
child: value . toText17 ( isBold: true , color: AppColors . textColor , isEnglishOnly: true ) ,
isBold: true ,
color: AppColors . textColor ,
isEnglishOnly: true
) ,
) ,
) ,
if ( unit . isNotEmpty & & value ! = ' -- ' & & value ! = ' 0 ' ) . . . [
if ( unit . isNotEmpty & & value ! = ' -- ' & & value ! = ' 0 ' ) . . . [
SizedBox ( width: 3. w ) ,
SizedBox ( width: 3. w ) ,