From 01c625b9c9bde725e766159203d5684116bed0a9 Mon Sep 17 00:00:00 2001 From: Abdusalom G'ayratov Date: Tue, 9 Dec 2025 11:34:02 +0500 Subject: [PATCH] MINOR-FIX: DropDownMenu Problem Fix. --- assets/translations/en.json | 5 +++- lib/constant/const_texts.dart | 9 ++++--- lib/controllers/food_home_controller.dart | 5 ++-- .../home_screen/home_screen.dart | 9 +++---- .../home_screen/home_screen_two.dart | 25 ++++++++----------- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/assets/translations/en.json b/assets/translations/en.json index eb8d5ad..3efe196 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -152,6 +152,9 @@ "nonVeg": "Non Veg", "favourites": "Favourites", "orders": "Orders", - "takeAway": "TakeAway" + "takeAway": "TakeAway", + "seeAll": "See All", + "bestServingFood": "Best Servings Food", + "outCategories": "Our Categories" } \ No newline at end of file diff --git a/lib/constant/const_texts.dart b/lib/constant/const_texts.dart index 84d9357..a1047a1 100644 --- a/lib/constant/const_texts.dart +++ b/lib/constant/const_texts.dart @@ -152,12 +152,13 @@ class ConstTexts { static String favourites = "favourites"; static String orders = "orders"; static String takeAway = "takeAway"; - // static String allStores = "allStores"; - // static String alert = "alert"; - // static String cancel = "cancel"; + static String seeAll = "seeAll"; + static String bestServingFood = "bestServingFood"; + static String ourCategories = "outCategories"; // static String ok = "ok"; // static String freeDelivery = "freeDelivery"; // static String upto = "upto"; - static String doYouWantChangeTheDeliverOption = "doYouWantChangeTheDeliverOption"; + static String doYouWantChangeTheDeliverOption = + "doYouWantChangeTheDeliverOption"; // static String cash = "cash"; } diff --git a/lib/controllers/food_home_controller.dart b/lib/controllers/food_home_controller.dart index 095a6e5..aa7cc73 100644 --- a/lib/controllers/food_home_controller.dart +++ b/lib/controllers/food_home_controller.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/dash_board_controller.dart'; import 'package:customer/models/advertisement_model.dart'; @@ -33,7 +34,7 @@ class FoodHomeController extends GetxController { RxBool isLoading = true.obs; RxBool isListView = true.obs; RxBool isPopular = true.obs; - RxString selectedOrderTypeValue = "Delivery".tr.obs; + RxString selectedOrderTypeValue = "delivery".obs; Rx pageController = PageController(viewportFraction: 0.877).obs; @@ -70,7 +71,7 @@ class FoodHomeController extends GetxController { getCartData(); selectedOrderTypeValue.value = Preferences.getString( Preferences.foodDeliveryType, - defaultValue: "Delivery", + defaultValue: "delivery", ); await getZone(); FireStoreUtils.getAllNearestRestaurant().listen((event) async { diff --git a/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart b/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart index 250dfa2..0151eb8 100644 --- a/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart +++ b/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart @@ -1223,13 +1223,12 @@ class HomeScreen extends StatelessWidget { isDark ? AppThemeData.greyDark100 : AppThemeData.grey100, - value: controller.selectedOrderTypeValue.value.tr, + value: controller.selectedOrderTypeValue.value, icon: const Icon(Icons.keyboard_arrow_down), items: - [ - ConstTexts.delivery, - ConstTexts.takeAway, - ].map((String value) { + ["delivery", "takeaway"].map(( + String value, + ) { return DropdownMenuItem( value: value, child: Text( diff --git a/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart b/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart index 0606069..fd2816d 100644 --- a/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart +++ b/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart @@ -787,12 +787,10 @@ class HomeScreenTwo extends StatelessWidget { DropdownButton( isDense: false, underline: const SizedBox(), - value: controller.selectedOrderTypeValue.value.tr, + value: controller.selectedOrderTypeValue.value, icon: const Icon(Icons.keyboard_arrow_down), items: - [ConstTexts.delivery, ConstTexts.takeAway].map(( - String value, - ) { + ["delivery", "takeaway"].map((String value) { return DropdownMenuItem( value: value, child: Text( @@ -821,12 +819,11 @@ class HomeScreenTwo extends StatelessWidget { context: context, builder: (BuildContext context) { return CustomDialogBox( - title: "Alert".tr, + title: ConstTexts.alert.tr, descriptions: - "Do you really want to change the delivery option? Your cart will be empty." - .tr, - positiveString: "Ok".tr, - negativeString: "Cancel".tr, + ConstTexts.doYouWantChangeTheDeliverOption.tr, + positiveString: ConstTexts.ok.tr, + negativeString: ConstTexts.cancel.tr, positiveClick: () async { await Preferences.setString( Preferences.foodDeliveryType, @@ -888,7 +885,7 @@ class CategoryView extends StatelessWidget { children: [ Expanded( child: Text( - "Our Categories".tr, + ConstTexts.ourCategories.tr, style: TextStyle( fontFamily: AppThemeData.semiBold, color: @@ -904,7 +901,7 @@ class CategoryView extends StatelessWidget { Get.to(const ViewAllCategoryScreen()); }, child: Text( - "See all".tr, + ConstTexts.seeAll.tr, textAlign: TextAlign.center, style: TextStyle( fontFamily: AppThemeData.medium, @@ -919,7 +916,7 @@ class CategoryView extends StatelessWidget { ], ), GradientText( - 'Best Servings Food'.tr, + ConstTexts.bestServingFood.tr, style: TextStyle( fontSize: 24, fontFamily: 'Inter Tight', @@ -1023,7 +1020,7 @@ class OfferView extends StatelessWidget { children: [ Expanded( child: Text( - "Large Discounts".tr, + ConstTexts.largestDiscounts.tr, style: TextStyle( fontFamily: AppThemeData.semiBold, color: @@ -1046,7 +1043,7 @@ class OfferView extends StatelessWidget { ); }, child: Text( - "See all".tr, + ConstTexts.seeAll.tr, textAlign: TextAlign.center, style: TextStyle( fontFamily: AppThemeData.medium,