From 38c3394ef8a4aee5275c055d9750f65b802823f4 Mon Sep 17 00:00:00 2001 From: Abdusalom G'ayratov Date: Wed, 3 Dec 2025 16:41:57 +0500 Subject: [PATCH] BASE: Implement Localization In Cab Dashboard Screen. --- assets/translations/en_En.json | 9 ++++++++- lib/constant/const_texts.dart | 17 ++++++++++++++++- .../cab_coupon_code_screen.dart | 8 +++++--- .../cab_dashboard_screen.dart | 16 +++++++++------- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/assets/translations/en_En.json b/assets/translations/en_En.json index d662fc6..593f656 100644 --- a/assets/translations/en_En.json +++ b/assets/translations/en_En.json @@ -65,5 +65,12 @@ "payNow": "Pay Now", "youDoNothaveSufficientwalletBalance": "You do not have sufficient wallet balance", "somethingWentWrong": "Something went wrong, please contact admin.", - "cash": "Cash" + "cash": "Cash", + "coupon": "Coupon", + "couponNotFound": "Coupon not found.", + "tapToApply": "Tap To Apply", + "home": "Home", + "myBookings": "My Bookings", + "profile": "profile", + "wallet": "Wallet" } \ No newline at end of file diff --git a/lib/constant/const_texts.dart b/lib/constant/const_texts.dart index 2693203..ad7a841 100644 --- a/lib/constant/const_texts.dart +++ b/lib/constant/const_texts.dart @@ -65,5 +65,20 @@ class ConstTexts { static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance"; static String somethingWentWrong = "somethingWentWrong"; static String cash = "cash"; - + static String coupon = "coupon"; + static String couponNotFound = "couponNotFound"; + static String tapToApply = "tapToApply"; + static String home = "home"; + static String myBookings = "myBookings"; + static String profile = "profile"; + static String wallet = "wallet"; + static String failedToCancel = "failedToCancel"; + static String pleaseWait = "pleaseWait"; + static String change = "change"; + static String yourSosRequest = "yourSosRequest"; + static String yourSosrequestAlreadySubmitted = "yourSosrequestAlreadySubmitted"; + static String payNow = "payNow"; + static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance"; + static String somethingWentWrong = "somethingWentWrong"; + static String cash = "cash"; } diff --git a/lib/screen_ui/cab_service_screens/cab_coupon_code_screen.dart b/lib/screen_ui/cab_service_screens/cab_coupon_code_screen.dart index e69a795..251c102 100644 --- a/lib/screen_ui/cab_service_screens/cab_coupon_code_screen.dart +++ b/lib/screen_ui/cab_service_screens/cab_coupon_code_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/cab_coupon_code_controller.dart'; import 'package:customer/controllers/theme_controller.dart'; @@ -6,6 +7,7 @@ import 'package:customer/themes/app_them_data.dart'; import 'package:customer/themes/responsive.dart'; import 'package:customer/widget/my_separator.dart'; import 'package:dotted_border/dotted_border.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -37,7 +39,7 @@ class CabCouponCodeScreen extends StatelessWidget { ), ), const SizedBox(width: 10), - Text("Coupon".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)), + Text(ConstTexts.coupon.tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)), ], ), ), @@ -46,7 +48,7 @@ class CabCouponCodeScreen extends StatelessWidget { controller.isLoading.value ? Constant.loader() : controller.cabCouponList.isEmpty - ? Constant.showEmptyView(message: "Coupon not found".tr) + ? Constant.showEmptyView(message: ConstTexts.couponNotFound.tr()) : ListView.builder( shrinkWrap: true, itemCount: controller.cabCouponList.length, @@ -106,7 +108,7 @@ class CabCouponCodeScreen extends StatelessWidget { Get.back(result: couponModel); }, child: Text( - "Tap To Apply".tr, + ConstTexts.tapToApply.tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300), ), diff --git a/lib/screen_ui/cab_service_screens/cab_dashboard_screen.dart b/lib/screen_ui/cab_service_screens/cab_dashboard_screen.dart index 3f34429..9f322af 100644 --- a/lib/screen_ui/cab_service_screens/cab_dashboard_screen.dart +++ b/lib/screen_ui/cab_service_screens/cab_dashboard_screen.dart @@ -1,7 +1,9 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/cab_dashboard_controller.dart'; import 'package:customer/controllers/theme_controller.dart'; import 'package:customer/themes/app_them_data.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -50,21 +52,21 @@ class CabDashboardScreen extends StatelessWidget { isDark, index: 0, assetIcon: "assets/icons/ic_home_cab.svg", - label: 'Home'.tr, + label: ConstTexts.home.tr(), controller: controller, ), navigationBarItem( isDark, index: 1, assetIcon: "assets/icons/ic_booking_cab.svg", - label: 'My Bookings'.tr, + label: ConstTexts.myBookings.tr(), controller: controller, ), navigationBarItem( isDark, index: 2, assetIcon: "assets/icons/ic_profile.svg", - label: 'Profile'.tr, + label: ConstTexts.profile.tr(), controller: controller, ), ] @@ -73,28 +75,28 @@ class CabDashboardScreen extends StatelessWidget { isDark, index: 0, assetIcon: "assets/icons/ic_home_cab.svg", - label: 'Home'.tr, + label: ConstTexts.home.tr(), controller: controller, ), navigationBarItem( isDark, index: 1, assetIcon: "assets/icons/ic_booking_cab.svg", - label: 'My Bookings'.tr, + label: ConstTexts.myBookings.tr(), controller: controller, ), navigationBarItem( isDark, index: 2, assetIcon: "assets/icons/ic_wallet_cab.svg", - label: 'Wallet'.tr, + label: ConstTexts.wallet.tr(), controller: controller, ), navigationBarItem( isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", - label: 'Profile'.tr, + label: ConstTexts.profile.tr(), controller: controller, ), ],