BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -35,11 +35,11 @@ import 'package:customer/screen_ui/multi_vendor_service/wallet_screen/wallet_scr
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/show_toast_dialog.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:razorpay_flutter/razorpay_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
@@ -210,7 +210,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
|
||||
totalAmount.value = (subTotal.value - discount.value) + taxAmount.value;
|
||||
} catch (e) {
|
||||
ShowToastDialog.showToast("${'Failed to calculate total:'.tr()} $e");
|
||||
ShowToastDialog.showToast("${'Failed to calculate total:'.tr} $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
|
||||
order.value.paymentMethod = selectedPaymentMethod.value;
|
||||
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
|
||||
ShowToastDialog.showToast("Payment method changed".tr());
|
||||
ShowToastDialog.showToast("Payment method changed".tr);
|
||||
Get.back();
|
||||
Get.back();
|
||||
});
|
||||
@@ -253,7 +253,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
}
|
||||
|
||||
await FireStoreUtils.rentalOrderPlace(order.value).then((value) {
|
||||
ShowToastDialog.showToast("Payment successfully".tr());
|
||||
ShowToastDialog.showToast("Payment successfully".tr);
|
||||
Get.back();
|
||||
Get.back();
|
||||
});
|
||||
@@ -311,10 +311,10 @@ class RentalOrderDetailsController extends GetxController {
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
}
|
||||
ShowToastDialog.showToast("Booking cancelled successfully".tr());
|
||||
ShowToastDialog.showToast("Booking cancelled successfully".tr);
|
||||
Get.back();
|
||||
} catch (e) {
|
||||
ShowToastDialog.showToast("${'Failed to cancel booking:'.tr()} $e".tr());
|
||||
ShowToastDialog.showToast("${'Failed to cancel booking:'.tr} $e".tr);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ class RentalOrderDetailsController 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(
|
||||
@@ -457,7 +457,7 @@ class RentalOrderDetailsController 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);
|
||||
completeOrder();
|
||||
});
|
||||
} on StripeException catch (e) {
|
||||
@@ -540,10 +540,10 @@ class RentalOrderDetailsController 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);
|
||||
completeOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -575,15 +575,15 @@ class RentalOrderDetailsController extends GetxController {
|
||||
note: "Contact us for any questions on your order.",
|
||||
onSuccess: (Map params) async {
|
||||
completeOrder();
|
||||
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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -610,15 +610,15 @@ class RentalOrderDetailsController extends GetxController {
|
||||
),
|
||||
)!.then((value) {
|
||||
if (value) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
||||
completeOrder();
|
||||
} 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,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -661,10 +661,10 @@ class RentalOrderDetailsController extends GetxController {
|
||||
value,
|
||||
) {
|
||||
if (value) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
||||
completeOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr());
|
||||
ShowToastDialog.showToast("Payment UnSuccessful!!".tr);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -698,11 +698,11 @@ class RentalOrderDetailsController extends GetxController {
|
||||
);
|
||||
if (isDone) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Payment successfully".tr());
|
||||
ShowToastDialog.showToast("Payment successfully".tr);
|
||||
completeOrder();
|
||||
} else {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Payment Failed".tr());
|
||||
ShowToastDialog.showToast("Payment Failed".tr);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -830,7 +830,7 @@ class RentalOrderDetailsController 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);
|
||||
@@ -867,18 +867,18 @@ class RentalOrderDetailsController extends GetxController {
|
||||
|
||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
||||
completeOrder();
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -896,10 +896,10 @@ class RentalOrderDetailsController extends GetxController {
|
||||
if (url != '') {
|
||||
Get.to(() => MidtransScreen(initialURl: url))!.then((value) {
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
||||
completeOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -940,7 +940,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -983,13 +983,13 @@ class RentalOrderDetailsController extends GetxController {
|
||||
),
|
||||
)!.then((value) {
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
||||
completeOrder();
|
||||
();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1027,7 +1027,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ class RentalOrderDetailsController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1103,10 +1103,10 @@ class RentalOrderDetailsController extends GetxController {
|
||||
),
|
||||
)!.then((value) {
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr);
|
||||
completeOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr());
|
||||
ShowToastDialog.showToast("Payment Unsuccessful!!".tr);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user