diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 7b4cfb3..5a4f114 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -753,8 +753,9 @@ "done": "تم", "notice": "إشعار", "serviceDeactivated": "تم تعطيل الخدمة", - "totalNumberOfServices": "إجمالي عدد الخدمات:", + "totalNumberOfServices": "عدد الخدمات:", "noAvailableOfficesInCity": "لا توجد مكاتب متاحة في مدينتك لخدمتك.", - "searchByItem": "البحث حسب العنصر" - + "searchByItem": "البحث حسب العنصر", + "selectBranchToCopyServices": "حدد الفرع لنسخ العناصر الخاصة بهم إلى هذا الفرع. يمكنك تعديل الاختيار في أي وقت.", + "tapToSelect": "Tap to select" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 2548f81..731a962 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -751,7 +751,9 @@ "done": "Done", "notice": "Notice", "serviceDeactivated": "Service Deactivated", - "totalNumberOfServices": "Total number of services:", + "totalNumberOfServices": "Number of services:", "noAvailableOfficesInCity": "There are no available offices in your city for your service.", - "searchByItem": "Search By Item" + "searchByItem": "Search By Item", + "selectBranchToCopyServices": "Select the branch to copy their items to this branch. You can modify the selection at any time.", + "tapToSelect": "Tap to select" } \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index e86e38d..73ef7d0 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -769,10 +769,11 @@ class CodegenLoader extends AssetLoader{ "done": "تم", "notice": "إشعار", "serviceDeactivated": "تم تعطيل الخدمة", - "totalNumberOfServices": "إجمالي عدد الخدمات:", - "noAvailableOfficesInCity": "لا توجد مكاتب متاحة في مدينتك لخدمتك." - "you": "أنتم", - "searchByItem": "البحث حسب العنصر" + "totalNumberOfServices": "عدد الخدمات:", + "noAvailableOfficesInCity": "لا توجد مكاتب متاحة في مدينتك لخدمتك.", + "searchByItem": "البحث حسب العنصر", + "selectBranchToCopyServices": "حدد الفرع لنسخ العناصر الخاصة بهم إلى هذا الفرع. يمكنك تعديل الاختيار في أي وقت.", + "tapToSelect": "Tap to select" }; static const Map en_US = { "firstTimeLogIn": "First Time Log In", @@ -1527,10 +1528,11 @@ static const Map en_US = { "done": "Done", "notice": "Notice", "serviceDeactivated": "Service Deactivated", - "totalNumberOfServices": "Total number of services:", - "noAvailableOfficesInCity": "There are no available offices in your city for your service." - "you": "You", - "searchByItem": "Search By Item" + "totalNumberOfServices": "Number of services:", + "noAvailableOfficesInCity": "There are no available offices in your city for your service.", + "searchByItem": "Search By Item", + "selectBranchToCopyServices": "Select the branch to copy their items to this branch. You can modify the selection at any time.", + "tapToSelect": "Tap to select" }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index b668b9e..1d161b3 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -735,5 +735,7 @@ abstract class LocaleKeys { static const totalNumberOfServices = 'totalNumberOfServices'; static const noAvailableOfficesInCity = 'noAvailableOfficesInCity'; static const searchByItem = 'searchByItem'; + static const selectBranchToCopyServices = 'selectBranchToCopyServices'; + static const tapToSelect = 'tapToSelect'; } diff --git a/lib/models/general_models/widgets_models.dart b/lib/models/general_models/widgets_models.dart index d4271c9..ae5e061 100644 --- a/lib/models/general_models/widgets_models.dart +++ b/lib/models/general_models/widgets_models.dart @@ -1,9 +1,10 @@ class FilterListModel { String title; + String iconUrl; int id; bool isSelected; - FilterListModel({required this.id, required this.isSelected, required this.title}); + FilterListModel({required this.id, required this.isSelected, this.iconUrl = "", required this.title}); } class SelectionModel { diff --git a/lib/view_models/appointments_view_model.dart b/lib/view_models/appointments_view_model.dart index 010a5cd..891e253 100644 --- a/lib/view_models/appointments_view_model.dart +++ b/lib/view_models/appointments_view_model.dart @@ -259,7 +259,7 @@ class AppointmentsVM extends BaseVM { notifyListeners(); } - List branchesFilterOptions = []; + List branchesCategoriesFilterOptions = []; List servicesInCurrentAppointment = []; ServiceModel? currentServiceSelection; @@ -478,6 +478,7 @@ class AppointmentsVM extends BaseVM { (element.appointmentStatusEnum == AppointmentStatusEnum.confirmed || element.appointmentStatusEnum == AppointmentStatusEnum.booked) && (DateHelper.parseStringToDate(element.appointmentDate!).isAfter(DateTime.now()))) .toList(); + notifyListeners(); applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments, isNeedCustomerFilter: true); setState(ViewState.idle); } @@ -626,13 +627,13 @@ class AppointmentsVM extends BaseVM { } Future applyFilterOnBranches({required int index}) async { - if (branchesFilterOptions.isEmpty) return; - for (var value in branchesFilterOptions) { + if (branchesCategoriesFilterOptions.isEmpty) return; + for (var value in branchesCategoriesFilterOptions) { value.isSelected = false; } - branchesFilterOptions[index].isSelected = true; + branchesCategoriesFilterOptions[index].isSelected = true; - await getBranchesBasedOnCategoryFilters(categoryId: branchesFilterOptions[index].id); + await getBranchesBasedOnCategoryFilters(categoryId: branchesCategoriesFilterOptions[index].id); notifyListeners(); } @@ -1019,14 +1020,14 @@ class AppointmentsVM extends BaseVM { List branchServices = []; Future populateBranchesFilterList() async { - if (branchesFilterOptions.isNotEmpty) return; - branchesFilterOptions.clear(); + if (branchesCategoriesFilterOptions.isNotEmpty) return; + branchesCategoriesFilterOptions.clear(); setOnlyState(ViewState.busy); Category category = await branchRepo.fetchBranchCategory(); category.data?.forEach((element) { - branchesFilterOptions.add(FilterListModel(id: element.id ?? 0, isSelected: false, title: element.categoryName ?? "N/A")); + branchesCategoriesFilterOptions.add(FilterListModel(id: element.id ?? 0, isSelected: false, iconUrl: element.serviceCategoryIconUrl ?? "", title: element.categoryName ?? "N/A")); }); - branchesFilterOptions.insert(0, FilterListModel(id: 0, isSelected: true, title: "All Branches")); + branchesCategoriesFilterOptions.insert(0, FilterListModel(id: 0, isSelected: true, title: "All Branches")); notifyListeners(); setState(ViewState.idle); } @@ -1036,7 +1037,7 @@ class AppointmentsVM extends BaseVM { if (isNeedToRebuild) setState(ViewState.busy); if (isFromRefresh) { - var selectedFilter = branchesFilterOptions.firstWhere((element) => element.isSelected); + var selectedFilter = branchesCategoriesFilterOptions.firstWhere((element) => element.isSelected); log("selectedFilter: ${selectedFilter.id}"); if (selectedFilter.id == 0) { diff --git a/lib/views/advertisement/components/ads_list_widget.dart b/lib/views/advertisement/components/ads_list_widget.dart index 094baae..919937c 100644 --- a/lib/views/advertisement/components/ads_list_widget.dart +++ b/lib/views/advertisement/components/ads_list_widget.dart @@ -21,12 +21,14 @@ class AdsListWidget extends StatelessWidget { final ScrollPhysics? scrollPhysics; final bool isAdsFragment; final bool shouldShowAdStatus; + final Function() onFetchMoreAds; const AdsListWidget({ super.key, required this.adsList, - this.scrollPhysics, required this.shouldShowAdStatus, + required this.onFetchMoreAds, + this.scrollPhysics, this.isAdsFragment = false, }); diff --git a/lib/views/appointments/widgets/common_appointment_slider_widget.dart b/lib/views/appointments/widgets/common_appointment_slider_widget.dart index ce7cb80..fc08420 100644 --- a/lib/views/appointments/widgets/common_appointment_slider_widget.dart +++ b/lib/views/appointments/widgets/common_appointment_slider_widget.dart @@ -26,7 +26,7 @@ import 'package:sizer/sizer.dart'; class CommonAppointmentSliderWidget extends StatelessWidget { final Function(AppointmentListModel)? onAppointmentClick; - const CommonAppointmentSliderWidget({Key? key, this.onAppointmentClick}) : super(key: key); + const CommonAppointmentSliderWidget({super.key, this.onAppointmentClick}); Widget getCarouselSliderWidget(AppType appType, AppointmentsVM appointmentsVM) { return CarouselSlider.builder( @@ -95,7 +95,7 @@ class AppointmentHomeTileWidget extends StatelessWidget { final AppointmentListModel? appointmentListModel; final Function()? onTapped; - const AppointmentHomeTileWidget({Key? key, this.isForProvider = false, this.onTapped, required this.appointmentListModel, this.isForCustomerHome = false}) : super(key: key); + const AppointmentHomeTileWidget({super.key, this.isForProvider = false, this.onTapped, required this.appointmentListModel, this.isForCustomerHome = false}); Widget showServices(String title, String icon, {bool isMoreText = false}) { return Row( @@ -227,7 +227,7 @@ class AppointmentFragmentTileWidget extends StatelessWidget { final AppointmentListModel? appointmentListModel; final Function()? onTapped; - const AppointmentFragmentTileWidget({Key? key, this.onTapped, required this.appointmentListModel}) : super(key: key); + const AppointmentFragmentTileWidget({super.key, this.onTapped, required this.appointmentListModel}); Widget showServices(String title, String icon, {bool isMoreText = false}) { return Row( diff --git a/lib/views/common_fragments/ads_fragment.dart b/lib/views/common_fragments/ads_fragment.dart index 547ff96..024b677 100644 --- a/lib/views/common_fragments/ads_fragment.dart +++ b/lib/views/common_fragments/ads_fragment.dart @@ -135,7 +135,12 @@ class AdsFragment extends StatelessWidget { }, child: adVM.state == ViewState.busy ? const Center(child: CircularProgressIndicator()) - : AdsListWidget(isAdsFragment: true, shouldShowAdStatus: !adVM.isExploreAdsTapped, adsList: getAdsList(adVM)), + : AdsListWidget( + isAdsFragment: true, + shouldShowAdStatus: !adVM.isExploreAdsTapped, + adsList: getAdsList(adVM), + onFetchMoreAds: () {}, + ), ), ) ], diff --git a/lib/widgets/dropdown/dropdown_text.dart b/lib/widgets/dropdown/dropdown_text.dart index 079ee26..056d2b3 100644 --- a/lib/widgets/dropdown/dropdown_text.dart +++ b/lib/widgets/dropdown/dropdown_text.dart @@ -1,14 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; class DropDownText extends StatelessWidget { - String title; + final String title; + final bool showDropDownIcon; - DropDownText(this.title, {super.key}); + DropDownText({required this.title, required this.showDropDownIcon, super.key}); @override Widget build(BuildContext context) { @@ -20,7 +19,8 @@ class DropDownText extends StatelessWidget { fontSize: 16, letterSpacing: -0.64, ), - const Icon(Icons.keyboard_arrow_down_outlined), + if (showDropDownIcon) + const Icon(Icons.keyboard_arrow_down_outlined), ], ).toContainer( isEnabledBorder: true,