From 4a384efd2d4c1ad0700d0ab7ba473fdf45315ac6 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" Date: Sun, 17 May 2026 11:48:44 +0300 Subject: [PATCH] Image Functionality & Discounts & Offers --- lib/core/app_state.dart | 2 + lib/presentation/home/landing_page.dart | 52 ++++++++++++------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/core/app_state.dart b/lib/core/app_state.dart index 5eb7a05d..9a4826b0 100644 --- a/lib/core/app_state.dart +++ b/lib/core/app_state.dart @@ -25,6 +25,8 @@ class AppState { _loadProfileImageFromCache(); } + bool isEnabledOffersAndDiscountsCarousel = false; + double userLat = 0.0; set setUserLat(v) => userLat = v; diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 4e0a6135..15bce8b0 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -406,34 +406,32 @@ class _LandingPageState extends State { : SizedBox.shrink(), // Offers And Discounts Carousel - Auto-scrolling from right to left - // appState.isAuthenticated - // ? - // Column( - // children: [ - // SizedBox(height: 12.h), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // ("${LocaleKeys.offers.tr(context: context)} & ${LocaleKeys.discount.tr(context: context)}").toText16(isBold: true), - // Row( - // children: [ - // LocaleKeys.viewAll.tr(context: context).toText14(color: AppColors.primaryRedColor, isBold: true), - // SizedBox(width: 2.h), - // Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 14.h), - // ], - // ), - // ], - // ).paddingSymmetrical(24.h, 0.h).onPress(() { - // Navigator.of(context).push(CustomPageRoute(page: OffersAndDiscountsPage())); - // }), - // SizedBox(height: 16.h), - // OffersAndDiscountsCarousel().paddingSymmetrical(24.h, 0.h), - // SizedBox(height: 18.h), - // ], - // ) - // : SizedBox.shrink(), + appState.isAuthenticated && appState.isEnabledOffersAndDiscountsCarousel + ? Column( + children: [ + SizedBox(height: 12.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ("${LocaleKeys.offers.tr(context: context)} & ${LocaleKeys.discount.tr(context: context)}").toText16(isBold: true), + Row( + children: [ + LocaleKeys.viewAll.tr(context: context).toText14(color: AppColors.primaryRedColor, isBold: true), + SizedBox(width: 2.h), + Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 14.h), + ], + ), + ], + ).paddingSymmetrical(24.h, 0.h).onPress(() { + Navigator.of(context).push(CustomPageRoute(page: OffersAndDiscountsPage())); + }), + SizedBox(height: 16.h), + OffersAndDiscountsCarousel().paddingSymmetrical(24.h, 0.h), + SizedBox(height: 18.h), + ], + ) + : SizedBox.shrink(), - // , appState.isAuthenticated ? Column( children: [