diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 86e02da3..cdee10db 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -110,16 +110,19 @@ class _MedicalFilePageState extends State { appState = getIt.get(); scheduleMicrotask(() { if (appState.isAuthenticated) { - myAppointmentsViewModel.getPatientMyDoctors(isTop8: true); - prescriptionsViewModel.initPrescriptionsViewModel(); insuranceViewModel.initInsuranceProvider(); - medicalFileViewModel.setIsPatientSickLeaveListLoading(true); - medicalFileViewModel.getPatientSickLeaveList(); - medicalFileViewModel.onTabChanged(0); - medicalFileViewModel.setIsPatientMedicalReportsLoading(true); - medicalFileViewModel.getPatientMedicalReportList(); // Load vital signs hmgServicesViewModel.getPatientVitalSign(); + + // myAppointmentsViewModel.getPatientMyDoctors(isTop8: true); + // prescriptionsViewModel.initPrescriptionsViewModel(); + + // medicalFileViewModel.setIsPatientSickLeaveListLoading(true); + // medicalFileViewModel.getPatientSickLeaveList(); + // medicalFileViewModel.setIsPatientMedicalReportsLoading(true); + // medicalFileViewModel.getPatientMedicalReportList(); + + medicalFileViewModel.onTabChanged(0); } }); super.initState(); @@ -236,8 +239,8 @@ class _MedicalFilePageState extends State { children: [ SizedBox( width: MediaQuery.of(context).size.width * 0.6, - child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}" - .toText18(isBold: true, textOverflow: TextOverflow.ellipsis, maxlines: 2), + child: + "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true, textOverflow: TextOverflow.ellipsis, maxlines: 2), ), SizedBox(height: 4.h), Wrap( @@ -482,7 +485,18 @@ class _MedicalFilePageState extends State { dividerColor: AppColors.dividerColor, itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h), onItemToggled: (index, isExpanded) { - print("Item at index $index is now ${isExpanded ? 'expanded' : 'collapsed'}"); + debugPrint("Item at index $index is now ${isExpanded ? 'expanded' : 'collapsed'}"); + + if (index == 0 && isExpanded) { + myAppointmentsViewModel.getPatientMyDoctors(isTop8: true); + prescriptionsViewModel.initPrescriptionsViewModel(); + } + if (index == 1 && isExpanded) { + medicalFileViewModel.setIsPatientSickLeaveListLoading(true); + medicalFileViewModel.getPatientSickLeaveList(); + medicalFileViewModel.setIsPatientMedicalReportsLoading(true); + medicalFileViewModel.getPatientMedicalReportList(); + } }, items: [ ExpandableListItem(