|
|
|
|
@ -654,299 +654,354 @@ class _LandingPageState extends State<LandingPage> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Main card selector based on index and priority
|
|
|
|
|
Widget getIndexSwiperCard(int index) {
|
|
|
|
|
// Index 0: Priority cards (Queue > LiveCare > Upcoming Appointment > History)
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
if (myAppointmentsViewModel.isPatientHasQueueAppointment) {
|
|
|
|
|
return Container(
|
|
|
|
|
return _buildFirstCardSlot();
|
|
|
|
|
}
|
|
|
|
|
// Index 1: Secondary cards based on first card type
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
return _buildSecondCardSlot();
|
|
|
|
|
}
|
|
|
|
|
// Index 2: Tertiary cards
|
|
|
|
|
if (index == 2) {
|
|
|
|
|
return _buildThirdCardSlot();
|
|
|
|
|
}
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// First slot: Shows highest priority card
|
|
|
|
|
Widget _buildFirstCardSlot() {
|
|
|
|
|
if (myAppointmentsViewModel.isPatientHasQueueAppointment) {
|
|
|
|
|
return _buildQueueCard();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
|
|
|
|
|
return _buildLiveCareRequestCard();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (myAppointmentsViewModel.patientUpcomingAppointmentsHistoryList.isNotEmpty) {
|
|
|
|
|
return _buildAppointmentCardWrapper(
|
|
|
|
|
myAppointmentsViewModel.patientUpcomingAppointmentsHistoryList.first,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _buildAppointmentCardWrapper(
|
|
|
|
|
myAppointmentsViewModel.patientAppointmentsHistoryList[0],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Second slot: Shows appointment or ancillary orders
|
|
|
|
|
Widget _buildSecondCardSlot() {
|
|
|
|
|
final hasQueueOrLiveCare = myAppointmentsViewModel.isPatientHasQueueAppointment || immediateLiveCareViewModel.patientHasPendingLiveCareRequest;
|
|
|
|
|
|
|
|
|
|
if (hasQueueOrLiveCare) {
|
|
|
|
|
return _buildAppointmentCardWrapper(
|
|
|
|
|
myAppointmentsViewModel.patientAppointmentsHistoryList.first,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (todoSectionViewModel.patientAncillaryOrdersList.isNotEmpty) {
|
|
|
|
|
return _buildAncillaryOrderCardWrapper(
|
|
|
|
|
todoSectionViewModel.patientAncillaryOrdersList.first,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _buildAppointmentCardWrapper(
|
|
|
|
|
myAppointmentsViewModel.patientAppointmentsHistoryList[1],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Third slot: Shows ancillary orders or appointment
|
|
|
|
|
Widget _buildThirdCardSlot() {
|
|
|
|
|
final hasQueueOrLiveCare = myAppointmentsViewModel.isPatientHasQueueAppointment || immediateLiveCareViewModel.patientHasPendingLiveCareRequest;
|
|
|
|
|
final hasAncillaryOrders = todoSectionViewModel.patientAncillaryOrdersList.isNotEmpty;
|
|
|
|
|
|
|
|
|
|
if (hasQueueOrLiveCare && hasAncillaryOrders) {
|
|
|
|
|
return _buildAncillaryOrderCardWrapper(
|
|
|
|
|
todoSectionViewModel.patientAncillaryOrdersList.first,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _buildAppointmentCardWrapper(
|
|
|
|
|
myAppointmentsViewModel.patientAppointmentsHistoryList[2],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Queue Card Widget
|
|
|
|
|
Widget _buildQueueCard() {
|
|
|
|
|
final currentQueue = myAppointmentsViewModel.currentPatientQueueDetails;
|
|
|
|
|
final currentStatus = myAppointmentsViewModel.currentQueueStatus;
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 20.h,
|
|
|
|
|
hasShadow: false,
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
color: Utils.getCardBorderColor(currentStatus),
|
|
|
|
|
width: 2.w,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
_buildQueueHeader(currentStatus),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
_buildQueueGreeting(),
|
|
|
|
|
SizedBox(height: 2.h),
|
|
|
|
|
LocaleKeys.thankYouForPatience.tr().toText12(
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
color: AppColors.textColorLight,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
currentQueue.queueNo!.toText28(isBold: true),
|
|
|
|
|
SizedBox(height: 6.h),
|
|
|
|
|
_buildServingNowSection(),
|
|
|
|
|
SizedBox(height: 5.h),
|
|
|
|
|
_buildQueueActionButton(currentStatus, currentQueue.roomNo ?? ""),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(page: AppointmentQueuePage()),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Queue Card: Header with status chip and icon
|
|
|
|
|
Widget _buildQueueHeader(int currentStatus) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: currentStatus == 0 ? LocaleKeys.inQueue.tr() : LocaleKeys.yourTurn.tr(),
|
|
|
|
|
backgroundColor: Utils.getCardBorderColor(currentStatus).withValues(alpha: 0.20),
|
|
|
|
|
textColor: Utils.getCardBorderColor(currentStatus),
|
|
|
|
|
),
|
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
|
icon: AppAssets.waiting_icon,
|
|
|
|
|
width: 24.h,
|
|
|
|
|
height: 24.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Queue Card: Greeting text
|
|
|
|
|
Widget _buildQueueGreeting() {
|
|
|
|
|
return LocaleKeys.halaFirstName.tr(namedArgs: {'firstName': appState.getAuthenticatedUser()!.firstName!}).toText16(isBold: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Queue Card: Currently serving section
|
|
|
|
|
Widget _buildServingNowSection() {
|
|
|
|
|
if (myAppointmentsViewModel.patientQueueDetailsList.isEmpty) {
|
|
|
|
|
return SizedBox(height: 12.h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final servingQueue = myAppointmentsViewModel.patientQueueDetailsList.first;
|
|
|
|
|
final isVitalCall = servingQueue.callType == 1;
|
|
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
"${LocaleKeys.servingNow.tr()}: ".toText14(isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
servingQueue.queueNo!.toText12(isBold: true),
|
|
|
|
|
SizedBox(width: 8.w),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
deleteIcon: isVitalCall ? AppAssets.call_for_vitals : AppAssets.call_for_doctor,
|
|
|
|
|
labelText: isVitalCall ? LocaleKeys.callForVitalSigns.tr() : LocaleKeys.callForDoctor.tr(),
|
|
|
|
|
iconColor: isVitalCall ? AppColors.primaryRedColor : AppColors.successColor,
|
|
|
|
|
textColor: isVitalCall ? AppColors.primaryRedColor : AppColors.successColor,
|
|
|
|
|
iconSize: 14.w,
|
|
|
|
|
backgroundColor: isVitalCall ? AppColors.primaryRedColor.withValues(alpha: 0.1) : AppColors.successColor.withValues(alpha: 0.1),
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(
|
|
|
|
|
start: 8.h,
|
|
|
|
|
end: -2.h,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Queue Card: Action button
|
|
|
|
|
Widget _buildQueueActionButton(int currentStatus, String roomNo) {
|
|
|
|
|
return CustomButton(
|
|
|
|
|
text: Utils.getCardButtonText(currentStatus, roomNo),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
backgroundColor: Utils.getCardButtonColor(currentStatus),
|
|
|
|
|
borderColor: Utils.getCardButtonColor(currentStatus).withValues(alpha: 0.01),
|
|
|
|
|
textColor: Utils.getCardButtonTextColor(currentStatus),
|
|
|
|
|
fontSize: 12.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
iconColor: AppColors.whiteColor,
|
|
|
|
|
iconSize: 18.h,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LiveCare Request Card Widget
|
|
|
|
|
Widget _buildLiveCareRequestCard() {
|
|
|
|
|
final liveCareData = immediateLiveCareViewModel.patientLiveCareHistoryList[0];
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 20.h,
|
|
|
|
|
hasShadow: false,
|
|
|
|
|
side: BorderSide(color: Utils.getCardBorderColor(myAppointmentsViewModel.currentQueueStatus), width: 2.w),
|
|
|
|
|
borderRadius: 20.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: myAppointmentsViewModel.currentQueueStatus == 0 ? LocaleKeys.inQueue.tr() : LocaleKeys.yourTurn.tr(),
|
|
|
|
|
backgroundColor: Utils.getCardBorderColor(myAppointmentsViewModel.currentQueueStatus).withValues(alpha: 0.20),
|
|
|
|
|
textColor: Utils.getCardBorderColor(myAppointmentsViewModel.currentQueueStatus),
|
|
|
|
|
),
|
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.immediateLiveCareRequest.tr(context: context).toText16(isBold: true),
|
|
|
|
|
SizedBox(height: 10.h),
|
|
|
|
|
_buildLiveCareHeader(liveCareData),
|
|
|
|
|
SizedBox(height: 10.h),
|
|
|
|
|
_buildLiveCareGreeting(),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
LocaleKeys.halaFirstName.tr(namedArgs: {'firstName': appState.getAuthenticatedUser()!.firstName!}).toText16(isBold: true),
|
|
|
|
|
SizedBox(height: 2.h),
|
|
|
|
|
LocaleKeys.thankYouForPatience.tr().toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
|
|
|
|
|
_buildLiveCareQueueInfo(liveCareData.patCount),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
myAppointmentsViewModel.currentPatientQueueDetails.queueNo!.toText28(isBold: true),
|
|
|
|
|
SizedBox(height: 6.h),
|
|
|
|
|
myAppointmentsViewModel.patientQueueDetailsList.isNotEmpty
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
"${LocaleKeys.servingNow.tr()}: ".toText14(isBold: true),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
myAppointmentsViewModel.patientQueueDetailsList.first.queueNo!.toText12(isBold: true),
|
|
|
|
|
SizedBox(width: 8.w),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
deleteIcon: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1
|
|
|
|
|
? AppAssets.call_for_vitals
|
|
|
|
|
: AppAssets.call_for_doctor,
|
|
|
|
|
labelText: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1
|
|
|
|
|
? LocaleKeys.callForVitalSigns.tr()
|
|
|
|
|
: LocaleKeys.callForDoctor.tr(),
|
|
|
|
|
iconColor: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1
|
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
|
: AppColors.successColor,
|
|
|
|
|
textColor: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1
|
|
|
|
|
? AppColors.primaryRedColor
|
|
|
|
|
: AppColors.successColor,
|
|
|
|
|
iconSize: 14.w,
|
|
|
|
|
backgroundColor: myAppointmentsViewModel.patientQueueDetailsList.first.callType == 1
|
|
|
|
|
? AppColors.primaryRedColor.withValues(alpha: 0.1)
|
|
|
|
|
: AppColors.successColor.withValues(alpha: 0.1),
|
|
|
|
|
labelPadding: EdgeInsetsDirectional.only(start: 8.h, end: -2.h),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(height: 12.h),
|
|
|
|
|
SizedBox(height: 5.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: Utils.getCardButtonText(
|
|
|
|
|
myAppointmentsViewModel.currentQueueStatus, myAppointmentsViewModel.currentPatientQueueDetails.roomNo ?? ""),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
backgroundColor: Utils.getCardButtonColor(myAppointmentsViewModel.currentQueueStatus),
|
|
|
|
|
borderColor: Utils.getCardButtonColor(myAppointmentsViewModel.currentQueueStatus).withValues(alpha: 0.01),
|
|
|
|
|
textColor: Utils.getCardButtonTextColor(myAppointmentsViewModel.currentQueueStatus),
|
|
|
|
|
fontSize: 12.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
iconColor: AppColors.whiteColor,
|
|
|
|
|
iconSize: 18.h,
|
|
|
|
|
),
|
|
|
|
|
_buildLiveCareWaitingTime(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
).paddingSymmetrical(0.h, 0.h).onPress(() {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: AppointmentQueuePage(),
|
|
|
|
|
),
|
|
|
|
|
CustomPageRoute(page: ImmediateLiveCarePendingRequestPage()),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
} else if (immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
|
|
|
|
|
return Column(
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LiveCare Card: Header with status and date
|
|
|
|
|
Widget _buildLiveCareHeader(liveCareData) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 20.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.immediateLiveCareRequest.tr(context: context).toText16(isBold: true),
|
|
|
|
|
SizedBox(height: 10.h),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: immediateLiveCareViewModel.patientLiveCareHistoryList[0].stringCallStatus,
|
|
|
|
|
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.20),
|
|
|
|
|
textColor: AppColors.alertColor,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8.w),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
icon: AppAssets.appointment_calendar_icon,
|
|
|
|
|
labelText: DateUtil.formatDateToDate(
|
|
|
|
|
DateUtil.convertStringToDate(immediateLiveCareViewModel.patientLiveCareHistoryList[0].arrivalTime), false)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.waiting_icon, width: 24.h, height: 24.h),
|
|
|
|
|
// Lottie.asset(AppAnimations.pending_loading_animation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.cover),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10.h),
|
|
|
|
|
LocaleKeys.halaFirstName
|
|
|
|
|
.tr(namedArgs: {'firstName': appState.getAuthenticatedUser()!.firstName!}, context: context).toText16(isBold: true),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
LocaleKeys.yourTurnIsAfterPatients.tr(
|
|
|
|
|
namedArgs: {'count': immediateLiveCareViewModel.patientLiveCareHistoryList[0].patCount.toString()},
|
|
|
|
|
context: context).toText14(isBold: true),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"${LocaleKeys.waitingTime.tr()}: ".toText12(isBold: true),
|
|
|
|
|
SizedBox(height: 7.h),
|
|
|
|
|
ValueListenableBuilder<Duration>(
|
|
|
|
|
valueListenable: immediateLiveCareViewModel.durationNotifier,
|
|
|
|
|
builder: (context, duration, child) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
buildTime(duration),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: liveCareData.stringCallStatus,
|
|
|
|
|
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.20),
|
|
|
|
|
textColor: AppColors.alertColor,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8.w),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
icon: AppAssets.appointment_calendar_icon,
|
|
|
|
|
labelText: DateUtil.formatDateToDate(
|
|
|
|
|
DateUtil.convertStringToDate(liveCareData.arrivalTime),
|
|
|
|
|
false,
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(0.h, 0.h).onPress(() {
|
|
|
|
|
Navigator.of(context).push(CustomPageRoute(page: ImmediateLiveCarePendingRequestPage()));
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
} else if (myAppointmentsViewModel.patientUpcomingAppointmentsHistoryList.isNotEmpty) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: AppointmentCard(
|
|
|
|
|
patientAppointmentHistoryResponseModel: myAppointmentsViewModel.patientUpcomingAppointmentsHistoryList.first,
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isFromHomePage: true,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: AppointmentCard(
|
|
|
|
|
patientAppointmentHistoryResponseModel: myAppointmentsViewModel.patientAppointmentsHistoryList[index],
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isFromHomePage: true,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else if (index == 1) {
|
|
|
|
|
if (myAppointmentsViewModel.isPatientHasQueueAppointment || immediateLiveCareViewModel.patientHasPendingLiveCareRequest) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: AppointmentCard(
|
|
|
|
|
patientAppointmentHistoryResponseModel: myAppointmentsViewModel.patientAppointmentsHistoryList.first,
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isFromHomePage: true,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else if (todoSectionViewModel.patientAncillaryOrdersList.isNotEmpty) {
|
|
|
|
|
return AncillaryOrderCard(
|
|
|
|
|
order: todoSectionViewModel.patientAncillaryOrdersList.first,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isOrdersList: false,
|
|
|
|
|
onCheckIn: () {
|
|
|
|
|
log("Check-in for order: ${todoSectionViewModel.patientAncillaryOrdersList.first.orderNo}");
|
|
|
|
|
},
|
|
|
|
|
onViewDetails: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: AncillaryOrderDetailsList(
|
|
|
|
|
appointmentNoVida: todoSectionViewModel.patientAncillaryOrdersList.first.appointmentNo ?? 0,
|
|
|
|
|
orderNo: todoSectionViewModel.patientAncillaryOrdersList.first.orderNo ?? 0,
|
|
|
|
|
projectID: todoSectionViewModel.patientAncillaryOrdersList.first.projectID ?? 0,
|
|
|
|
|
projectName: todoSectionViewModel.patientAncillaryOrdersList.first.projectName ?? "",
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: AppointmentCard(
|
|
|
|
|
patientAppointmentHistoryResponseModel: myAppointmentsViewModel.patientAppointmentsHistoryList[index],
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isFromHomePage: true,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else if (index == 2) {
|
|
|
|
|
if ((myAppointmentsViewModel.isPatientHasQueueAppointment || immediateLiveCareViewModel.patientHasPendingLiveCareRequest) &&
|
|
|
|
|
todoSectionViewModel.patientAncillaryOrdersList.isNotEmpty) {
|
|
|
|
|
return AncillaryOrderCard(
|
|
|
|
|
order: todoSectionViewModel.patientAncillaryOrdersList.first,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isOrdersList: false,
|
|
|
|
|
onCheckIn: () {
|
|
|
|
|
log("Check-in for order: ${todoSectionViewModel.patientAncillaryOrdersList.first.orderNo}");
|
|
|
|
|
},
|
|
|
|
|
onViewDetails: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: AncillaryOrderDetailsList(
|
|
|
|
|
appointmentNoVida: todoSectionViewModel.patientAncillaryOrdersList.first.appointmentNo ?? 0,
|
|
|
|
|
orderNo: todoSectionViewModel.patientAncillaryOrdersList.first.orderNo ?? 0,
|
|
|
|
|
projectID: todoSectionViewModel.patientAncillaryOrdersList.first.projectID ?? 0,
|
|
|
|
|
projectName: todoSectionViewModel.patientAncillaryOrdersList.first.projectName ?? "",
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Utils.buildSvgWithAssets(
|
|
|
|
|
icon: AppAssets.waiting_icon,
|
|
|
|
|
width: 24.h,
|
|
|
|
|
height: 24.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LiveCare Card: Greeting
|
|
|
|
|
Widget _buildLiveCareGreeting() {
|
|
|
|
|
return LocaleKeys.halaFirstName.tr(
|
|
|
|
|
namedArgs: {'firstName': appState.getAuthenticatedUser()!.firstName!},
|
|
|
|
|
context: context,
|
|
|
|
|
).toText16(isBold: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LiveCare Card: Queue position info
|
|
|
|
|
Widget _buildLiveCareQueueInfo(int? patCount) {
|
|
|
|
|
return LocaleKeys.yourTurnIsAfterPatients.tr(
|
|
|
|
|
namedArgs: {'count': (patCount ?? 0).toString()},
|
|
|
|
|
context: context,
|
|
|
|
|
).toText14(isBold: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LiveCare Card: Waiting time counter
|
|
|
|
|
Widget _buildLiveCareWaitingTime() {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"${LocaleKeys.waitingTime.tr()}: ".toText12(isBold: true),
|
|
|
|
|
SizedBox(height: 7.h),
|
|
|
|
|
ValueListenableBuilder<Duration>(
|
|
|
|
|
valueListenable: immediateLiveCareViewModel.durationNotifier,
|
|
|
|
|
builder: (context, duration, child) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
buildTime(duration),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: AppointmentCard(
|
|
|
|
|
patientAppointmentHistoryResponseModel: myAppointmentsViewModel.patientAppointmentsHistoryList[index],
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isFromHomePage: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Appointment Card Wrapper (reusable)
|
|
|
|
|
Widget _buildAppointmentCardWrapper(appointment) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.r,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: AppointmentCard(
|
|
|
|
|
patientAppointmentHistoryResponseModel: appointment,
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
bookAppointmentsViewModel: bookAppointmentsViewModel,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isFromHomePage: true,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ancillary Order Card Wrapper (reusable)
|
|
|
|
|
Widget _buildAncillaryOrderCardWrapper(order) {
|
|
|
|
|
return AncillaryOrderCard(
|
|
|
|
|
order: order,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
isOrdersList: false,
|
|
|
|
|
onCheckIn: () {
|
|
|
|
|
log("Check-in for order: ${order.orderNo}");
|
|
|
|
|
},
|
|
|
|
|
onViewDetails: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: AncillaryOrderDetailsList(
|
|
|
|
|
appointmentNoVida: order.appointmentNo ?? 0,
|
|
|
|
|
orderNo: order.orderNo ?? 0,
|
|
|
|
|
projectID: order.projectID ?? 0,
|
|
|
|
|
projectName: order.projectName ?? "",
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Container();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void showQuickLogin(BuildContext context) {
|
|
|
|
|
|