BASE: Implement Localization In Home Screen.

This commit is contained in:
2025-12-08 13:51:09 +05:00
parent 653f1f93bf
commit 81895849df
4 changed files with 157 additions and 56 deletions

View File

@@ -130,15 +130,15 @@ class ConstTexts {
static String topBrands = "topBrands";
static String styleUp = "styleUp";
static String additionlOffers = "additionlOffers";
// static String enableLocation = "enableLocation";
// static String allowLocation = "allowLocation";
// static String useCurrentLocation = "useCurrentLocation";
// static String setFromMap = "setFromMap";
// static String enterManuallyLocation = "enterManuallyLocation";
// static String changeLanguage = "changeLanguage";
// static String aroundTheCity = "aroundTheCity";
// static String rideDetails = "rideDetails";
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
// static String somethingWentWrong = "somethingWentWrong";
// static String cash = "cash";
static String largestDiscounts = "largestDiscounts";
static String newArrivals = "newArrivals";
static String popularStores = "popularStores";
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

@@ -654,7 +654,7 @@ class HomeScreen extends StatelessWidget {
children: [
titleView(
isDark,
"Largest Discounts",
ConstTexts.largestDiscounts.tr,
() {
Get.to(
const DiscountRestaurantListScreen(),
@@ -709,7 +709,7 @@ class HomeScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"New Arrivals".tr,
ConstTexts.newArrival.tr,
textAlign:
TextAlign
.start,
@@ -744,7 +744,7 @@ class HomeScreen extends StatelessWidget {
});
},
child: Text(
"View all".tr,
ConstTexts.viewAll.tr,
textAlign:
TextAlign
.center,
@@ -825,7 +825,7 @@ class HomeScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
"Highlights for you"
ConstTexts.highlightsForU
.tr,
textAlign:
TextAlign
@@ -855,7 +855,7 @@ class HomeScreen extends StatelessWidget {
});
},
child: Text(
"View all"
ConstTexts.viewAll
.tr,
textAlign:
TextAlign
@@ -971,7 +971,7 @@ class HomeScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
"Popular Stores"
ConstTexts.popularStores
.tr,
textAlign:
TextAlign
@@ -1025,7 +1025,7 @@ class HomeScreen extends StatelessWidget {
vertical: 10,
),
child: Text(
"All Stores".tr,
ConstTexts.allStores.tr,
textAlign:
TextAlign
.center,
@@ -1247,12 +1247,12 @@ class HomeScreen 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."
ConstTexts.doYouWantChangeTheDeliverOption
.tr,
positiveString: "Ok".tr,
negativeString: "Cancel".tr,
positiveString: ConstTexts.ok.tr,
negativeString: ConstTexts.cancel.tr,
positiveClick: () async {
await Preferences.setString(
Preferences.foodDeliveryType,
@@ -1305,7 +1305,7 @@ class HomeScreen extends StatelessWidget {
onPress!();
},
child: Text(
"View all".tr,
ConstTexts.viewAll.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppThemeData.regular,
@@ -1479,7 +1479,7 @@ class PopularRestaurant extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
ConstTexts.freeDelivery.tr,
style: TextStyle(
fontSize: 14,
color: AppThemeData.carRent600,
@@ -1685,7 +1685,7 @@ class AllRestaurant extends StatelessWidget {
begin: const Alignment(-0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withOpacity(0),
Colors.black.withValues(alpha: 0),
const Color(0xFF111827),
],
),
@@ -1784,7 +1784,7 @@ class AllRestaurant extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
ConstTexts.freeDelivery.tr,
style: TextStyle(
fontSize: 14,
color: AppThemeData.carRent600,
@@ -2081,7 +2081,7 @@ class NewArrival extends StatelessWidget {
),
const SizedBox(width: 4),
Text(
"Free Delivery".tr,
ConstTexts.freeDelivery.tr,
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -2491,7 +2491,7 @@ class OfferView extends StatelessWidget {
begin: const Alignment(-0.00, -1.00),
end: const Alignment(0, 1),
colors: [
Colors.black.withOpacity(0),
Colors.black.withValues(alpha: 0),
AppThemeData.grey900,
],
),
@@ -2504,7 +2504,7 @@ class OfferView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Upto".tr,
ConstTexts.upto.tr,
textAlign: TextAlign.start,
maxLines: 1,
style: TextStyle(
@@ -2568,7 +2568,7 @@ class OfferView extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
"Free Delivery".tr,
ConstTexts.freeDelivery.tr,
style: TextStyle(
fontSize: 12,
overflow: TextOverflow.ellipsis,
@@ -3268,7 +3268,7 @@ class MapView extends StatelessWidget {
),
colors: [
Colors.black
.withOpacity(0),
.withValues(alpha: 0),
const Color(
0xFF111827,
),
@@ -3403,7 +3403,7 @@ class MapView extends StatelessWidget {
width: 5,
),
Text(
"Free Delivery"
ConstTexts.freeDelivery
.tr,
style: TextStyle(
fontSize:

View File

@@ -80,26 +80,118 @@ class ServiceListScreen extends StatelessWidget {
SizedBox(height: 10.h),
// Other Services Section
_otherServicesCardMaker(
image: "assets/images/garderob_img.png",
title: ConstTexts.updateYourWardrobe.tr,
subtitle: ConstTexts.weDeliverSafely.tr,
),
_otherServicesCardMaker(
image: "assets/images/keys_img.png",
title: ConstTexts.rent.tr,
subtitle: ConstTexts.hugeSelectionOfAds.tr,
),
_otherServicesCardMaker(
image: "assets/images/cosmetics_img.png",
title: ConstTexts.cosmetics.tr,
subtitle: ConstTexts.moreThan1000Products.tr,
),
_otherServicesCardMaker(
image: "assets/images/products_img.png",
title: ConstTexts.foodProducts.tr,
subtitle: ConstTexts.moreThan1000Products.tr,
),
controller.sectionList.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"ondemand-service",
) ==
null
? SizedBox.shrink()
: _otherServicesCardMaker(
image: "assets/images/garderob_img.png",
title: ConstTexts.updateYourWardrobe.tr,
subtitle: ConstTexts.weDeliverSafely.tr,
onTap: () {
SectionModel? innerSectionModel = controller
.sectionList
.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"ondemand-service",
);
if (innerSectionModel != null) {
controller.onServiceTap(
context,
innerSectionModel,
);
}
},
),
controller.sectionList.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"rental-service",
) ==
null
? SizedBox.shrink()
: _otherServicesCardMaker(
image: "assets/images/keys_img.png",
title: ConstTexts.rent.tr,
subtitle: ConstTexts.hugeSelectionOfAds.tr,
onTap: () {
SectionModel? innerSectionModel = controller
.sectionList
.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"rental-service",
);
if (innerSectionModel != null) {
controller.onServiceTap(
context,
innerSectionModel,
);
}
},
),
controller.sectionList.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"ecommerce-service",
) ==
null
? SizedBox.shrink()
: _otherServicesCardMaker(
image: "assets/images/cosmetics_img.png",
title: ConstTexts.cosmetics.tr,
subtitle: ConstTexts.moreThan1000Products.tr,
onTap: () {
SectionModel? innerSectionModel = controller
.sectionList
.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"ecommerce-service",
);
if (innerSectionModel != null) {
controller.onServiceTap(
context,
innerSectionModel,
);
}
},
),
controller.sectionList.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"ondemand-service",
) ==
null
? SizedBox.shrink()
: _otherServicesCardMaker(
image: "assets/images/products_img.png",
title: ConstTexts.foodProducts.tr,
subtitle: ConstTexts.moreThan1000Products.tr,
onTap: () {
SectionModel? innerSectionModel = controller
.sectionList
.firstWhereOrNull(
(element) =>
element.serviceTypeFlag ==
"ondemand-service",
);
if (innerSectionModel != null) {
controller.onServiceTap(
context,
innerSectionModel,
);
}
},
),
SizedBox(height: 45.h),
],
),
@@ -113,11 +205,10 @@ class ServiceListScreen extends StatelessWidget {
required String image,
required String title,
required String subtitle,
required VoidCallback onTap,
}) {
return InkWell(
onTap: () {
log("Other Service Card Tapped: $title");
},
onTap: onTap,
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16.r).copyWith(bottom: 10.r),