Compare commits

..

2 Commits

7 changed files with 70 additions and 101 deletions

View File

@@ -152,19 +152,6 @@
"nonVeg": "Non Veg",
"favourites": "Favourites",
"orders": "Orders",
"takeAway": "TakeAway",
"seeAll": "See All",
"bestServingFood": "Best Servings Food",
"outCategories": "Our Categories",
"saveUpTo50Perc": "Save Up to 50% Off",
"stories": "Stories",
"bestFoodStories": "Best Food Stories Ever",
"error": "Error",
"couldNotLaunch": "Could not launch",
"exploreCategories": "Explore the Categories",
"noStoreFound": "No Store Found in Your Area",
"currentlyNoAvailableStoreInZone": "Currently, there are no available store in your zone. Try changing your location to find nearby options.",
"dineInReservations": "Dine-In Reservations",
"bookATable": "Book a table at your favorite restaurant and enjoy a delightful dining experience."
"takeAway": "TakeAway"
}

View File

@@ -152,34 +152,12 @@ class ConstTexts {
static String favourites = "favourites";
static String orders = "orders";
static String takeAway = "takeAway";
static String seeAll = "seeAll";
static String bestServingFood = "bestServingFood";
static String ourCategories = "outCategories";
static String saveUpTo50Perc = "saveUpTo50Perc";
static String error = "error";
static String bestFoodStories = "bestFoodStories";
static String doYouWantChangeTheDeliverOption =
"doYouWantChangeTheDeliverOption";
static String stories = "stories";
static String couldNotLaunch = "couldNotLaunch";
static String exploreCategories = "exploreCategories";
static String changeZone = "Change Zone";
static String noStoreFound = "noStoreFound";
static String currentlyNoAvailableStoreInZone = "currentlyNoAvailableStoreInZone";
static String dineInReservations = "dineInReservations";
static String bookATable = "bookATable";
// static String orders = "orders";
// static String takeAway = "takeAway";
// static String seeAll = "seeAll";
// static String bestServingFood = "bestServingFood";
// static String ourCategories = "outCategories";
// static String saveUpTo50Perc = "saveUpTo50Perc";
// static String error = "error";
// static String bestFoodStories = "bestFoodStories";
// static String doYouWantChangeTheDeliverOption =
// "doYouWantChangeTheDeliverOption";
// static String stories = "stories";
// static String couldNotLaunch = "couldNotLaunch";
// static String exploreCategories = "exploreCategories";
// static String changeZone = "Change Zone";
// static String allStores = "allStores";
// static String alert = "alert";
// static String cancel = "cancel";
// static String ok = "ok";
// static String freeDelivery = "freeDelivery";
// static String upto = "upto";
static String doYouWantChangeTheDeliverOption = "doYouWantChangeTheDeliverOption";
// static String cash = "cash";
}

View File

@@ -1,7 +1,6 @@
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';
@@ -34,7 +33,7 @@ class FoodHomeController extends GetxController {
RxBool isLoading = true.obs;
RxBool isListView = true.obs;
RxBool isPopular = true.obs;
RxString selectedOrderTypeValue = "delivery".obs;
RxString selectedOrderTypeValue = "Delivery".tr.obs;
Rx<PageController> pageController =
PageController(viewportFraction: 0.877).obs;
@@ -71,7 +70,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

@@ -1,4 +1,3 @@
import 'package:customer/constant/const_texts.dart';
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/dash_board_controller.dart';
import 'package:customer/controllers/dash_board_ecommarce_controller.dart';
@@ -53,28 +52,28 @@ class DashBoardEcommerceScreen extends StatelessWidget {
isDark,
index: 0,
assetIcon: "assets/icons/ic_home.svg",
label: ConstTexts.home.tr,
label: 'Home'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 1,
assetIcon: "assets/icons/ic_fav.svg",
label: ConstTexts.favourites.tr,
label: 'Favourites'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 2,
assetIcon: "assets/icons/ic_orders.svg",
label: ConstTexts.orders.tr,
label: 'Orders'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 3,
assetIcon: "assets/icons/ic_profile.svg",
label: ConstTexts.profile.tr,
label: 'Profile'.tr,
controller: controller,
),
]
@@ -83,35 +82,35 @@ class DashBoardEcommerceScreen extends StatelessWidget {
isDark,
index: 0,
assetIcon: "assets/icons/ic_home.svg",
label: ConstTexts.home.tr,
label: 'Home'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 1,
assetIcon: "assets/icons/ic_fav.svg",
label: ConstTexts.favourites.tr,
label: 'Favourites'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 2,
assetIcon: "assets/icons/ic_wallet.svg",
label: ConstTexts.wallet.tr,
label: 'Wallet'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 3,
assetIcon: "assets/icons/ic_orders.svg",
label: ConstTexts.orders.tr,
label: 'Orders'.tr,
controller: controller,
),
navigationBarItem(
isDark,
index: 4,
assetIcon: "assets/icons/ic_profile.svg",
label: ConstTexts.profile.tr,
label: 'Profile'.tr,
controller: controller,
),
],

View File

@@ -1,5 +1,3 @@
// ignore_for_file: depend_on_referenced_packages
import 'package:customer/constant/const_texts.dart';
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/dine_in_controller.dart';
@@ -13,6 +11,7 @@ import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
import 'package:customer/themes/round_button_fill.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -83,7 +82,7 @@ class DineInScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
ConstTexts.dineInReservations.tr,
"Dine-In Reservations".tr,
style: TextStyle(
fontSize: 24,
fontFamily: AppThemeData.semiBold,
@@ -95,7 +94,8 @@ class DineInScreen extends StatelessWidget {
),
),
Text(
ConstTexts.bookATable.tr,
"Book a table at your favorite restaurant and enjoy a delightful dining experience."
.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
@@ -133,7 +133,7 @@ class DineInScreen extends StatelessWidget {
),
const SizedBox(height: 12),
Text(
ConstTexts.noStoreFound.tr,
"No Store Found in Your Area".tr,
style: TextStyle(
color:
isDark
@@ -145,7 +145,8 @@ class DineInScreen extends StatelessWidget {
),
const SizedBox(height: 5),
Text(
ConstTexts.currentlyNoAvailableStoreInZone.tr,
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
.tr,
textAlign: TextAlign.center,
style: TextStyle(
color:
@@ -159,7 +160,7 @@ class DineInScreen extends StatelessWidget {
const SizedBox(height: 20),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.changeZone.tr,
title: "Change Zone".tr,
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -183,7 +184,7 @@ class DineInScreen extends StatelessWidget {
const SizedBox(height: 10),
titleView(
isDark,
ConstTexts.exploreCategories.tr,
"Explore the Categories".tr,
() {
Get.to(const ViewAllCategoryDineInScreen());
},
@@ -219,7 +220,7 @@ class DineInScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
ConstTexts.newArrivals.tr,
"New Arrivals".tr,
textAlign: TextAlign.start,
style: TextStyle(
fontFamily:
@@ -240,13 +241,12 @@ class DineInScreen extends StatelessWidget {
"vendorList":
controller
.newArrivalRestaurantList,
"title":
ConstTexts.newArrival.tr,
"title": "New Arrival",
},
);
},
child: Text(
ConstTexts.viewAll.tr,
"View all".tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
@@ -318,7 +318,7 @@ class DineInScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
ConstTexts.popularStores.tr,
"Popular Stores".tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
@@ -359,7 +359,7 @@ class DineInScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
ConstTexts.allStores.tr,
"All Stores".tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
@@ -427,7 +427,7 @@ class DineInScreen extends StatelessWidget {
onPress!();
},
child: Text(
ConstTexts.viewAll.tr,
"View all".tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.regular,
@@ -494,7 +494,7 @@ class PopularRestaurant extends StatelessWidget {
begin: const Alignment(-0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withOpacity(0),
const Color(0xFF111827),
],
),
@@ -757,7 +757,7 @@ class AllRestaurant extends StatelessWidget {
begin: const Alignment(-0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withOpacity(0),
const Color(0xFF111827),
],
),
@@ -1019,7 +1019,7 @@ class NewArrival extends StatelessWidget {
begin: const Alignment(0.00, 1.00),
end: const Alignment(0, -1),
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withOpacity(0),
AppThemeData.grey900,
],
),
@@ -1326,7 +1326,7 @@ class BannerBottomView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast(ConstTexts.couldNotLaunch.tr);
ShowToastDialog.showToast("Could not launch".tr);
}
}
},

View File

@@ -1223,10 +1223,13 @@ class HomeScreen extends StatelessWidget {
isDark
? AppThemeData.greyDark100
: AppThemeData.grey100,
value: controller.selectedOrderTypeValue.value,
value: controller.selectedOrderTypeValue.value.tr,
icon: const Icon(Icons.keyboard_arrow_down),
items:
["delivery", "takeaway"].map((String value) {
<String>[
ConstTexts.delivery,
ConstTexts.takeAway,
].map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(
@@ -1388,7 +1391,7 @@ class PopularRestaurant extends StatelessWidget {
begin: const Alignment(-0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withOpacity(0),
const Color(0xFF111827),
],
),
@@ -1995,7 +1998,7 @@ class NewArrival extends StatelessWidget {
begin: const Alignment(0.00, 1.00),
end: const Alignment(0, -1),
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withOpacity(0),
AppThemeData.grey900,
],
),
@@ -2218,7 +2221,7 @@ class AdvertisementHomeCard extends StatelessWidget {
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.1),
color: Colors.black.withOpacity(0.1),
blurRadius: isDark ? 6 : 2,
spreadRadius: 0,
offset: Offset(0, isDark ? 3 : 1),
@@ -2695,7 +2698,7 @@ class BannerView extends StatelessWidget {
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
ShowToastDialog.showToast(ConstTexts.couldNotLaunch.tr);
ShowToastDialog.showToast("Could not launch".tr);
}
}
},
@@ -2967,7 +2970,7 @@ class StoryView extends StatelessWidget {
height: Responsive.height(100, context),
width: Responsive.width(100, context),
),
Container(color: Colors.black.withValues(alpha: 0.30)),
Container(color: Colors.black.withOpacity(0.30)),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 5,
@@ -2985,7 +2988,7 @@ class StoryView extends StatelessWidget {
if (snapshot.hasError) {
return Center(
child: Text(
'${ConstTexts.error.tr}: ${snapshot.error}',
'${"Error".tr}: ${snapshot.error}',
),
);
} else if (snapshot.data == null) {

View File

@@ -787,10 +787,12 @@ class HomeScreenTwo extends StatelessWidget {
DropdownButton<String>(
isDense: false,
underline: const SizedBox(),
value: controller.selectedOrderTypeValue.value,
value: controller.selectedOrderTypeValue.value.tr,
icon: const Icon(Icons.keyboard_arrow_down),
items:
["delivery", "takeaway"].map((String value) {
<String>[ConstTexts.delivery, ConstTexts.takeAway].map((
String value,
) {
return DropdownMenuItem<String>(
value: value,
child: Text(
@@ -819,11 +821,12 @@ class HomeScreenTwo extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return CustomDialogBox(
title: ConstTexts.alert.tr,
title: "Alert".tr,
descriptions:
ConstTexts.doYouWantChangeTheDeliverOption.tr,
positiveString: ConstTexts.ok.tr,
negativeString: ConstTexts.cancel.tr,
"Do you really want to change the delivery option? Your cart will be empty."
.tr,
positiveString: "Ok".tr,
negativeString: "Cancel".tr,
positiveClick: () async {
await Preferences.setString(
Preferences.foodDeliveryType,
@@ -885,7 +888,7 @@ class CategoryView extends StatelessWidget {
children: [
Expanded(
child: Text(
ConstTexts.ourCategories.tr,
"Our Categories".tr,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
color:
@@ -901,7 +904,7 @@ class CategoryView extends StatelessWidget {
Get.to(const ViewAllCategoryScreen());
},
child: Text(
ConstTexts.seeAll.tr,
"See all".tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.medium,
@@ -916,7 +919,7 @@ class CategoryView extends StatelessWidget {
],
),
GradientText(
ConstTexts.bestServingFood.tr,
'Best Servings Food'.tr,
style: TextStyle(
fontSize: 24,
fontFamily: 'Inter Tight',
@@ -1020,7 +1023,7 @@ class OfferView extends StatelessWidget {
children: [
Expanded(
child: Text(
ConstTexts.largestDiscounts.tr,
"Large Discounts".tr,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
color:
@@ -1043,7 +1046,7 @@ class OfferView extends StatelessWidget {
);
},
child: Text(
ConstTexts.seeAll.tr,
"See all".tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.medium,
@@ -1058,7 +1061,7 @@ class OfferView extends StatelessWidget {
],
),
GradientText(
ConstTexts.saveUpTo50Perc.tr,
'Save Upto 50% Off'.tr,
style: TextStyle(
fontSize: 24,
fontFamily: 'Inter Tight',
@@ -1116,7 +1119,7 @@ class OfferView extends StatelessWidget {
begin: const Alignment(-0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withValues(alpha: 0),
Colors.black.withOpacity(0),
AppThemeData.grey900,
],
),
@@ -1286,7 +1289,7 @@ class StoryView extends StatelessWidget {
children: [
Expanded(
child: Text(
ConstTexts.stories.tr,
"Stories".tr,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
color:
@@ -1300,7 +1303,7 @@ class StoryView extends StatelessWidget {
],
),
GradientText(
ConstTexts.bestFoodStories.tr,
'Best Food Stories Ever'.tr,
style: TextStyle(
fontSize: 24,
fontFamily: 'Inter Tight',
@@ -1350,7 +1353,7 @@ class StoryView extends StatelessWidget {
height: Responsive.height(100, context),
width: Responsive.width(100, context),
),
Container(color: Colors.black.withValues(alpha: 0.30)),
Container(color: Colors.black.withOpacity(0.30)),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 5,
@@ -1368,7 +1371,7 @@ class StoryView extends StatelessWidget {
if (snapshot.hasError) {
return Center(
child: Text(
'${ConstTexts.error.tr}: ${snapshot.error}',
'${"Error".tr}: ${snapshot.error}',
),
);
} else if (snapshot.data == null) {