|
|
|
@ -5,9 +5,11 @@ import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
|
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
|
|
import 'package:mc_common_app/models/appointments_models/service_schedule_model.dart';
|
|
|
|
import 'package:mc_common_app/models/appointments_models/service_schedule_model.dart';
|
|
|
|
|
|
|
|
import 'package:mc_common_app/models/general_models/widgets_models.dart';
|
|
|
|
import 'package:mc_common_app/models/services_models/service_model.dart';
|
|
|
|
import 'package:mc_common_app/models/services_models/service_model.dart';
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
import 'package:mc_common_app/utils/enums.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/view_models/appointments_view_model.dart';
|
|
|
|
import 'package:mc_common_app/views/appointments/widgets/custom_calender_widget.dart';
|
|
|
|
import 'package:mc_common_app/views/appointments/widgets/custom_calender_widget.dart';
|
|
|
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
|
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
|
|
@ -53,6 +55,7 @@ class BookAppointmentSchedulesView extends StatelessWidget {
|
|
|
|
return ExpansionTile(
|
|
|
|
return ExpansionTile(
|
|
|
|
tilePadding: const EdgeInsets.symmetric(horizontal: 21, vertical: 10),
|
|
|
|
tilePadding: const EdgeInsets.symmetric(horizontal: 21, vertical: 10),
|
|
|
|
childrenPadding: const EdgeInsets.only(left: 16, bottom: 10, right: 16),
|
|
|
|
childrenPadding: const EdgeInsets.only(left: 16, bottom: 10, right: 16),
|
|
|
|
|
|
|
|
initiallyExpanded: true,
|
|
|
|
title: Column(
|
|
|
|
title: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
@ -120,6 +123,7 @@ class BookAppointmentSchedulesView extends StatelessWidget {
|
|
|
|
.customTimeDateSlotList![appointmentsVM.serviceAppointmentScheduleList[scheduleIndex].selectedDateIndex!].availableSlots ??
|
|
|
|
.customTimeDateSlotList![appointmentsVM.serviceAppointmentScheduleList[scheduleIndex].selectedDateIndex!].availableSlots ??
|
|
|
|
[],
|
|
|
|
[],
|
|
|
|
onPressed: (slotIndex) {
|
|
|
|
onPressed: (slotIndex) {
|
|
|
|
|
|
|
|
log("slotIndex: $slotIndex");
|
|
|
|
appointmentsVM.updateSelectedAppointmentSlotByDate(scheduleIndex: scheduleIndex, slotIndex: slotIndex);
|
|
|
|
appointmentsVM.updateSelectedAppointmentSlotByDate(scheduleIndex: scheduleIndex, slotIndex: slotIndex);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -151,10 +155,26 @@ class BookAppointmentSchedulesView extends StatelessWidget {
|
|
|
|
if (screenArgumentsForAppointmentDetailPage.routeFlag == 1) {
|
|
|
|
if (screenArgumentsForAppointmentDetailPage.routeFlag == 1) {
|
|
|
|
appointmentsVM.onReviewButtonPressed(context);
|
|
|
|
appointmentsVM.onReviewButtonPressed(context);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
int selectedSlotId = 0;
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
List<TimeSlotModel> timeSlots = appointmentsVM.serviceAppointmentScheduleList.first.selectedCustomTimeDateSlotModel!.availableSlots ?? [];
|
|
|
|
|
|
|
|
if (timeSlots.isNotEmpty) {
|
|
|
|
|
|
|
|
index = timeSlots.indexWhere((element) => element.isSelected);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (index != -1) {
|
|
|
|
|
|
|
|
selectedSlotId = timeSlots[index].slotId;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Utils.showToast("Please select correct date and time.");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log("selectedSlotId: $selectedSlotId");
|
|
|
|
|
|
|
|
|
|
|
|
appointmentsVM.onRescheduleAppointmentConfirmPressed(
|
|
|
|
appointmentsVM.onRescheduleAppointmentConfirmPressed(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
appointmentId: screenArgumentsForAppointmentDetailPage.appointmentId,
|
|
|
|
appointmentId: screenArgumentsForAppointmentDetailPage.appointmentId,
|
|
|
|
selectedSlotId: appointmentsVM.serviceAppointmentScheduleList.first.selectedCustomTimeDateSlotModel!.date!.slotId,
|
|
|
|
selectedSlotId: selectedSlotId,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|