BASE: Implement Localization In Dashboard Screen & Home screen.

This commit is contained in:
2025-12-08 17:30:30 +05:00
parent 81895849df
commit fd8a4cb469
5 changed files with 59 additions and 26 deletions

View File

@@ -139,6 +139,25 @@ class ConstTexts {
static String ok = "ok";
static String freeDelivery = "freeDelivery";
static String upto = "upto";
static String viewCart = "viewCart";
static String viewTimings = "viewTimings";
static String timingIsNotAdded = "timingIsNotAdded";
static String alsoApplicableOnTable = "alsoApplicableOnTable";
static String tableBooking = "tableBooking";
static String quickConformations = "quickConformations";
static String menu = "menu";
static String searchAndMore = "searchAndMore";
static String veg = "veg";
static String nonVeg = "nonVeg";
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 ok = "ok";
static String freeDelivery = "freeDelivery";
static String upto = "upto";
static String doYouWantChangeTheDeliverOption = "doYouWantChangeTheDeliverOption";
static String cash = "cash";
}

View File

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

View File

@@ -1216,7 +1216,7 @@ class HomeScreen extends StatelessWidget {
value: controller.selectedOrderTypeValue.value.tr,
icon: const Icon(Icons.keyboard_arrow_down),
items:
<String>['Delivery'.tr, 'TakeAway'.tr].map((
<String>[ConstTexts.delivery.tr, ConstTexts.takeAway.tr].map((
String value,
) {
return DropdownMenuItem<String>(

View File

@@ -63,7 +63,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
),
Text(
'View Cart'.tr,
ConstTexts.viewCart.tr,
style: TextStyle(
fontFamily: AppThemeData.semiBold,
color: AppThemeData.grey50,
@@ -127,7 +127,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
ConstTexts.freeDelivery.tr,
style: TextStyle(
fontSize: 14,
color: AppThemeData.carRent600,
@@ -257,7 +257,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
begin: const Alignment(0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withOpacity(0),
Colors.black.withValues(alpha: 0),
Colors.black,
],
),
@@ -291,7 +291,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
begin: const Alignment(0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withOpacity(0),
Colors.black.withValues(alpha: 0),
Colors.black,
],
),
@@ -549,7 +549,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
.workingHours!
.isEmpty) {
ShowToastDialog.showToast(
"Timing is not added by store"
ConstTexts.timingIsNotAdded
.tr,
);
} else {
@@ -560,7 +560,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
}
},
child: Text(
"View Timings".tr,
ConstTexts.viewTimings.tr,
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -602,7 +602,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
children: [
const SizedBox(height: 20),
Text(
"Also applicable on table booking"
ConstTexts.alsoApplicableOnTable
.tr,
textAlign: TextAlign.start,
maxLines: 1,
@@ -676,7 +676,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
.start,
children: [
Text(
"Table Booking".tr,
ConstTexts.tableBooking.tr,
style: TextStyle(
fontSize: 16,
color:
@@ -694,7 +694,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
),
Text(
"Quick Conformations"
ConstTexts.quickConformations
.tr,
style: TextStyle(
fontSize: 12,
@@ -753,7 +753,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
const SizedBox(height: 20),
Text(
"Menu".tr,
ConstTexts.menu.tr,
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -773,7 +773,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
controller
.searchEditingController
.value,
hintText: 'Search the item and more...'.tr,
hintText: ConstTexts.searchAndMore.tr,
onchange: (value) {
controller.searchProduct(value);
},
@@ -867,7 +867,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
const SizedBox(width: 8),
Text(
'Veg'.tr,
ConstTexts.veg.tr,
style: TextStyle(
color:
isDark
@@ -963,7 +963,7 @@ class RestaurantDetailsScreen extends StatelessWidget {
),
const SizedBox(width: 8),
Text(
'Non Veg'.tr,
ConstTexts.nonVeg.tr,
style: TextStyle(
color:
isDark
@@ -1578,8 +1578,8 @@ class ProductListView extends StatelessWidget {
const SizedBox(width: 5),
Text(
productModel.nonveg == true
? "Non Veg.".tr
: "Pure veg.".tr,
? ConstTexts.nonVeg.tr
: ConstTexts.veg.tr,
style: TextStyle(
color:
productModel.nonveg == true