BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -5,7 +5,8 @@ import 'package:customer/screen_ui/on_demand_service/worker_inbox_screen.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/custom_dialog_box.dart';
|
||||
import 'package:customer/themes/responsive.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
|
||||
import 'package:in_app_review/in_app_review.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
@@ -24,7 +25,7 @@ import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../terms_and_condition/terms_and_condition_screen.dart';
|
||||
@@ -54,7 +55,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"My Profile".tr(),
|
||||
"My Profile".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
@@ -67,7 +68,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
"Manage your personal information, preferences, and settings all in one place."
|
||||
.tr(),
|
||||
.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
@@ -80,7 +81,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"General Information".tr(),
|
||||
"General Information".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
@@ -116,7 +117,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/images/ic_profile.svg",
|
||||
"Profile Information".tr(),
|
||||
"Profile Information".tr,
|
||||
() {
|
||||
Get.to(const EditProfileScreen());
|
||||
},
|
||||
@@ -129,7 +130,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/images/ic_dinin.svg",
|
||||
"Dine-In".tr(),
|
||||
"Dine-In".tr,
|
||||
() {
|
||||
Get.to(const DineInScreen());
|
||||
},
|
||||
@@ -138,7 +139,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/images/ic_gift.svg",
|
||||
"Gift Card".tr(),
|
||||
"Gift Card".tr,
|
||||
() {
|
||||
Get.to(const GiftCardScreen());
|
||||
},
|
||||
@@ -148,7 +149,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_cashback_Offer.svg",
|
||||
"Cashback Offers".tr(),
|
||||
"Cashback Offers".tr,
|
||||
() {
|
||||
Get.to(
|
||||
const CashbackOffersListScreen(),
|
||||
@@ -165,7 +166,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Bookings Information".tr(),
|
||||
"Bookings Information".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
@@ -199,7 +200,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_dinin_order.svg",
|
||||
"Dine-In Booking".tr(),
|
||||
"Dine-In Booking".tr,
|
||||
() {
|
||||
Get.to(
|
||||
const DineInBookingScreen(),
|
||||
@@ -215,7 +216,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
: const SizedBox(),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Preferences".tr(),
|
||||
"Preferences".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
@@ -249,7 +250,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_change_language.svg",
|
||||
"Change Language".tr(),
|
||||
"Change Language".tr,
|
||||
() {
|
||||
Get.to(const ChangeLanguageScreen());
|
||||
},
|
||||
@@ -258,7 +259,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_light_dark.svg",
|
||||
"Dark Mode".tr(),
|
||||
"Dark Mode".tr,
|
||||
() {},
|
||||
),
|
||||
],
|
||||
@@ -267,7 +268,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Social".tr(),
|
||||
"Social".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
@@ -303,7 +304,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_refer.svg",
|
||||
"Refer a Friend".tr(),
|
||||
"Refer a Friend".tr,
|
||||
() {
|
||||
Get.to(const ReferFriendScreen());
|
||||
},
|
||||
@@ -312,11 +313,11 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_share.svg",
|
||||
"Share app".tr(),
|
||||
"Share app".tr,
|
||||
() {
|
||||
Share.share(
|
||||
'${'Check out Foodie, your ultimate food delivery application!'.tr()} \n\n${'Google Play:'.tr()} ${Constant.googlePlayLink} \n\n${'App Store:'.tr()} ${Constant.appStoreLink}',
|
||||
subject: 'Look what I made!'.tr(),
|
||||
'${'Check out Foodie, your ultimate food delivery application!'.tr} \n\n${'Google Play:'.tr} ${Constant.googlePlayLink} \n\n${'App Store:'.tr} ${Constant.appStoreLink}',
|
||||
subject: 'Look what I made!'.tr,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -324,7 +325,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_rate.svg",
|
||||
"Rate the app".tr(),
|
||||
"Rate the app".tr,
|
||||
() {
|
||||
final InAppReview inAppReview =
|
||||
InAppReview.instance;
|
||||
@@ -342,7 +343,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Communication".tr(),
|
||||
"Communication".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
@@ -376,7 +377,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_chat.svg",
|
||||
"Store Inbox".tr(),
|
||||
"Store Inbox".tr,
|
||||
() {
|
||||
Get.to(
|
||||
const RestaurantInboxScreen(),
|
||||
@@ -387,7 +388,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_driver.svg",
|
||||
"Driver Inbox".tr(),
|
||||
"Driver Inbox".tr,
|
||||
() {
|
||||
Get.to(const DriverInboxScreen());
|
||||
},
|
||||
@@ -396,7 +397,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_chat.svg",
|
||||
"Provider Inbox".tr(),
|
||||
"Provider Inbox".tr,
|
||||
() {
|
||||
Get.to(
|
||||
const ProviderInboxScreen(),
|
||||
@@ -407,7 +408,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_driver.svg",
|
||||
"Worker Inbox".tr(),
|
||||
"Worker Inbox".tr,
|
||||
() {
|
||||
Get.to(const WorkerInboxScreen());
|
||||
},
|
||||
@@ -420,7 +421,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"Legal".tr(),
|
||||
"Legal".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
@@ -454,7 +455,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_privacy_policy.svg",
|
||||
"Privacy Policy".tr(),
|
||||
"Privacy Policy".tr,
|
||||
() {
|
||||
Get.to(
|
||||
const TermsAndConditionScreen(
|
||||
@@ -467,7 +468,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_tearm_condition.svg",
|
||||
"Terms and Conditions".tr(),
|
||||
"Terms and Conditions".tr,
|
||||
() {
|
||||
Get.to(
|
||||
const TermsAndConditionScreen(
|
||||
@@ -505,7 +506,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_logout.svg",
|
||||
"Log In".tr(),
|
||||
"Log In".tr,
|
||||
() {
|
||||
Get.offAll(const LoginScreen());
|
||||
},
|
||||
@@ -514,18 +515,18 @@ class ProfileScreen extends StatelessWidget {
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_logout.svg",
|
||||
"Log out".tr(),
|
||||
"Log out".tr,
|
||||
() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Log out".tr(),
|
||||
title: "Log out".tr,
|
||||
descriptions:
|
||||
"Are you sure you want to log out? You will need to enter your credentials to log back in."
|
||||
.tr(),
|
||||
positiveString: "Log out".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
.tr,
|
||||
positiveString: "Log out".tr,
|
||||
negativeString: "Cancel".tr,
|
||||
positiveClick: () async {
|
||||
Constant.userModel!.fcmToken =
|
||||
"";
|
||||
@@ -569,15 +570,15 @@ class ProfileScreen extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Delete Account".tr(),
|
||||
title: "Delete Account".tr,
|
||||
descriptions:
|
||||
"Are you sure you want to delete your account? This action is irreversible and will permanently remove all your data."
|
||||
.tr(),
|
||||
positiveString: "Delete".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
.tr,
|
||||
positiveString: "Delete".tr,
|
||||
negativeString: "Cancel".tr,
|
||||
positiveClick: () async {
|
||||
ShowToastDialog.showLoader(
|
||||
"Please wait...".tr(),
|
||||
"Please wait...".tr,
|
||||
);
|
||||
await controller
|
||||
.deleteUserFromServer();
|
||||
@@ -588,12 +589,12 @@ class ProfileScreen extends StatelessWidget {
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast(
|
||||
"Account deleted successfully"
|
||||
.tr(),
|
||||
.tr,
|
||||
);
|
||||
Get.offAll(const LoginScreen());
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Contact Administrator".tr(),
|
||||
"Contact Administrator".tr,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -620,7 +621,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Delete Account".tr(),
|
||||
"Delete Account".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
@@ -679,7 +680,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
SvgPicture.asset(
|
||||
image,
|
||||
colorFilter:
|
||||
title == "Log In".tr() || title == "Cashbacks".tr()
|
||||
title == "Log In".tr || title == "Cashbacks".tr
|
||||
? const ColorFilter.mode(
|
||||
AppThemeData.success500,
|
||||
BlendMode.srcIn,
|
||||
@@ -691,15 +692,15 @@ class ProfileScreen extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
title.tr(),
|
||||
title.tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
title == "Log out".tr()
|
||||
title == "Log out".tr
|
||||
? AppThemeData.danger300
|
||||
: title == "Log In".tr()
|
||||
: title == "Log In".tr
|
||||
? AppThemeData.success500
|
||||
: (isDark
|
||||
? AppThemeData.grey100
|
||||
@@ -707,7 +708,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
title == "Dark Mode".tr()
|
||||
title == "Dark Mode".tr
|
||||
? Transform.scale(
|
||||
scale: 0.8,
|
||||
child: Obx(
|
||||
|
||||
Reference in New Issue
Block a user