|
|
|
|
@ -61,9 +61,9 @@ import 'package:provider/provider.dart';
|
|
|
|
|
import '../medical_file/widgets/medical_file_card.dart';
|
|
|
|
|
|
|
|
|
|
class AppointmentDetailsPage extends StatefulWidget {
|
|
|
|
|
const AppointmentDetailsPage({super.key, required this.patientAppointmentHistoryResponseModel});
|
|
|
|
|
AppointmentDetailsPage({super.key, required this.patientAppointmentHistoryResponseModel});
|
|
|
|
|
|
|
|
|
|
final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel;
|
|
|
|
|
PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<AppointmentDetailsPage> createState() => _AppointmentDetailsPageState();
|
|
|
|
|
@ -103,6 +103,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo);
|
|
|
|
|
} else {
|
|
|
|
|
if (widget.patientAppointmentHistoryResponseModel.nextAction == 110) {
|
|
|
|
|
myAppointmentsViewModel
|
|
|
|
|
.getAppointmentDetailsByAppointmentNumber(
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo,
|
|
|
|
|
clinicId: widget.patientAppointmentHistoryResponseModel.clinicID)
|
|
|
|
|
.then((val) {
|
|
|
|
|
widget.patientAppointmentHistoryResponseModel = myAppointmentsViewModel.currentSelectedAppointmentDetails;
|
|
|
|
|
myAppointmentsViewModel.updateAppointmentDetailsPage();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
Duration difference = DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate).difference(DateTime.now());
|
|
|
|
|
if (difference.inMinutes > 240) {
|
|
|
|
|
isAppointmentWithin4Hours = false;
|
|
|
|
|
@ -1043,8 +1054,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
if (widget.patientAppointmentHistoryResponseModel.nextAction == 15 ||
|
|
|
|
|
widget.patientAppointmentHistoryResponseModel.nextAction == 20)
|
|
|
|
|
if (widget.patientAppointmentHistoryResponseModel.nextAction == 15 || widget.patientAppointmentHistoryResponseModel.nextAction == 20)
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -1052,10 +1062,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.amountBeforeTax.tr(context: context).toText18(isBold: true),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
widget.patientAppointmentHistoryResponseModel.patientShare!.toString().toText16(isBold: true),
|
|
|
|
|
AppColors.blackColor,
|
|
|
|
|
13,
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(widget.patientAppointmentHistoryResponseModel.patientShare!.toString().toText16(isBold: true), AppColors.blackColor, 13,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -1063,10 +1070,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: LocaleKeys.upcomingPaymentNow.tr(context: context).toText12(isBold: true, color: AppColors.greyTextColor)),
|
|
|
|
|
"VAT 15%(${widget.patientAppointmentHistoryResponseModel.patientTaxAmount})"
|
|
|
|
|
.toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -0.64),
|
|
|
|
|
Expanded(child: LocaleKeys.upcomingPaymentNow.tr(context: context).toText12(isBold: true, color: AppColors.greyTextColor)),
|
|
|
|
|
"VAT 15%(${widget.patientAppointmentHistoryResponseModel.patientTaxAmount})".toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -0.64),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 18.h),
|
|
|
|
|
@ -1077,10 +1082,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
widget.patientAppointmentHistoryResponseModel.patientShareWithTax!.toString().toText24(isBold: true),
|
|
|
|
|
AppColors.blackColor,
|
|
|
|
|
17,
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(widget.patientAppointmentHistoryResponseModel.patientShareWithTax!.toString().toText24(isBold: true), AppColors.blackColor, 17,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -1118,8 +1120,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
handleAppointmentNextAction(widget.patientAppointmentHistoryResponseModel.nextAction);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction),
|
|
|
|
|
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction)
|
|
|
|
|
.withValues(alpha: 0.01),
|
|
|
|
|
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withValues(alpha: 0.01),
|
|
|
|
|
textColor: widget.patientAppointmentHistoryResponseModel.nextAction == 15 ? AppColors.textColor : Colors.white,
|
|
|
|
|
fontSize: 16.f,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -1132,7 +1133,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
).paddingSymmetrical(16.h, 24.h),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).toShimmer2(isShow: myAppointmentsViewModel.isAppointmentDetailsLoading),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|