|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'package:car_provider_app/config/provider_routes.dart';
|
|
|
|
|
import 'package:car_provider_app/views/appoinments/widget/sheets.dart';
|
|
|
|
|
import 'package:car_provider_app/views/dashboard/widget/general_appointment_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:mc_common_app/classes/app_state.dart';
|
|
|
|
|
import 'package:mc_common_app/config/dependency_injection.dart';
|
|
|
|
|
@ -17,7 +18,6 @@ import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import '../dashboard/widget/general_appointment_widget.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
|
|
|
|
|
class UpdateAppointmentPage extends StatelessWidget {
|
|
|
|
|
@ -28,9 +28,7 @@ class UpdateAppointmentPage extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: CustomAppBar(
|
|
|
|
|
title: LocaleKeys.updateAppointment.tr(),
|
|
|
|
|
),
|
|
|
|
|
appBar: CustomAppBar(title: LocaleKeys.updateAppointment.tr()),
|
|
|
|
|
body: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
@ -53,18 +51,20 @@ class UpdateAppointmentPage extends StatelessWidget {
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
21.height,
|
|
|
|
|
ShowFillButton(
|
|
|
|
|
title: ("+ " + LocaleKeys.addNewService.tr()),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
navigateWithName(
|
|
|
|
|
context,
|
|
|
|
|
ProviderAppRoutes.addServiceInAppointment,
|
|
|
|
|
arguments: appointmentListModel,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
if (appointmentListModel.appointmentStatusEnum != AppointmentStatusEnum.confirmed) ...[
|
|
|
|
|
ShowFillButton(
|
|
|
|
|
title: ("+ ${LocaleKeys.addNewService.tr()}"),
|
|
|
|
|
txtColor: MyColors.darkPrimaryColor,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
navigateWithName(
|
|
|
|
|
context,
|
|
|
|
|
ProviderAppRoutes.addServiceInAppointment,
|
|
|
|
|
arguments: appointmentListModel,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -78,14 +78,16 @@ class UpdateAppointmentPage extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(21),
|
|
|
|
|
|
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.confirmed && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus)
|
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.confirmed &&
|
|
|
|
|
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payPartial || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus))
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
showArrivedutton(context, appointmentsVM),
|
|
|
|
|
showArrivedButton(context, appointmentsVM),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(21),
|
|
|
|
|
|
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus)
|
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived &&
|
|
|
|
|
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payPartial || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus))
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
showPayNowButton(context, appointmentsVM),
|
|
|
|
|
@ -99,8 +101,7 @@ class UpdateAppointmentPage extends StatelessWidget {
|
|
|
|
|
LocaleKeys.waitingPaymentfromtheCustomer.tr().toText().paddingAll(21),
|
|
|
|
|
|
|
|
|
|
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived &&
|
|
|
|
|
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.paid ||
|
|
|
|
|
appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payLater))
|
|
|
|
|
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.paid || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payLater))
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
showWorkStartButton(context, appointmentsVM),
|
|
|
|
|
@ -202,7 +203,7 @@ class UpdateAppointmentPage extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget showArrivedutton(BuildContext context, AppointmentsVM appointmentsVM) {
|
|
|
|
|
Widget showArrivedButton(BuildContext context, AppointmentsVM appointmentsVM) {
|
|
|
|
|
return ShowFillButton(
|
|
|
|
|
title: LocaleKeys.arrived.tr(),
|
|
|
|
|
maxWidth: double.infinity,
|
|
|
|
|
|