BASE: Switch From EasyLocalization To GetX Localization.

This commit is contained in:
2025-12-04 16:56:39 +05:00
parent 157545f1c0
commit bf1d07a048
218 changed files with 2535 additions and 2313 deletions

View File

@@ -13,11 +13,11 @@ import 'package:customer/models/user_model.dart';
import 'package:customer/models/vendor_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_paypal/flutter_paypal.dart';
import 'package:flutter_stripe/flutter_stripe.dart';
import 'package:get/get.dart' hide Trans;
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart';
import 'package:razorpay_flutter/razorpay_flutter.dart';
@@ -416,7 +416,7 @@ class CartController extends GetxController {
setOrder();
} else {
ShowToastDialog.showToast(
"You don't have sufficient wallet balance to place order".tr(),
"You don't have sufficient wallet balance to place order".tr,
);
}
} else {
@@ -425,7 +425,7 @@ class CartController extends GetxController {
}
Future<void> setOrder() async {
ShowToastDialog.showLoader("Please wait...".tr());
ShowToastDialog.showLoader("Please wait...".tr);
if ((Constant.isSubscriptionModelApplied == true ||
Constant.sectionConstantModel?.adminCommision?.isEnabled == true) &&
@@ -438,7 +438,7 @@ class CartController extends GetxController {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast(
"This vendor has reached their maximum order capacity. Please select a different vendor or try again later."
.tr(),
.tr,
);
return;
}
@@ -508,8 +508,8 @@ class CartController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: orderModel.id,
note: "Order Amount debited".tr(),
paymentStatus: "success".tr(),
note: "Order Amount debited".tr,
paymentStatus: "success".tr,
);
await FireStoreUtils.setWalletTransaction(transactionModel).then((
@@ -712,7 +712,7 @@ class CartController extends GetxController {
if (paymentIntentData!.containsKey("error")) {
Get.back();
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
} else {
await Stripe.instance.initPaymentSheet(
@@ -745,7 +745,7 @@ class CartController extends GetxController {
Future<void> displayStripePaymentSheet({required String amount}) async {
try {
await Stripe.instance.presentPaymentSheet().then((value) {
ShowToastDialog.showToast("Payment successfully".tr());
ShowToastDialog.showToast("Payment successfully".tr);
placeOrder();
});
} on StripeException catch (e) {
@@ -828,10 +828,10 @@ class CartController extends GetxController {
final data = jsonDecode(response.body);
Get.to(MercadoPagoScreen(initialURl: data['init_point']))!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
}
});
} else {
@@ -863,15 +863,15 @@ class CartController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
placeOrder();
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
},
onError: (error) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
},
onCancel: (params) {
Get.back();
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
},
),
),
@@ -898,15 +898,15 @@ class CartController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
}
});
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
}
});
@@ -948,10 +948,10 @@ class CartController extends GetxController {
value,
) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
}
});
} else {
@@ -985,11 +985,11 @@ class CartController extends GetxController {
);
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr());
ShowToastDialog.showToast("Payment successfully".tr);
placeOrder();
} else {
Get.back();
ShowToastDialog.showToast("Payment Failed".tr());
ShowToastDialog.showToast("Payment Failed".tr);
}
});
}
@@ -1134,7 +1134,7 @@ class CartController extends GetxController {
data["body"]["txnToken"].toString().isEmpty) {
Get.back();
ShowToastDialog.showToast(
"something went wrong, please contact admin.".tr(),
"something went wrong, please contact admin.".tr,
);
}
return GetPaymentTxtTokenModel.fromJson(data);
@@ -1170,18 +1170,18 @@ class CartController extends GetxController {
}
void handlePaymentSuccess(PaymentSuccessResponse response) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
}
void handleExternalWaller(ExternalWalletResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Processing!! via".tr());
ShowToastDialog.showToast("Payment Processing!! via".tr);
}
void handlePaymentError(PaymentFailureResponse response) {
Get.back();
ShowToastDialog.showToast("Payment Failed!!".tr());
ShowToastDialog.showToast("Payment Failed!!".tr);
}
bool isCurrentDateInRange(DateTime startDate, DateTime endDate) {
@@ -1199,10 +1199,10 @@ class CartController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
}
});
}
@@ -1243,7 +1243,7 @@ class CartController extends GetxController {
return responseData['payment_url'];
} else {
ShowToastDialog.showToast(
"something went wrong, please contact admin.".tr(),
"something went wrong, please contact admin.".tr,
);
return '';
}
@@ -1286,13 +1286,13 @@ class CartController extends GetxController {
),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
}
}
@@ -1330,7 +1330,7 @@ class CartController extends GetxController {
);
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
return '';
}
@@ -1381,7 +1381,7 @@ class CartController extends GetxController {
}
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
return '';
}
@@ -1407,11 +1407,11 @@ class CartController extends GetxController {
),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
placeOrder();
();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
}
});
}