MINOR-FIX: DropDownMenu Problem Fix. #3

Merged
Abdusalom999 merged 1 commits from abdusalom0516/base/home-screen into master 2025-12-09 06:34:41 +00:00
5 changed files with 27 additions and 26 deletions
Showing only changes of commit 01c625b9c9 - Show all commits

View File

@@ -152,6 +152,9 @@
"nonVeg": "Non Veg", "nonVeg": "Non Veg",
"favourites": "Favourites", "favourites": "Favourites",
"orders": "Orders", "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 favourites = "favourites";
static String orders = "orders"; static String orders = "orders";
static String takeAway = "takeAway"; static String takeAway = "takeAway";
// static String allStores = "allStores"; static String seeAll = "seeAll";
// static String alert = "alert"; static String bestServingFood = "bestServingFood";
// static String cancel = "cancel"; static String ourCategories = "outCategories";
// static String ok = "ok"; // static String ok = "ok";
// static String freeDelivery = "freeDelivery"; // static String freeDelivery = "freeDelivery";
// static String upto = "upto"; // static String upto = "upto";
static String doYouWantChangeTheDeliverOption = "doYouWantChangeTheDeliverOption"; static String doYouWantChangeTheDeliverOption =
"doYouWantChangeTheDeliverOption";
// static String cash = "cash"; // static String cash = "cash";
} }

View File

@@ -1,6 +1,7 @@
import 'dart:developer'; import 'dart:developer';
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:customer/constant/const_texts.dart';
import 'package:customer/constant/constant.dart'; import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/dash_board_controller.dart'; import 'package:customer/controllers/dash_board_controller.dart';
import 'package:customer/models/advertisement_model.dart'; import 'package:customer/models/advertisement_model.dart';
@@ -33,7 +34,7 @@ class FoodHomeController extends GetxController {
RxBool isLoading = true.obs; RxBool isLoading = true.obs;
RxBool isListView = true.obs; RxBool isListView = true.obs;
RxBool isPopular = true.obs; RxBool isPopular = true.obs;
RxString selectedOrderTypeValue = "Delivery".tr.obs; RxString selectedOrderTypeValue = "delivery".obs;
Rx<PageController> pageController = Rx<PageController> pageController =
PageController(viewportFraction: 0.877).obs; PageController(viewportFraction: 0.877).obs;
@@ -70,7 +71,7 @@ class FoodHomeController extends GetxController {
getCartData(); getCartData();
selectedOrderTypeValue.value = Preferences.getString( selectedOrderTypeValue.value = Preferences.getString(
Preferences.foodDeliveryType, Preferences.foodDeliveryType,
defaultValue: "Delivery", defaultValue: "delivery",
); );
await getZone(); await getZone();
FireStoreUtils.getAllNearestRestaurant().listen((event) async { FireStoreUtils.getAllNearestRestaurant().listen((event) async {

View File

@@ -1223,13 +1223,12 @@ class HomeScreen extends StatelessWidget {
isDark isDark
? AppThemeData.greyDark100 ? AppThemeData.greyDark100
: AppThemeData.grey100, : AppThemeData.grey100,
value: controller.selectedOrderTypeValue.value.tr, value: controller.selectedOrderTypeValue.value,
icon: const Icon(Icons.keyboard_arrow_down), icon: const Icon(Icons.keyboard_arrow_down),
items: items:
<String>[ ["delivery", "takeaway"].map((
ConstTexts.delivery, String value,
ConstTexts.takeAway, ) {
].map((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text( child: Text(

View File

@@ -787,12 +787,10 @@ class HomeScreenTwo extends StatelessWidget {
DropdownButton<String>( DropdownButton<String>(
isDense: false, isDense: false,
underline: const SizedBox(), underline: const SizedBox(),
value: controller.selectedOrderTypeValue.value.tr, value: controller.selectedOrderTypeValue.value,
icon: const Icon(Icons.keyboard_arrow_down), icon: const Icon(Icons.keyboard_arrow_down),
items: items:
<String>[ConstTexts.delivery, ConstTexts.takeAway].map(( ["delivery", "takeaway"].map((String value) {
String value,
) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text( child: Text(
@@ -821,12 +819,11 @@ class HomeScreenTwo extends StatelessWidget {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return CustomDialogBox( return CustomDialogBox(
title: "Alert".tr, title: ConstTexts.alert.tr,
descriptions: descriptions:
"Do you really want to change the delivery option? Your cart will be empty." ConstTexts.doYouWantChangeTheDeliverOption.tr,
.tr, positiveString: ConstTexts.ok.tr,
positiveString: "Ok".tr, negativeString: ConstTexts.cancel.tr,
negativeString: "Cancel".tr,
positiveClick: () async { positiveClick: () async {
await Preferences.setString( await Preferences.setString(
Preferences.foodDeliveryType, Preferences.foodDeliveryType,
@@ -888,7 +885,7 @@ class CategoryView extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"Our Categories".tr, ConstTexts.ourCategories.tr,
style: TextStyle( style: TextStyle(
fontFamily: AppThemeData.semiBold, fontFamily: AppThemeData.semiBold,
color: color:
@@ -904,7 +901,7 @@ class CategoryView extends StatelessWidget {
Get.to(const ViewAllCategoryScreen()); Get.to(const ViewAllCategoryScreen());
}, },
child: Text( child: Text(
"See all".tr, ConstTexts.seeAll.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontFamily: AppThemeData.medium, fontFamily: AppThemeData.medium,
@@ -919,7 +916,7 @@ class CategoryView extends StatelessWidget {
], ],
), ),
GradientText( GradientText(
'Best Servings Food'.tr, ConstTexts.bestServingFood.tr,
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontFamily: 'Inter Tight', fontFamily: 'Inter Tight',
@@ -1023,7 +1020,7 @@ class OfferView extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"Large Discounts".tr, ConstTexts.largestDiscounts.tr,
style: TextStyle( style: TextStyle(
fontFamily: AppThemeData.semiBold, fontFamily: AppThemeData.semiBold,
color: color:
@@ -1046,7 +1043,7 @@ class OfferView extends StatelessWidget {
); );
}, },
child: Text( child: Text(
"See all".tr, ConstTexts.seeAll.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontFamily: AppThemeData.medium, fontFamily: AppThemeData.medium,