diff --git a/lib/config/provider_routes.dart b/lib/config/provider_routes.dart index c9e0dd2..af2ab80 100644 --- a/lib/config/provider_routes.dart +++ b/lib/config/provider_routes.dart @@ -23,6 +23,7 @@ import 'package:flutter/material.dart'; import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart'; import 'package:mc_common_app/models/provider_branches_models/branch_detail_model.dart'; import 'package:mc_common_app/utils/enums.dart'; +import 'package:mc_common_app/views/appointments/appointments_filter_view.dart'; import 'package:mc_common_app/views/setting_options/provider_accepted_requests_view.dart'; class ProviderAppRoutes { @@ -42,6 +43,7 @@ class ProviderAppRoutes { AppRoutes.updateAppointmentPage: (context) => const UpdateAppointmentPage(), AppRoutes.addServiceInAppointment: (context) => AddNewServiceAppointmentPage(ModalRoute.of(context)!.settings.arguments as AppointmentListModel), AppRoutes.mergeAppointments: (context) => const MergeAppointmentListPage(), + AppRoutes.appoinmentSearchFilterPage: (context) => const AppointmentsFilterView(), //Subscriptions AppRoutes.mySubscriptionsPage: (context) => const MySubscriptionsPage(), diff --git a/lib/main.dart b/lib/main.dart index 0f5c4ec..b686918 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -169,7 +169,6 @@ class MyApp extends StatelessWidget { DeviceOrientation.portraitDown, ]); return Sizer( - return ResponsiveSizer( builder: (context, orientation, deviceType) { injector.get().setAppType(AppType.provider); AppState().setPostParamsModel( diff --git a/lib/views/appoinments/add_new_service_appointment_page.dart b/lib/views/appoinments/add_new_service_appointment_page.dart index 2c44a04..f542c5d 100644 --- a/lib/views/appoinments/add_new_service_appointment_page.dart +++ b/lib/views/appoinments/add_new_service_appointment_page.dart @@ -269,11 +269,6 @@ class _AddNewServiceAppointmentPageState extends State _updateAppointment(BuildContext context, int branchId) async { - await context.read().getMyAppointmentsForProvider( - { - "ServiceProviderID": injector.get().getUser.data?.userInfo?.providerId.toString() ?? "0", - "ProviderBranchID": branchId.toString(), - }, - ); + await context.read().getMyAppointmentsForProvider(branchID: branchId); } } diff --git a/lib/views/appoinments/appointment_page.dart b/lib/views/appoinments/appointment_page.dart index 6e120f9..b3c005e 100644 --- a/lib/views/appoinments/appointment_page.dart +++ b/lib/views/appoinments/appointment_page.dart @@ -26,45 +26,37 @@ import 'package:provider/provider.dart'; import 'package:easy_localization/easy_localization.dart'; class AppointmentPage extends StatefulWidget { - BranchDetailModel branch; + final BranchDetailModel branch; - AppointmentPage({ - required this.branch, - Key? key, - }) : super(key: key); + const AppointmentPage({required this.branch, super.key}); @override State createState() => _AppointmentPageState(); } class _AppointmentPageState extends State { - String date = ""; + late AppointmentsVM appointmentsVM; GlobalKey refreshIndicatorKey = GlobalKey(); Future _pullRefresh(BuildContext context) async { - await context.read().getAppointmentSlotsInfo( - context: context, - map: {"ProviderBranchID": widget.branch.id.toString(), "FromDate": date, "ToDate": date}, - isNeedToRebuild: true, - ); - await context.read().getMyAppointmentsForProvider({ - "ServiceProviderID": injector.get().getUser.data?.userInfo?.providerId.toString() ?? "0", - "ProviderBranchID": widget.branch.id.toString(), - "FromDate": date, - "DateTo": date, - }); + await appointmentsVM.getAppointmentSlotsInfo( + context: context, + branchID: widget.branch.id!, + isNeedToRebuild: true, + ); + await appointmentsVM.getAppointmentsBasedOnFiltersForProviders(branchID: widget.branch.id!); } @override void initState() { - // TODO: implement initState super.initState(); + appointmentsVM = context.read(); + appointmentsVM.selectedBranchIdForAppointments = widget.branch.id!; scheduleMicrotask(() { - date = DateHelper.formatAsYearMonthDay(DateTime.now()); - context.read().populateAppointmentsFilterList(); + appointmentsVM.selectedDateForAppointments = DateHelper.formatAsYearMonthDay(DateTime.now()); + appointmentsVM.populateAppointmentsFilterList(); _pullRefresh(context); - context.read().selectedBranch = widget.branch.id ?? 0; }); } @@ -74,6 +66,23 @@ class _AppointmentPageState extends State { appBar: CustomAppBar( //profileImageUrl: MyAssets.carBanner, title: widget.branch.branchName, + actions: [ + Consumer(builder: (BuildContext context, AppointmentsVM appointmentsVM, Widget? child) { + return Padding( + padding: EdgeInsets.only(top: appointmentsVM.appointmentFiltersCounter > 0 ? 20 : 0, right: 21), + child: Badge( + isLabelVisible: appointmentsVM.appointmentFiltersCounter > 0, + largeSize: 15, + smallSize: 20, + backgroundColor: MyColors.darkPrimaryColor, + label: Text('${appointmentsVM.appointmentFiltersCounter}'), + child: MyAssets.searchIcon.buildSvg(), + ), + ).onPress(() { + navigateWithName(context, AppRoutes.appoinmentSearchFilterPage); + }); + }), + ], ), body: SizedBox( width: double.infinity, @@ -113,7 +122,7 @@ class _AppointmentPageState extends State { appointmentListModel: appointmentsVM.myFilteredAppointments2[index], isNeedTotalPayment: false, onTap: () { - context.read().selectedAppointmentIndex = index; + appointmentsVM.selectedAppointmentIndex = index; navigateWithName( context, AppRoutes.appointmentDetailList, @@ -124,9 +133,7 @@ class _AppointmentPageState extends State { }, ); }, - separatorBuilder: (context, snapchat) { - return 21.height; - }, + separatorBuilder: (context, snapchat) => 21.height, itemCount: appointmentsVM.myFilteredAppointments2.length, physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, @@ -160,7 +167,7 @@ class _AppointmentPageState extends State { ), Row( children: [ - date.toText( + appointmentsVM.selectedDateForAppointments.toText( fontWeight: FontWeight.bold, ), const Icon( @@ -178,12 +185,12 @@ class _AppointmentPageState extends State { ), ) .onPress(() async { - date = await Utils.pickDateFromDatePicker( + String date = await Utils.pickDateFromDatePicker( context, firstDate: null, ); + appointmentsVM.selectedDateForAppointments = date; _pullRefresh(context); - // context.read().notifyListeners(); }), ], ), diff --git a/lib/views/appoinments/merge_appointment_page.dart b/lib/views/appoinments/merge_appointment_page.dart index 42e5bfe..91479f0 100644 --- a/lib/views/appoinments/merge_appointment_page.dart +++ b/lib/views/appoinments/merge_appointment_page.dart @@ -111,9 +111,6 @@ class MergeAppointmentListPage extends StatelessWidget { } Future _updateAppointment(BuildContext context, int branchId) async { - await context.read().getMyAppointmentsForProvider({ - "ServiceProviderID": injector.get().getUser.data?.userInfo?.providerId.toString() ?? "0", - "ProviderBranchID": branchId.toString(), - }); + await context.read().getMyAppointmentsForProvider(branchID: branchId); } } diff --git a/lib/views/appoinments/update_appointment_page.dart b/lib/views/appoinments/update_appointment_page.dart index 8fa99d9..db2c2a0 100644 --- a/lib/views/appoinments/update_appointment_page.dart +++ b/lib/views/appoinments/update_appointment_page.dart @@ -313,9 +313,6 @@ class _UpdateAppointmentPageState extends State { } Future _updateAppointment(BuildContext context, int branchId) async { - await context.read().getMyAppointmentsForProvider({ - "ServiceProviderID": injector.get().getUser.data?.userInfo?.providerId.toString() ?? "0", - "ProviderBranchID": branchId.toString(), - }); + await context.read().getMyAppointmentsForProvider(branchID: branchId); } } diff --git a/lib/views/branch_management/branch/branch_list_page.dart b/lib/views/branch_management/branch/branch_list_page.dart index 67c7725..61a4cac 100644 --- a/lib/views/branch_management/branch/branch_list_page.dart +++ b/lib/views/branch_management/branch/branch_list_page.dart @@ -23,7 +23,7 @@ import 'package:mc_common_app/widgets/tab/role_type_tab.dart'; import 'package:provider/provider.dart'; class BranchListPage extends StatelessWidget { - const BranchListPage({Key? key}) : super(key: key); + const BranchListPage({super.key}); void deleteBranchBottomSheet(BuildContext context, int branchID) { return actionConfirmationBottomSheet( diff --git a/lib/views/branch_management/services/create_services_page3.dart b/lib/views/branch_management/services/create_services_page3.dart index 7b0a796..6938ba6 100644 --- a/lib/views/branch_management/services/create_services_page3.dart +++ b/lib/views/branch_management/services/create_services_page3.dart @@ -134,8 +134,11 @@ class _CreateServicesPage3State extends State { value: isServiceActive, onChanged: (value) async { if (isEditDisabled) return; + bool status = await updateServiceStatus(context, value); - isServiceActive = await updateServiceStatus(context, value); + if (status) { + isServiceActive = value; + } setState(() {}); }, ), @@ -385,12 +388,11 @@ class _CreateServicesPage3State extends State { if (list.isEmpty) { bool status = await serviceVM.updateServiceStatus( context: context, - serviceStatusEnum: ServiceStatusEnum.deactivated, + serviceStatusEnum: value ? ServiceStatusEnum.approvedOrActive : ServiceStatusEnum.deactivated, branchId: int.parse(widget.branchModel!.branchId), providerServiceIds: providerServiceIds, ); - - return !status; + return status; } else { serviceVM.buildDealNotCompletedBottomSheetOptions( mainContext: context, @@ -402,7 +404,7 @@ class _CreateServicesPage3State extends State { } catch (e) { Utils.hideLoading(context); log(e.toString()); - Utils.showToast(e.toString() ?? ""); + Utils.showToast(e.toString()); return value; } } diff --git a/lib/views/branch_management/services/duplication/matched_services_page.dart b/lib/views/branch_management/services/duplication/matched_services_page.dart index 407a0a3..5f9ac38 100644 --- a/lib/views/branch_management/services/duplication/matched_services_page.dart +++ b/lib/views/branch_management/services/duplication/matched_services_page.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:developer'; import 'package:car_provider_app/views/branch_management/services/duplication/sheet/approved_branches_list_sheet.dart'; @@ -38,6 +39,8 @@ class _MatchedServicesPageState extends State { super.initState(); serviceVM = Provider.of(context, listen: false); getMatchedServices(); + serviceVM.isAllSelected = false; + setState(() {}); } getMatchedServices() { @@ -60,40 +63,44 @@ class _MatchedServicesPageState extends State { child: Column( children: [ 12.height, - DropDownText( - title: widget.matchServicesArguments!.oldBranchName, - showDropDownIcon: false, - ), - 12.height, - GestureDetector( - onTap: () { - bool newValue = !context.read().isAllSelected; - serviceVM.selectAllServices(newValue); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SizedBox( - height: 30, - width: 30, - child: Checkbox( - value: context.watch().isAllSelected, - onChanged: (v) { - serviceVM.selectAllServices(v ?? false); - }, - ), - ), - LocaleKeys.selectAll.tr().toText(fontSize: 14), - ], - ), - ), + DropDownText(title: widget.matchServicesArguments!.oldBranchName, showDropDownIcon: false), + // 12.height, + // Consumer( + // builder: (BuildContext context, ServiceVM serviceVM, Widget? child) { + // if (serviceVM.matchedServices == null || serviceVM.matchedServices!.isEmpty) { + // return const SizedBox(); + // } + // return GestureDetector( + // onTap: () { + // bool newValue = !context.read().isAllSelected; + // serviceVM.selectAllServices(newValue); + // }, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // SizedBox( + // height: 30, + // width: 30, + // child: Checkbox( + // value: context.watch().isAllSelected, + // onChanged: (v) { + // serviceVM.selectAllServices(v ?? false); + // }, + // ), + // ), + // LocaleKeys.selectAll.tr().toText(fontSize: 14), + // ], + // ), + // ); + // }, + // ), 12.height, Expanded( child: Consumer(builder: (context, ServiceVM serviceVM, _) { if (serviceVM.matchedServices == null) { return const Center(child: CircularProgressIndicator()); } else if (serviceVM.matchedServices!.isEmpty) { - return EmptyWidget(text: LocaleKeys.noServicesAvailable.tr(), isWrappedColumn: false); + return EmptyWidget(text: LocaleKeys.noServicesAvailableToCopy.tr(), isWrappedColumn: false); } return ListView.separated( itemBuilder: (context, index) { @@ -101,17 +108,35 @@ class _MatchedServicesPageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Checkbox( - value: serviceVM.matchedServices![index].isExpandedOrSelected, - onChanged: (v) { - if (serviceVM.matchedServices![index].serviceItems!.isEmpty) { - Utils.showToast(LocaleKeys.noAvailableItems.tr()); - } else { - serviceVM.matchedServices![index].isExpandedOrSelected = v ?? false; - serviceVM.updateServiceItem(index, serviceVM.matchedServices![index].isExpandedOrSelected); - } - }, - ), + Builder(builder: (context) { + int lengthSelected = serviceVM.matchedServices![index].serviceItems!.where((c) => c.isUpdateOrSelected == true).length; + int totalLength = serviceVM.matchedServices![index].serviceItems!.length; + if (lengthSelected == 0 || lengthSelected < totalLength) { + serviceVM.matchedServices![index].isExpandedOrSelected = false; + serviceVM.isAllSelected = false; + } + + return Checkbox( + value: lengthSelected == totalLength ? true : serviceVM.matchedServices![index].isExpandedOrSelected, + onChanged: (v) { + if (serviceVM.matchedServices![index].serviceItems!.isEmpty) { + Utils.showToast(LocaleKeys.noAvailableItems.tr()); + } else { + serviceVM.matchedServices![index].isExpandedOrSelected = v ?? false; + serviceVM.updateServiceItem(index, serviceVM.matchedServices![index].isExpandedOrSelected); + bool isAllChecked = true; + for (var service in serviceVM.matchedServices!) { + if (service.isExpandedOrSelected == false) { + isAllChecked = false; + break; + } + } + serviceVM.isAllSelected = isAllChecked; + setState(() {}); + } + }, + ); + }), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -120,7 +145,7 @@ class _MatchedServicesPageState extends State { serviceVM.matchedServices![index].serviceDescription.toString().toText(fontSize: 16, isBold: true), "${serviceVM.matchedServices![index].serviceItems!.where((c) => c.isUpdateOrSelected == true).length} items selected out of ${serviceVM.matchedServices![index].serviceItems!.length}" .toText(color: MyColors.lightTextColor), - LocaleKeys.tapToSeeItems.toText(color: MyColors.lightTextColor), + LocaleKeys.tapToSeeItems.tr().toText(color: MyColors.lightTextColor), ], ), ), @@ -129,6 +154,7 @@ class _MatchedServicesPageState extends State { () { showMyBottomSheet( context, + isDismissible: false, child: ItemsSelectionSheet( serviceVM.matchedServices![index].serviceItems ?? [], onItemCopied: (List selected) { diff --git a/lib/views/branch_management/services/duplication/sheet/items_selection_sheet.dart b/lib/views/branch_management/services/duplication/sheet/items_selection_sheet.dart index 0c6c8ee..b634e38 100644 --- a/lib/views/branch_management/services/duplication/sheet/items_selection_sheet.dart +++ b/lib/views/branch_management/services/duplication/sheet/items_selection_sheet.dart @@ -3,7 +3,6 @@ import 'package:mc_common_app/extensions/int_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/models/services_models/item_model.dart'; -import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/checkbox_with_title_desc.dart'; @@ -30,8 +29,20 @@ class _ItemsSelectionSheetState extends State { @override void initState() { super.initState(); - tempItems = widget.serviceItems.map((item) => ItemData.fromJson(item.toJson())).toList(); + tempItems = List.from(widget.serviceItems); + + setState(() {}); filteredItems = List.from(tempItems!); // Initially show all items + + bool isAllChecked = true; + for (var item in filteredItems!) { + if (item.isUpdateOrSelected == false) { + isAllChecked = false; + break; + } + } + + isAllItemsSelected = isAllChecked; } // Method to filter items based on search query @@ -56,6 +67,15 @@ class _ItemsSelectionSheetState extends State { updateTempItem(int index, bool value) { filteredItems![index].isUpdateOrSelected = value; + bool isAllChecked = true; + for (var item in filteredItems!) { + if (item.isUpdateOrSelected == false) { + isAllChecked = false; + break; + } + } + + isAllItemsSelected = isAllChecked; setState(() {}); } @@ -78,29 +98,23 @@ class _ItemsSelectionSheetState extends State { }, ), 6.height, - GestureDetector( - onTap: () { - isAllItemsSelected = false; - selectAllTempItems(false); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SizedBox( - height: 30, - width: 30, - child: Checkbox( - value: isAllItemsSelected, - onChanged: (v) { - if (v == null) return; - isAllItemsSelected = v; - selectAllTempItems(v); - }, - ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox( + height: 30, + width: 30, + child: Checkbox( + value: isAllItemsSelected, + onChanged: (v) { + if (v == null) return; + isAllItemsSelected = v; + selectAllTempItems(v); + }, ), - LocaleKeys.selectAll.tr().toText(fontSize: 14), - ], - ), + ), + LocaleKeys.selectAll.tr().toText(fontSize: 14), + ], ), Flexible( child: ListView.separated( @@ -124,7 +138,7 @@ class _ItemsSelectionSheetState extends State { ), 12.height, ShowFillButton( - title: "Copy Selected Item", + title: LocaleKeys.done.tr(), maxWidth: double.infinity, onPressed: () { widget.onItemCopied(filteredItems ?? []); diff --git a/lib/views/branch_management/services/services_list_page.dart b/lib/views/branch_management/services/services_list_page.dart index 12c96fb..b8b4431 100644 --- a/lib/views/branch_management/services/services_list_page.dart +++ b/lib/views/branch_management/services/services_list_page.dart @@ -76,7 +76,12 @@ class _ServicesListPageState extends State { ); context.read().applyFilterOnBranchServices(serviceStatusEnum: status); filteredServices = categoryData.services!.where((i) => i.serviceStatusEnum == status).toList(); - + int index = categoryData.services!.indexWhere((i) => i.serviceStatusEnum != ServiceStatusEnum.deactivated); + if (index == -1) { + isCategoryActive = false; + } else { + isCategoryActive = true; + } screenState = ViewState.idle; setState(() {}); } @@ -90,20 +95,17 @@ class _ServicesListPageState extends State { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.only(top: 5), - child: SvgPicture.asset( - MyAssets.maintenanceIcon, - width: 14, - height: 14, - ), + Padding( + padding: const EdgeInsets.only(top: 5), + child: SvgPicture.asset( + MyAssets.maintenanceIcon, + width: 14, + height: 14, ), ), 8.width, Expanded( - flex: 20, + flex: 10, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -132,38 +134,44 @@ class _ServicesListPageState extends State { ], ), ), - - // TODO: NEED TO CONFIRM CATEGORY DEACTIVATION FROM ZAHOOR - const Expanded( + Expanded( flex: 4, child: Column( children: [ - // LocaleKeys.active.tr().toText(fontSize: 16), - // 8.width, - // Container( - // width: 50, - // height: 30, - // decoration: BoxDecoration( - // color: isCategoryActive ? MyColors.darkPrimaryColor : MyColors.white, - // borderRadius: BorderRadius.circular(25.0), - // border: Border.all(color: MyColors.lightTextColor, width: 1), - // ), - // child: Transform.scale( - // scale: 0.8, - // child: CupertinoSwitch( - // activeColor: MyColors.darkPrimaryColor, - // trackColor: MyColors.white, - // thumbColor: MyColors.greyACColor, - // value: isCategoryActive, - // onChanged: (value) async { - // if (isEditDisabled) return; - // isCategoryActive = value; - // // isCategoryActive = await updateServiceStatus(context, value); - // setState(() {}); - // }, - // ), - // ), - // ), + LocaleKeys.active.tr().toText(fontSize: 16), + 8.width, + Container( + width: 50, + height: 30, + decoration: BoxDecoration( + color: isCategoryActive ? MyColors.darkPrimaryColor : MyColors.white, + borderRadius: BorderRadius.circular(25.0), + border: Border.all(color: MyColors.lightTextColor, width: 1), + ), + child: Transform.scale( + scale: 0.8, + child: CupertinoSwitch( + activeColor: MyColors.darkPrimaryColor, + trackColor: MyColors.white, + thumbColor: MyColors.greyACColor, + value: isCategoryActive, + onChanged: (value) async { + if (isEditDisabled) return; + final status = await updateCategoryStatus( + isCategoryActive: value, + categoryId: categoryData.id!, + branchId: int.parse(categoryData.branchId!), + ); + + if (status) { + isCategoryActive = value; + _onRefresh(value ? ServiceStatusEnum.pending : ServiceStatusEnum.deactivated); + } + setState(() {}); + }, + ), + ), + ), ], ), ), @@ -171,6 +179,19 @@ class _ServicesListPageState extends State { ).toWhiteContainer(width: double.infinity, allPading: 12); } + Future updateCategoryStatus({required bool isCategoryActive, required int categoryId, required int branchId}) async { + log("isCategoryActive: $isCategoryActive"); + final serviceVM = context.read(); + bool status = await serviceVM.updateCategoryStatus( + context: context, + serviceStatusEnum: isCategoryActive ? ServiceStatusEnum.approvedOrActive : ServiceStatusEnum.deactivated, + branchId: branchId, + categoryId: categoryId, + ); + + return status; + } + @override Widget build(BuildContext context) { categoryData = ModalRoute.of(context)!.settings.arguments as CategoryData; diff --git a/lib/views/dashboard/fragments/branch_appointment_fragment.dart b/lib/views/dashboard/fragments/branch_appointment_fragment.dart index 4af787d..fed932d 100644 --- a/lib/views/dashboard/fragments/branch_appointment_fragment.dart +++ b/lib/views/dashboard/fragments/branch_appointment_fragment.dart @@ -8,6 +8,7 @@ import 'package:mc_common_app/models/provider_branches_models/branch_detail_mode import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/navigator.dart'; +import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:mc_common_app/view_models/service_view_model.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; @@ -20,8 +21,8 @@ class BranchAppointmentFragment extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: const CustomAppBar( - title: "Select Branch", + appBar: CustomAppBar( + title: LocaleKeys.selectBranch.tr(), isRemoveBackButton: true, ), body: SizedBox( @@ -93,7 +94,7 @@ class BranchAppointmentFragment extends StatelessWidget { fontWeight: FontWeight.bold, ), ), - "Tap to view".toText(fontSize: 10, color: MyColors.grey70Color), + LocaleKeys.tapToView.tr().toText(fontSize: 10, color: MyColors.grey70Color), ], ), ), diff --git a/lib/views/dashboard/fragments/home_fragment.dart b/lib/views/dashboard/fragments/home_fragment.dart index 1c4241c..4a935ff 100644 --- a/lib/views/dashboard/fragments/home_fragment.dart +++ b/lib/views/dashboard/fragments/home_fragment.dart @@ -101,7 +101,7 @@ class HomeFragment extends StatelessWidget { onSubtitleTapped: () { context.read().onNavbarTapped(3); context.read().updateIsExploreAds(true); - context.read().applyFilterOnExploreAds(createdByRoleFilter: CreatedByRoleEnum.allAds); + context.read().applyFilterOnExploreAds(vehicleBrandId: 0); // allAds }, ).horPaddingMain(), AdsListWidget( @@ -109,6 +109,7 @@ class HomeFragment extends StatelessWidget { isAdsFragment: false, adsList: adVM.myActiveAdsForHome, scrollPhysics: const NeverScrollableScrollPhysics(), + hasMoreData: adVM.isExploreAdsTapped ? adVM.hasMoreDataForExploreAds : adVM.hasMoreDataForMyAds, ), ], ) @@ -123,7 +124,7 @@ class HomeFragment extends StatelessWidget { onSubtitleTapped: () { context.read().onNavbarTapped(3); context.read().updateIsExploreAds(true); - context.read().applyFilterOnExploreAds(createdByRoleFilter: CreatedByRoleEnum.allAds); + context.read().applyFilterOnExploreAds(vehicleBrandId: 0); // allAds }, ).horPaddingMain(), AdsListWidget( @@ -131,6 +132,7 @@ class HomeFragment extends StatelessWidget { adsList: adVM.exploreAds.length >= 3 ? adVM.exploreAds.take(3).toList() : adVM.exploreAds, isAdsFragment: false, scrollPhysics: const NeverScrollableScrollPhysics(), + hasMoreData: adVM.isExploreAdsTapped ? adVM.hasMoreDataForExploreAds : adVM.hasMoreDataForMyAds, ), ], ) diff --git a/pubspec.yaml b/pubspec.yaml index 2917b36..6885ea9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,8 +40,10 @@ dependencies: # path: C:/Users/mirza.shafique/AndroidStudioProjects/mc_common_app mc_common_app: - path: /Users/amir/StudioProjects/car_common_app -# path: /Volumes/Data/Projects/Flutter/car_common_app + # path: D:\Development\car_common_app + path: /Users/aamir/StudioProjects/car_common_app +# path: /Users/faizhashmi/Development/Projects/MyProjects/CloudSolutions/car_common_app +