BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -6,7 +6,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/gift_cards_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';
|
||||
@@ -42,7 +42,7 @@ import '../screen_ui/multi_vendor_service/wallet_screen/wallet_screen.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';
|
||||
|
||||
@@ -99,7 +99,7 @@ class GiftCardController extends GetxController {
|
||||
setOrder();
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"You don't have sufficient wallet balance to purchase gift card".tr(),
|
||||
"You don't have sufficient wallet balance to purchase gift card".tr,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -108,7 +108,7 @@ class GiftCardController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> setOrder() async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
GiftCardsOrderModel giftCardsOrderModel = GiftCardsOrderModel();
|
||||
giftCardsOrderModel.id = const Uuid().v4();
|
||||
giftCardsOrderModel.giftId = selectedGiftCard.value.id.toString();
|
||||
@@ -136,8 +136,8 @@ class GiftCardController extends GetxController {
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
isTopup: false,
|
||||
orderId: giftCardsOrderModel.id,
|
||||
note: "Gift card purchase amount debited".tr(),
|
||||
paymentStatus: "success".tr(),
|
||||
note: "Gift card purchase amount debited".tr,
|
||||
paymentStatus: "success".tr,
|
||||
);
|
||||
|
||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((
|
||||
@@ -154,7 +154,7 @@ class GiftCardController extends GetxController {
|
||||
await FireStoreUtils.placeGiftCardOrder(giftCardsOrderModel);
|
||||
ShowToastDialog.closeLoader();
|
||||
Get.off(const HistoryGiftCard());
|
||||
ShowToastDialog.showToast("Gift card Purchases successfully".tr());
|
||||
ShowToastDialog.showToast("Gift card Purchases successfully".tr);
|
||||
}
|
||||
|
||||
String generateGiftCode() {
|
||||
@@ -371,7 +371,7 @@ class GiftCardController 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) {
|
||||
@@ -454,10 +454,10 @@ class GiftCardController 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 {
|
||||
@@ -486,15 +486,15 @@ class GiftCardController 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,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -536,10 +536,10 @@ class GiftCardController 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 {
|
||||
@@ -573,11 +573,11 @@ class GiftCardController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -605,15 +605,15 @@ class GiftCardController 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);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -759,7 +759,7 @@ class GiftCardController 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);
|
||||
@@ -796,18 +796,18 @@ class GiftCardController extends GetxController {
|
||||
|
||||
void handlePaymentSuccess(PaymentSuccessResponse response) {
|
||||
Get.back();
|
||||
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);
|
||||
}
|
||||
|
||||
//Midtrans payment
|
||||
@@ -820,10 +820,10 @@ class GiftCardController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -864,7 +864,7 @@ class GiftCardController extends GetxController {
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
"something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -907,13 +907,13 @@ class GiftCardController 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -951,7 +951,7 @@ class GiftCardController extends GetxController {
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1002,7 +1002,7 @@ class GiftCardController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
"Something went wrong, please contact admin.".tr,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
@@ -1028,11 +1028,11 @@ class GiftCardController 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user