|
|
|
@ -19,13 +19,6 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
AppointmentDetailView({Key? key, required this.appointmentListModel}) : super(key: key);
|
|
|
|
AppointmentDetailView({Key? key, required this.appointmentListModel}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
final List<String> servicesList = [
|
|
|
|
|
|
|
|
"Mechanic",
|
|
|
|
|
|
|
|
"Electrician",
|
|
|
|
|
|
|
|
" Car Denting",
|
|
|
|
|
|
|
|
"Oil Change",
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget getBaseActionButtonWidget({required Color color, required String text, Color textColor = MyColors.white, required Function() onPressed}) {
|
|
|
|
Widget getBaseActionButtonWidget({required Color color, required String text, Color textColor = MyColors.white, required Function() onPressed}) {
|
|
|
|
return Expanded(
|
|
|
|
return Expanded(
|
|
|
|
child: ShowFillButton(
|
|
|
|
child: ShowFillButton(
|
|
|
|
@ -48,7 +41,12 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: "Cancel"),
|
|
|
|
getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: "Cancel"),
|
|
|
|
12.width,
|
|
|
|
12.width,
|
|
|
|
getBaseActionButtonWidget(color: MyColors.greenColor, onPressed: () {}, text: "Confirm"),
|
|
|
|
getBaseActionButtonWidget(
|
|
|
|
|
|
|
|
color: MyColors.greenColor,
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
text: "Confirm"),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -119,6 +117,7 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
AppointmentsVM appointmentsVM = context.read<AppointmentsVM>();
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: CustomAppBar(
|
|
|
|
appBar: CustomAppBar(
|
|
|
|
title: "Appointment",
|
|
|
|
title: "Appointment",
|
|
|
|
@ -134,16 +133,16 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
appointmentListModel.providerName!.toText(fontSize: 18, isBold: true),
|
|
|
|
appointmentListModel.providerName!.toText(fontSize: 16, isBold: true),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
MyAssets.miniClockDark.buildSvg(
|
|
|
|
MyAssets.miniClockDark.buildSvg(
|
|
|
|
height: 10,
|
|
|
|
height: 12,
|
|
|
|
width: 10,
|
|
|
|
width: 12,
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
10.width,
|
|
|
|
5.width,
|
|
|
|
"${appointmentListModel.duration ?? ""} ${appointmentListModel.appointmentDate!.toFormattedDateWithoutTime()}".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
"${appointmentListModel.duration ?? ""} ${appointmentListModel.appointmentDate!.toFormattedDateWithoutTime()}".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -163,7 +162,7 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
// fit: BoxFit.fill,
|
|
|
|
// fit: BoxFit.fill,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// 10.width,
|
|
|
|
// 10.width,
|
|
|
|
"${index + 1}. ${service.providerServiceDescription}".toText(fontSize: 18, isBold: true),
|
|
|
|
"${index + 1}. ${service.providerServiceDescription}".toText(fontSize: 14, isBold: true),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (service.serviceItems != null && service.serviceItems!.isNotEmpty) ...[
|
|
|
|
if (service.serviceItems != null && service.serviceItems!.isNotEmpty) ...[
|
|
|
|
@ -172,13 +171,25 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
service.serviceItems!.length,
|
|
|
|
service.serviceItems!.length,
|
|
|
|
(index) => "${service.serviceItems![index].name}".toText(
|
|
|
|
(index) => "${service.serviceItems![index].name}".toText(
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
fontSize: 13,
|
|
|
|
fontSize: 12,
|
|
|
|
isBold: true,
|
|
|
|
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).paddingOnly(left: 15),
|
|
|
|
).paddingOnly(left: 15),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
5.height,
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
((service.currentTotalServicePrice).toString()).toText(fontSize: 25, isBold: true),
|
|
|
|
|
|
|
|
2.width,
|
|
|
|
|
|
|
|
"SAR".toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5),
|
|
|
|
|
|
|
|
Icon(
|
|
|
|
|
|
|
|
Icons.arrow_drop_down,
|
|
|
|
|
|
|
|
size: 30,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).onPress(() => appointmentsVM.priceBreakDownClicked(context, service)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
@ -189,14 +200,18 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
CardButtonWithIcon(
|
|
|
|
CardButtonWithIcon(
|
|
|
|
title: "Reschedule Appointment",
|
|
|
|
title: "Reschedule Appointment",
|
|
|
|
onCardTapped: () {},
|
|
|
|
onCardTapped: () {
|
|
|
|
|
|
|
|
context.read<AppointmentsVM>().onRescheduleAppointmentPressed(context: context, appointmentListModel: appointmentListModel);
|
|
|
|
|
|
|
|
},
|
|
|
|
icon: MyAssets.scheduleAppointmentIcon.buildSvg(),
|
|
|
|
icon: MyAssets.scheduleAppointmentIcon.buildSvg(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.booked) ...[
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.booked) ...[
|
|
|
|
10.width,
|
|
|
|
10.width,
|
|
|
|
CardButtonWithIcon(
|
|
|
|
CardButtonWithIcon(
|
|
|
|
title: "Pay for Appointment",
|
|
|
|
title: "Pay for Appointment",
|
|
|
|
onCardTapped: () {},
|
|
|
|
onCardTapped: () {
|
|
|
|
|
|
|
|
context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id);
|
|
|
|
|
|
|
|
},
|
|
|
|
icon: MyAssets.creditCardIcon.buildSvg(),
|
|
|
|
icon: MyAssets.creditCardIcon.buildSvg(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|