|
|
|
|
@ -573,9 +573,9 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
element.isSelected = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int index = serviceAppointmentScheduleList[scheduleIndex].selectedDateIndex!;
|
|
|
|
|
serviceAppointmentScheduleList[scheduleIndex].customTimeDateSlotList![index].availableSlots![slotIndex].isSelected = true;
|
|
|
|
|
serviceAppointmentScheduleList[scheduleIndex].selectedCustomTimeDateSlotModel!.availableSlots = serviceAppointmentScheduleList[scheduleIndex].customTimeDateSlotList![index].availableSlots!;
|
|
|
|
|
int dateIndex = serviceAppointmentScheduleList[scheduleIndex].selectedDateIndex!;
|
|
|
|
|
serviceAppointmentScheduleList[scheduleIndex].customTimeDateSlotList![dateIndex].availableSlots![slotIndex].isSelected = true;
|
|
|
|
|
serviceAppointmentScheduleList[scheduleIndex].selectedCustomTimeDateSlotModel!.availableSlots = serviceAppointmentScheduleList[scheduleIndex].customTimeDateSlotList![dateIndex].availableSlots!;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -633,7 +633,7 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
}
|
|
|
|
|
branchesCategoriesFilterOptions[index].isSelected = true;
|
|
|
|
|
|
|
|
|
|
await getBranchesBasedOnCategoryFilters(categoryId: branchesCategoriesFilterOptions[index].id);
|
|
|
|
|
await getBranchesBasedOnCategoryFilters(serviceId: branchesCategoriesFilterOptions[index].id);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1023,9 +1023,9 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
if (branchesCategoriesFilterOptions.isNotEmpty) return;
|
|
|
|
|
branchesCategoriesFilterOptions.clear();
|
|
|
|
|
setOnlyState(ViewState.busy);
|
|
|
|
|
Category category = await branchRepo.fetchBranchCategory();
|
|
|
|
|
category.data?.forEach((element) {
|
|
|
|
|
branchesCategoriesFilterOptions.add(FilterListModel(id: element.id ?? 0, isSelected: false, iconUrl: element.serviceCategoryIconUrl ?? "", title: element.categoryName ?? "N/A"));
|
|
|
|
|
Services services = await branchRepo.fetchServicesByCategoryId(serviceCategoryId: -1);
|
|
|
|
|
services.data?.forEach((element) {
|
|
|
|
|
branchesCategoriesFilterOptions.add(FilterListModel(id: element.id ?? 0, isSelected: false, iconUrl: element.serviceIconUrl ?? "", title: element.description ?? ""));
|
|
|
|
|
});
|
|
|
|
|
branchesCategoriesFilterOptions.insert(0, FilterListModel(id: 0, isSelected: true, title: "All Branches"));
|
|
|
|
|
notifyListeners();
|
|
|
|
|
@ -1440,15 +1440,15 @@ class AppointmentsVM extends BaseVM {
|
|
|
|
|
setState(ViewState.idle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getBranchesBasedOnCategoryFilters({required int categoryId}) async {
|
|
|
|
|
Future<void> getBranchesBasedOnCategoryFilters({required int serviceId}) async {
|
|
|
|
|
setState(ViewState.busy);
|
|
|
|
|
if (categoryId == 0) {
|
|
|
|
|
if (serviceId == 0) {
|
|
|
|
|
await getAllNearBranches();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
nearbyBranches.clear();
|
|
|
|
|
nearbyBranches = await branchRepo.getBranchesByFilters(
|
|
|
|
|
categoryIdsList: [categoryId],
|
|
|
|
|
serviceIdsList: [serviceId],
|
|
|
|
|
latitude: AppState().currentLocation.latitude,
|
|
|
|
|
longitude: AppState().currentLocation.longitude,
|
|
|
|
|
);
|
|
|
|
|
|