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

@@ -42,13 +42,13 @@ import 'package:customer/payment/xenditScreen.dart';
import 'package:customer/service/fire_store_utils.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_map/flutter_map.dart' as flutterMap;
import 'package:flutter_paypal/flutter_paypal.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:flutter_stripe/flutter_stripe.dart';
import 'package:get/get.dart' hide Trans;
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:http/http.dart' as http;
import 'package:latlong2/latlong.dart' as latlong;
@@ -402,7 +402,7 @@ class IntercityHomeController extends GetxController {
Marker(
markerId: const MarkerId("pickup"),
position: LatLng(pickupLat, pickupLng),
infoWindow: InfoWindow(title: "Pickup Location".tr()),
infoWindow: InfoWindow(title: "Pickup Location".tr),
icon:
departureIcon ??
BitmapDescriptor.defaultMarkerWithHue(
@@ -412,7 +412,7 @@ class IntercityHomeController extends GetxController {
Marker(
markerId: const MarkerId("driver"),
position: LatLng(driverLat, driverLng),
infoWindow: InfoWindow(title: "Driver at Pickup".tr()),
infoWindow: InfoWindow(title: "Driver at Pickup".tr),
icon: taxiIcon ?? BitmapDescriptor.defaultMarker,
),
]);
@@ -421,7 +421,7 @@ class IntercityHomeController extends GetxController {
Marker(
markerId: const MarkerId("destination"),
position: LatLng(destLat, destLng),
infoWindow: InfoWindow(title: "Destination Location".tr()),
infoWindow: InfoWindow(title: "Destination Location".tr),
icon:
destinationIcon ??
BitmapDescriptor.defaultMarkerWithHue(
@@ -431,7 +431,7 @@ class IntercityHomeController extends GetxController {
Marker(
markerId: const MarkerId("driver"),
position: LatLng(driverLat, driverLng),
infoWindow: InfoWindow(title: "Driver Location".tr()),
infoWindow: InfoWindow(title: "Driver Location".tr),
icon: taxiIcon ?? BitmapDescriptor.defaultMarker,
),
]);
@@ -536,7 +536,7 @@ class IntercityHomeController extends GetxController {
if (selectedPaymentMethod.value == PaymentGateway.cod.name) {
currentOrder.value.paymentMethod = selectedPaymentMethod.value;
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
ShowToastDialog.showToast("Payment method changed".tr());
ShowToastDialog.showToast("Payment method changed".tr);
Get.back();
Get.back();
});
@@ -557,8 +557,8 @@ class IntercityHomeController extends GetxController {
userId: FireStoreUtils.getCurrentUid(),
isTopup: false,
orderId: currentOrder.value.id,
note: "Cab Amount debited".tr(),
paymentStatus: "success".tr(),
note: "Cab Amount debited".tr,
paymentStatus: "success".tr,
serviceType: Constant.parcelServiceType,
);
@@ -575,7 +575,7 @@ class IntercityHomeController extends GetxController {
}
await FireStoreUtils.cabOrderPlace(currentOrder.value).then((value) {
ShowToastDialog.showToast("Payment successfully".tr());
ShowToastDialog.showToast("Payment successfully".tr);
Get.back();
});
}
@@ -743,7 +743,7 @@ class IntercityHomeController extends GetxController {
final LatLng pos = LatLng(lat, lng);
final markerId = MarkerId(isDeparture ? 'Departure' : 'Destination');
final icon = isDeparture ? departureIcon! : destinationIcon!;
final title = isDeparture ? 'Departure'.tr() : 'Destination'.tr();
final title = isDeparture ? 'Departure'.tr : 'Destination'.tr;
if (isDeparture) {
departureLatLong.value = pos;
@@ -1371,7 +1371,7 @@ class IntercityHomeController 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(
@@ -1404,7 +1404,7 @@ class IntercityHomeController 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) {
@@ -1487,10 +1487,10 @@ class IntercityHomeController 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 {
@@ -1522,15 +1522,15 @@ class IntercityHomeController 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);
},
),
),
@@ -1557,15 +1557,15 @@ class IntercityHomeController 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,
);
}
});
@@ -1607,10 +1607,10 @@ class IntercityHomeController 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 {
@@ -1644,11 +1644,11 @@ class IntercityHomeController 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);
}
});
}
@@ -1776,7 +1776,7 @@ class IntercityHomeController 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);
@@ -1813,18 +1813,18 @@ class IntercityHomeController 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) {
@@ -1842,10 +1842,10 @@ class IntercityHomeController 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);
}
});
}
@@ -1886,7 +1886,7 @@ class IntercityHomeController extends GetxController {
return responseData['payment_url'];
} else {
ShowToastDialog.showToast(
"something went wrong, please contact admin.".tr(),
"something went wrong, please contact admin.".tr,
);
return '';
}
@@ -1929,13 +1929,13 @@ class IntercityHomeController 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);
}
}
@@ -1973,7 +1973,7 @@ class IntercityHomeController extends GetxController {
);
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
return '';
}
@@ -2024,7 +2024,7 @@ class IntercityHomeController extends GetxController {
}
} else {
ShowToastDialog.showToast(
"Something went wrong, please contact admin.".tr(),
"Something went wrong, please contact admin.".tr,
);
return '';
}
@@ -2050,11 +2050,11 @@ class IntercityHomeController 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);
}
});
}