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

@@ -14,12 +14,12 @@ import 'package:customer/themes/round_button_border.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:customer/utils/utils.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:geocoding/geocoding.dart' as get_cord_address;
import 'package:get/get.dart' hide Trans;
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:flutter_map/flutter_map.dart' as flutterMap;
import 'package:latlong2/latlong.dart' as latlong;
@@ -280,7 +280,7 @@ class IntercityHomeScreen extends StatelessWidget {
controller.setDepartureMarker(lat, lng);
} else {
ShowToastDialog.showToast(
ConstTexts.serviceIsUnavailable.tr(),
ConstTexts.serviceIsUnavailable.tr,
);
}
}
@@ -313,7 +313,7 @@ class IntercityHomeScreen extends StatelessWidget {
);
} else {
ShowToastDialog.showToast(
ConstTexts.serviceIsUnavailable.tr(),
ConstTexts.serviceIsUnavailable.tr,
);
}
}
@@ -323,7 +323,7 @@ class IntercityHomeScreen extends StatelessWidget {
child: TextFieldWidget(
controller:
controller.sourceTextEditController.value,
hintText: ConstTexts.pickUpLocation.tr(),
hintText: ConstTexts.pickUpLocation.tr,
enable: false,
prefix: Padding(
padding: EdgeInsets.only(left: 10, right: 10),
@@ -387,7 +387,7 @@ class IntercityHomeScreen extends StatelessWidget {
.value,
// backgroundColor: AppThemeData.grey50,
// borderColor: AppThemeData.grey50,
hintText: ConstTexts.destinationLocation.tr(),
hintText: ConstTexts.destinationLocation.tr,
enable: false,
prefix: const Padding(
padding: EdgeInsets.only(left: 10, right: 10),
@@ -424,7 +424,7 @@ class IntercityHomeScreen extends StatelessWidget {
Align(
alignment: Alignment.centerLeft,
child: Text(
ConstTexts.popularDestinations.tr(),
ConstTexts.popularDestinations.tr,
style: AppThemeData.boldTextStyle(
fontSize: 16,
color: AppThemeData.grey900,
@@ -576,7 +576,7 @@ class IntercityHomeScreen extends StatelessWidget {
SizedBox(height: 10),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.continueT.tr(),
title: ConstTexts.continueT.tr,
onPress: () {
if (controller
.sourceTextEditController
@@ -584,7 +584,7 @@ class IntercityHomeScreen extends StatelessWidget {
.text
.isEmpty) {
ShowToastDialog.showToast(
ConstTexts.plsSelectSourceLocation.tr(),
ConstTexts.plsSelectSourceLocation.tr,
);
} else if (controller
.destinationTextEditController
@@ -592,7 +592,7 @@ class IntercityHomeScreen extends StatelessWidget {
.text
.isEmpty) {
ShowToastDialog.showToast(
ConstTexts.plsSelectDestinationLocations.tr(),
ConstTexts.plsSelectDestinationLocations.tr,
);
} else {
controller.bottomSheetType.value = "vehicleSelection";
@@ -650,7 +650,7 @@ class IntercityHomeScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Text(
ConstTexts.selectVehicleType.tr(),
ConstTexts.selectVehicleType.tr,
style: AppThemeData.boldTextStyle(
fontSize: 18,
color:
@@ -824,7 +824,7 @@ class IntercityHomeScreen extends StatelessWidget {
Obx(
() => RoundedButtonFill(
borderRadius: 10.r,
title: 'pay_amount'.tr(namedArgs: {
title: 'pay_amount'.trParams({
'amount': controller.selectedVehicleType.value.id == null
? Constant.amountShow(amount: "0.0")
: Constant.amountShow(
@@ -842,7 +842,7 @@ class IntercityHomeScreen extends StatelessWidget {
controller.bottomSheetType.value = "payment";
} else {
ShowToastDialog.showToast(
ConstTexts.plsSelectVehicleTypeFirst.tr(),
ConstTexts.plsSelectVehicleTypeFirst.tr,
);
}
},
@@ -884,7 +884,7 @@ class IntercityHomeScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
ConstTexts.selectPaymentMethod.tr(),
ConstTexts.selectPaymentMethod.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 18,
color:
@@ -914,7 +914,7 @@ class IntercityHomeScreen extends StatelessWidget {
controller: scrollController,
children: [
Text(
ConstTexts.prefferedPayment.tr(),
ConstTexts.prefferedPayment.tr,
textAlign: TextAlign.start,
style: AppThemeData.boldTextStyle(
fontSize: 15,
@@ -994,7 +994,7 @@ class IntercityHomeScreen extends StatelessWidget {
children: [
const SizedBox(height: 10),
Text(
ConstTexts.otherPaymentOptions.tr(),
ConstTexts.otherPaymentOptions.tr,
textAlign: TextAlign.start,
style: AppThemeData.boldTextStyle(
fontSize: 15,
@@ -1150,13 +1150,13 @@ class IntercityHomeScreen extends StatelessWidget {
),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.continueT.tr(),
title: ConstTexts.continueT.tr,
color: AppThemeData.primary300,
textColor: AppThemeData.grey900,
onPress: () async {
if (controller.selectedPaymentMethod.value.isEmpty) {
ShowToastDialog.showToast(
ConstTexts.plsSelectPaymentMethod.tr(),
ConstTexts.plsSelectPaymentMethod.tr,
);
return;
}
@@ -1165,7 +1165,7 @@ class IntercityHomeScreen extends StatelessWidget {
controller.userModel.value.walletAmount ?? 0;
if (walletAmount <= 0) {
ShowToastDialog.showToast(
ConstTexts.insufficientWallet.tr(),
ConstTexts.insufficientWallet.tr,
);
return;
}
@@ -1321,7 +1321,7 @@ class IntercityHomeScreen extends StatelessWidget {
.sourceTextEditController
.value,
hintText:
ConstTexts.pickUpLocation.tr(),
ConstTexts.pickUpLocation.tr,
enable: false,
prefix: const Padding(
padding: EdgeInsets.only(
@@ -1404,8 +1404,7 @@ class IntercityHomeScreen extends StatelessWidget {
// backgroundColor: AppThemeData.grey50,
// borderColor: AppThemeData.grey50,
hintText:
ConstTexts.destinationLocation
.tr(),
ConstTexts.destinationLocation.tr,
enable: false,
prefix: const Padding(
padding: EdgeInsets.only(
@@ -1453,7 +1452,7 @@ class IntercityHomeScreen extends StatelessWidget {
children: [
Expanded(
child: Text(
ConstTexts.promoCode.tr(),
ConstTexts.promoCode.tr,
style: AppThemeData.boldTextStyle(
fontSize: 16,
color:
@@ -1483,15 +1482,14 @@ class IntercityHomeScreen extends StatelessWidget {
controller.calculateTotalAmount();
} else {
ShowToastDialog.showToast(
ConstTexts.thisOfferNotEligible
.tr(),
ConstTexts.thisOfferNotEligible.tr,
);
}
}
});
},
child: Text(
ConstTexts.viewAll.tr(),
ConstTexts.viewAll.tr,
style: AppThemeData.boldTextStyle(
decoration: TextDecoration.underline,
fontSize: 14,
@@ -1552,7 +1550,7 @@ class IntercityHomeScreen extends StatelessWidget {
decoration: InputDecoration(
border: InputBorder.none,
hintText:
ConstTexts.writeCoupon.tr(),
ConstTexts.writeCoupon.tr,
contentPadding: EdgeInsets.only(
bottom: 10,
),
@@ -1569,7 +1567,7 @@ class IntercityHomeScreen extends StatelessWidget {
),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.redeemNow.tr(),
title: ConstTexts.redeemNow.tr,
width: 27.w,
fontSizes: 14,
@@ -1623,18 +1621,17 @@ class IntercityHomeScreen extends StatelessWidget {
ShowToastDialog.showToast(
ConstTexts
.thisOfferNotEligible
.tr(),
.tr,
);
}
} else {
ShowToastDialog.showToast(
ConstTexts.couponExpired.tr(),
ConstTexts.couponExpired.tr,
);
}
} else {
ShowToastDialog.showToast(
ConstTexts.invalidCouponCode
.tr(),
ConstTexts.invalidCouponCode.tr,
);
}
},
@@ -1668,7 +1665,7 @@ class IntercityHomeScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
ConstTexts.orderSummary.tr(),
ConstTexts.orderSummary.tr,
style: AppThemeData.boldTextStyle(
fontSize: 14,
color:
@@ -1688,7 +1685,7 @@ class IntercityHomeScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
Text(
ConstTexts.subtotal.tr(),
ConstTexts.subtotal.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 16,
color:
@@ -1726,7 +1723,7 @@ class IntercityHomeScreen extends StatelessWidget {
Row(
children: [
Text(
ConstTexts.discount.tr(),
ConstTexts.discount.tr,
style:
AppThemeData.mediumTextStyle(
fontSize: 16,
@@ -1845,7 +1842,7 @@ class IntercityHomeScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
Text(
ConstTexts.orderTotal.tr(),
ConstTexts.orderTotal.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 16,
color:
@@ -2035,7 +2032,7 @@ class IntercityHomeScreen extends StatelessWidget {
),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.confirmBooking.tr(),
title: ConstTexts.confirmBooking.tr,
onPress: () async {
controller.placeOrder();
},
@@ -2091,7 +2088,7 @@ class IntercityHomeScreen extends StatelessWidget {
),
SizedBox(height: 30),
Text(
ConstTexts.waitingForDriver.tr(),
ConstTexts.waitingForDriver.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 18,
color: AppThemeData.grey900,
@@ -2100,7 +2097,7 @@ class IntercityHomeScreen extends StatelessWidget {
Image.asset('assets/loader.gif', width: 250),
RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.cancelRide.tr(),
title: ConstTexts.cancelRide.tr,
onPress: () async {
try {
// 1. Update current order status
@@ -2150,7 +2147,7 @@ class IntercityHomeScreen extends StatelessWidget {
// 5. Optional feedback
ShowToastDialog.showToast(
ConstTexts.riderCancelledSucces.tr(),
ConstTexts.riderCancelledSucces.tr,
);
Get.back();
CabDashboardController cabDashboardController = Get.put(
@@ -2158,9 +2155,7 @@ class IntercityHomeScreen extends StatelessWidget {
);
cabDashboardController.selectedIndex.value = 0;
} catch (e) {
ShowToastDialog.showToast(
ConstTexts.failedToCancel.tr(),
);
ShowToastDialog.showToast(ConstTexts.failedToCancel.tr);
}
},
color: AppThemeData.danger300,
@@ -2258,7 +2253,7 @@ class IntercityHomeScreen extends StatelessWidget {
controller
.sourceTextEditController
.value,
hintText: ConstTexts.pickUpLocation.tr(),
hintText: ConstTexts.pickUpLocation.tr,
enable: false,
readOnly: true,
prefix: const Padding(
@@ -2307,7 +2302,7 @@ class IntercityHomeScreen extends StatelessWidget {
// backgroundColor: AppThemeData.grey50,
// borderColor: AppThemeData.grey50,
hintText:
ConstTexts.destinationLocation.tr(),
ConstTexts.destinationLocation.tr,
enable: false,
readOnly: true,
prefix: const Padding(
@@ -2454,7 +2449,7 @@ class IntercityHomeScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
ConstTexts.orderSummary.tr(),
ConstTexts.orderSummary.tr,
style: AppThemeData.boldTextStyle(
fontSize: 14,
color:
@@ -2474,7 +2469,7 @@ class IntercityHomeScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
Text(
ConstTexts.subtotal.tr(),
ConstTexts.subtotal.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 16,
color:
@@ -2510,7 +2505,7 @@ class IntercityHomeScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
Text(
ConstTexts.discount.tr(),
ConstTexts.discount.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 16,
color:
@@ -2599,7 +2594,7 @@ class IntercityHomeScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
Text(
ConstTexts.orderTotal.tr(),
ConstTexts.orderTotal.tr,
style: AppThemeData.mediumTextStyle(
fontSize: 16,
color:
@@ -2775,7 +2770,7 @@ class IntercityHomeScreen extends StatelessWidget {
icon: Icon(Icons.call, color: Colors.white),
onPress: () async {
ShowToastDialog.showLoader(
ConstTexts.pleaseWait.tr(),
ConstTexts.pleaseWait.tr,
);
LocationData location =
@@ -2802,8 +2797,9 @@ class IntercityHomeScreen extends StatelessWidget {
content: Builder(
builder: (context) {
return Text(
ConstTexts.yourSosRequest
.tr(),
ConstTexts
.yourSosRequest
.tr,
);
},
),
@@ -2825,7 +2821,7 @@ class IntercityHomeScreen extends StatelessWidget {
return Text(
ConstTexts
.yourSosrequestAlreadySubmitted
.tr(),
.tr,
);
},
),
@@ -2855,7 +2851,7 @@ class IntercityHomeScreen extends StatelessWidget {
controller.currentOrder.value.paymentStatus == false) {
return RoundedButtonFill(
borderRadius: 10.r,
title: ConstTexts.payNow.tr(),
title: ConstTexts.payNow.tr,
onPress: () async {
if (controller.selectedPaymentMethod.value ==
PaymentGateway.stripe.name) {
@@ -2928,7 +2924,7 @@ class IntercityHomeScreen extends StatelessWidget {
if (value == null) {
Get.back();
ShowToastDialog.showToast(
ConstTexts.somethingWentWrong.tr(),
ConstTexts.somethingWentWrong.tr,
);
} else {
CreateRazorPayOrderModel result = value;
@@ -2942,7 +2938,7 @@ class IntercityHomeScreen extends StatelessWidget {
});
} else {
ShowToastDialog.showToast(
ConstTexts.plsSelectPaymentMethod.tr(),
ConstTexts.plsSelectPaymentMethod.tr,
);
}
},