MINOR-FIX: DropDownMenu Problem Fix.

This commit is contained in:
2025-12-09 11:34:02 +05:00
parent e4e77356b5
commit 01c625b9c9
5 changed files with 27 additions and 26 deletions

View File

@@ -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"
}

View File

@@ -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";
}

View File

@@ -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 =
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 {

View File

@@ -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:
<String>[
ConstTexts.delivery,
ConstTexts.takeAway,
].map((String value) {
["delivery", "takeaway"].map((
String value,
) {
return DropdownMenuItem<String>(
value: value,
child: Text(

View File

@@ -787,12 +787,10 @@ class HomeScreenTwo extends StatelessWidget {
DropdownButton<String>(
isDense: false,
underline: const SizedBox(),
value: controller.selectedOrderTypeValue.value.tr,
value: controller.selectedOrderTypeValue.value,
icon: const Icon(Icons.keyboard_arrow_down),
items:
<String>[ConstTexts.delivery, ConstTexts.takeAway].map((
String value,
) {
["delivery", "takeaway"].map((String value) {
return DropdownMenuItem<String>(
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,