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

@@ -17,7 +17,7 @@ import 'package:customer/models/payment_model/xendit.dart';
import 'package:customer/models/user_model.dart';
import 'package:customer/models/wallet_transaction_model.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_paypal/flutter_paypal.dart';
import 'package:flutter_stripe/flutter_stripe.dart';
import 'package:razorpay_flutter/razorpay_flutter.dart';
@@ -34,7 +34,7 @@ import '../payment/xenditScreen.dart';
import '../service/fire_store_utils.dart';
import 'package:customer/utils/preferences.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Trans;
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import 'package:uuid/uuid.dart';
@@ -160,7 +160,7 @@ class WalletController extends GetxController {
}
});
ShowToastDialog.showToast("Amount Top-up successfully".tr());
ShowToastDialog.showToast("Amount Top-up successfully".tr);
}
// Strip
@@ -174,7 +174,7 @@ class WalletController 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(
@@ -207,7 +207,7 @@ class WalletController 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);
walletTopUp();
});
} on StripeException catch (e) {
@@ -290,15 +290,15 @@ class WalletController 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);
walletTopUp();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
}
});
} else {
ShowToastDialog.showToast(
"Something want wrong please contact administrator".tr(),
"Something want wrong please contact administrator".tr,
);
print('Error creating preference: ${response.body}');
return null;
@@ -327,15 +327,15 @@ class WalletController extends GetxController {
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
walletTopUp();
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);
},
),
),
@@ -362,15 +362,15 @@ class WalletController extends GetxController {
),
)!.then((value) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
walletTopUp();
} 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,
);
}
});
@@ -412,10 +412,10 @@ class WalletController extends GetxController {
value,
) {
if (value) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
walletTopUp();
} else {
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
}
});
} else {
@@ -449,11 +449,11 @@ class WalletController extends GetxController {
);
if (isDone) {
Get.back();
ShowToastDialog.showToast("Payment successfully".tr());
ShowToastDialog.showToast("Payment successfully".tr);
walletTopUp();
} else {
Get.back();
ShowToastDialog.showToast("Payment Failed".tr());
ShowToastDialog.showToast("Payment Failed".tr);
}
});
}
@@ -488,18 +488,18 @@ class WalletController extends GetxController {
}
void handlePaymentSuccess(PaymentSuccessResponse response) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
walletTopUp();
}
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);
}
//Midtrans payment
@@ -512,10 +512,10 @@ class WalletController extends GetxController {
if (url != '') {
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
walletTopUp();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
}
});
}
@@ -556,7 +556,7 @@ class WalletController extends GetxController {
return responseData['payment_url'];
} else {
ShowToastDialog.showToast(
"something went wrong, please contact admin.".tr(),
"something went wrong, please contact admin.".tr,
);
return '';
}
@@ -599,12 +599,12 @@ class WalletController extends GetxController {
),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
walletTopUp();
}
});
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
}
}
@@ -639,7 +639,7 @@ class WalletController extends GetxController {
);
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
return '';
}
@@ -692,7 +692,7 @@ class WalletController extends GetxController {
}
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
return '';
}
@@ -718,10 +718,10 @@ class WalletController extends GetxController {
),
)!.then((value) {
if (value == true) {
ShowToastDialog.showToast("Payment Successful!!".tr());
ShowToastDialog.showToast("Payment Successful!!".tr);
walletTopUp();
} else {
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
}
});
}