pull down to refresh in appointment queue implemented

pull/213/head
haroon amjad 5 days ago
parent 991f9c7a9b
commit 185f505ed9

@ -930,6 +930,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
isPatientHasQueueAppointment = false; isPatientHasQueueAppointment = false;
isAppointmentQueueDetailsLoading = true; isAppointmentQueueDetailsLoading = true;
notifyListeners(); notifyListeners();
final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails( final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails(
appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID); appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);

@ -33,6 +33,11 @@ class AppointmentQueuePage extends StatelessWidget {
Expanded( Expanded(
child: CollapsingListView( child: CollapsingListView(
title: LocaleKeys.queueing.tr(context: context), title: LocaleKeys.queueing.tr(context: context),
child: RefreshIndicator(
color: AppColors.primaryRedColor,
onRefresh: () async {
await myAppointmentsVM.getPatientAppointmentQueueDetails();
},
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: EdgeInsets.all(24.0), padding: EdgeInsets.all(24.0),
@ -45,10 +50,7 @@ class AppointmentQueuePage extends StatelessWidget {
borderRadius: 20.h, borderRadius: 20.h,
hasShadow: false, hasShadow: false,
side: BorderSide( side: BorderSide(
color: myAppointmentsVM.isAppointmentQueueDetailsLoading color: myAppointmentsVM.isAppointmentQueueDetailsLoading ? AppColors.whiteColor : Utils.getCardBorderColor(myAppointmentsVM.currentQueueStatus), width: 2.w),
? AppColors.whiteColor
: Utils.getCardBorderColor(myAppointmentsVM.currentQueueStatus),
width: 2.w),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.h),
@ -67,21 +69,17 @@ class AppointmentQueuePage extends StatelessWidget {
], ],
).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading), ).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
SizedBox(height: 10.h), SizedBox(height: 10.h),
"Hala ${appState!.getAuthenticatedUser()!.firstName}!!!" "Hala ${appState!.getAuthenticatedUser()!.firstName}!!!".toText16(isBold: true).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
.toText16(isBold: true)
.toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
SizedBox(height: 8.h), SizedBox(height: 8.h),
LocaleKeys.thankYouForPatience.tr(context: context) LocaleKeys.thankYouForPatience
.tr(context: context)
.toText12(isBold: true, color: AppColors.textColorLight) .toText12(isBold: true, color: AppColors.textColorLight)
.toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading), .toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
SizedBox(height: 8.h), SizedBox(height: 8.h),
myAppointmentsVM.currentPatientQueueDetails.queueNo! myAppointmentsVM.currentPatientQueueDetails.queueNo!.toText32(isBold: true).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
.toText32(isBold: true)
.toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
SizedBox(height: 8.h), SizedBox(height: 8.h),
CustomButton( CustomButton(
text: Utils.getCardButtonText( text: Utils.getCardButtonText(myAppointmentsVM.currentQueueStatus, myAppointmentsVM.currentPatientQueueDetails.roomNo ?? ""),
myAppointmentsVM.currentQueueStatus, myAppointmentsVM.currentPatientQueueDetails.roomNo ?? ""),
onPressed: () {}, onPressed: () {},
backgroundColor: Utils.getCardButtonColor(myAppointmentsVM.currentQueueStatus), backgroundColor: Utils.getCardButtonColor(myAppointmentsVM.currentQueueStatus),
borderColor: Utils.getCardButtonColor(myAppointmentsVM.currentQueueStatus).withValues(alpha: 0.01), borderColor: Utils.getCardButtonColor(myAppointmentsVM.currentQueueStatus).withValues(alpha: 0.01),
@ -111,9 +109,7 @@ class AppointmentQueuePage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.servingNow.tr(context: context) LocaleKeys.servingNow.tr(context: context).toText16(isBold: true).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
.toText16(isBold: true)
.toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
SizedBox(height: 18.h), SizedBox(height: 18.h),
ListView.separated( ListView.separated(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
@ -129,22 +125,15 @@ class AppointmentQueuePage extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
"Room: ${myAppointmentsVM.patientQueueDetailsList[index].roomNo}" "Room: ${myAppointmentsVM.patientQueueDetailsList[index].roomNo}".toText12(isBold: true),
.toText12(isBold: true),
SizedBox(width: 8.w), SizedBox(width: 8.w),
AppCustomChipWidget( AppCustomChipWidget(
deleteIcon: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 deleteIcon: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 ? AppAssets.call_for_vitals : AppAssets.call_for_doctor,
? AppAssets.call_for_vitals
: AppAssets.call_for_doctor,
labelText: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 labelText: myAppointmentsVM.patientQueueDetailsList[index].callType == 1
? LocaleKeys.callForVitalSigns.tr(context: context) ? LocaleKeys.callForVitalSigns.tr(context: context)
: LocaleKeys.callForDoctor.tr(context: context), : LocaleKeys.callForDoctor.tr(context: context),
iconColor: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 iconColor: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 ? AppColors.primaryRedColor : AppColors.successColor,
? AppColors.primaryRedColor textColor: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 ? AppColors.primaryRedColor : AppColors.successColor,
: AppColors.successColor,
textColor: myAppointmentsVM.patientQueueDetailsList[index].callType == 1
? AppColors.primaryRedColor
: AppColors.successColor,
iconSize: 14.w, iconSize: 14.w,
backgroundColor: myAppointmentsVM.patientQueueDetailsList[index].callType == 1 backgroundColor: myAppointmentsVM.patientQueueDetailsList[index].callType == 1
? AppColors.primaryRedColor.withValues(alpha: 0.1) ? AppColors.primaryRedColor.withValues(alpha: 0.1)
@ -183,21 +172,15 @@ class AppointmentQueuePage extends StatelessWidget {
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
"${LocaleKeys.improveOverallHealth.tr(context: context)}" "${LocaleKeys.improveOverallHealth.tr(context: context)}".toText12(isBold: true, color: AppColors.textColorLight),
.toText12(isBold: true, color: AppColors.textColorLight),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${LocaleKeys.routineScreenings.tr(context: context)}" "${LocaleKeys.routineScreenings.tr(context: context)}".toText12(isBold: true, color: AppColors.textColorLight),
.toText12(isBold: true, color: AppColors.textColorLight),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${LocaleKeys.whatIsThisMedicationFor.tr(context: context)}" "${LocaleKeys.whatIsThisMedicationFor.tr(context: context)}".toText12(isBold: true, color: AppColors.textColorLight),
.toText12(isBold: true, color: AppColors.textColorLight),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${LocaleKeys.sideEffectsToKnow.tr(context: context)}" "${LocaleKeys.sideEffectsToKnow.tr(context: context)}".toText12(isBold: true, color: AppColors.textColorLight),
.toText12(isBold: true, color: AppColors.textColorLight),
SizedBox(height: 4.h), SizedBox(height: 4.h),
"${LocaleKeys.whenFollowUp.tr(context: context)}" "${LocaleKeys.whenFollowUp.tr(context: context)}".toText12(isBold: true, color: AppColors.textColorLight),
.toText12(isBold: true, color: AppColors.textColorLight),
SizedBox(height: 16.h), SizedBox(height: 16.h),
], ],
).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading), ).toShimmer2(isShow: myAppointmentsVM.isAppointmentQueueDetailsLoading),
@ -209,6 +192,7 @@ class AppointmentQueuePage extends StatelessWidget {
), ),
), ),
), ),
),
Container( Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,

@ -239,9 +239,7 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
value: bookAppointmentsVM.isNearestAppointmentSelected, value: bookAppointmentsVM.isNearestAppointmentSelected,
onChanged: (newValue) async { onChanged: (newValue) async {
bookAppointmentsVM.setIsNearestAppointmentSelected(newValue); bookAppointmentsVM.setIsNearestAppointmentSelected(newValue);
if(newValue) {
bookAppointmentsVM.refreshDoctorsList(); bookAppointmentsVM.refreshDoctorsList();
}
}, },
), ),
], ],

Loading…
Cancel
Save