|
|
|
@ -8,6 +8,7 @@ import 'package:mc_common_app/models/services_models/service_model.dart';
|
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/dialogs_and_bottomsheets.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/enums.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/utils.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/appointments_view_model.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
|
|
|
@ -15,6 +16,7 @@ import 'package:mc_common_app/widgets/common_widgets/card_button_with_icon.dart'
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:sizer/sizer.dart';
|
|
|
|
|
|
|
|
|
|
class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
final AppointmentListModel appointmentListModel;
|
|
|
|
@ -43,15 +45,9 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
case AppointmentPaymentStatusEnum.payPartial:
|
|
|
|
|
return Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
getBaseActionButtonWidget(
|
|
|
|
|
color: MyColors.grey98Color.withOpacity(0.1),
|
|
|
|
|
textColor: MyColors.lightTextColor,
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
text: LocaleKeys.workInProgress.tr(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 8.h,
|
|
|
|
|
child: Utils.buildStatusContainer(LocaleKeys.workInProgress.tr()),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
case AppointmentPaymentStatusEnum.payNow:
|
|
|
|
@ -85,7 +81,7 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: "Cancel"),
|
|
|
|
|
getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: LocaleKeys.cancel.tr()),
|
|
|
|
|
12.width,
|
|
|
|
|
getBaseActionButtonWidget(
|
|
|
|
|
color: MyColors.greenColor,
|
|
|
|
@ -108,15 +104,9 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
case AppointmentStatusEnum.visitCompleted:
|
|
|
|
|
return Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
getBaseActionButtonWidget(
|
|
|
|
|
color: MyColors.grey98Color.withOpacity(0.3),
|
|
|
|
|
textColor: MyColors.lightTextColor,
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
text: LocaleKeys.visitCompleted.tr(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 8.h,
|
|
|
|
|
child: Utils.buildStatusContainer(LocaleKeys.visitCompleted.tr()),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -126,20 +116,19 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
case AppointmentStatusEnum.cancelled:
|
|
|
|
|
return Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
getBaseActionButtonWidget(color: MyColors.grey98Color.withOpacity(0.3), textColor: MyColors.lightTextColor, onPressed: () {}, text: "Cancelled"),
|
|
|
|
|
],
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 8.h,
|
|
|
|
|
child: Utils.buildStatusContainer(LocaleKeys.appointmentCancelled.tr()),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
case AppointmentStatusEnum.allAppointments:
|
|
|
|
|
return SizedBox();
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
case AppointmentStatusEnum.rescheduled:
|
|
|
|
|
return Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: "Cancel"),
|
|
|
|
|
getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: LocaleKeys.cancel.tr()),
|
|
|
|
|
12.width,
|
|
|
|
|
getBaseActionButtonWidget(
|
|
|
|
|
color: MyColors.greenColor,
|
|
|
|
@ -151,7 +140,7 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
default:
|
|
|
|
|
return SizedBox();
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -224,44 +213,40 @@ class AppointmentDetailView extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
children: List.generate(appointmentListModel.appointmentServicesList!.length, (index) {
|
|
|
|
|
ServiceModel service = appointmentListModel.appointmentServicesList![index];
|
|
|
|
|
return Column(
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// MyAssets.maintenanceIcon.buildSvg(
|
|
|
|
|
// height: 10,
|
|
|
|
|
// width: 10,
|
|
|
|
|
// fit: BoxFit.fill,
|
|
|
|
|
// ),
|
|
|
|
|
// 10.width,
|
|
|
|
|
"${index + 1}. ${service.providerServiceDescription}".toText(fontSize: 14, isBold: true),
|
|
|
|
|
if (service.serviceItems != null && service.serviceItems!.isNotEmpty) ...[
|
|
|
|
|
Column(
|
|
|
|
|
children: List.generate(
|
|
|
|
|
service.serviceItems!.length,
|
|
|
|
|
(index) => "${service.serviceItems![index].name}".toText(
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(left: 15),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (service.serviceItems != null && service.serviceItems!.isNotEmpty) ...[
|
|
|
|
|
Column(
|
|
|
|
|
children: List.generate(
|
|
|
|
|
service.serviceItems!.length,
|
|
|
|
|
(index) => "${service.serviceItems![index].name}".toText(
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(left: 15),
|
|
|
|
|
],
|
|
|
|
|
5.height,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
((service.currentTotalServicePrice).toString()).toText(fontSize: 25, isBold: true),
|
|
|
|
|
((service.currentTotalServicePrice).toString()).toText(fontSize: 19, isBold: true),
|
|
|
|
|
2.width,
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5),
|
|
|
|
|
const Icon(Icons.arrow_drop_down, size: 30)
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 12, isBold: true).paddingOnly(bottom: 5),
|
|
|
|
|
const Icon(Icons.arrow_drop_down, size: 25)
|
|
|
|
|
],
|
|
|
|
|
).onPress(() => appointmentsVM.priceBreakDownClicked(context, service)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
).paddingOnly(bottom: 15);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|