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

@@ -4,11 +4,11 @@ import 'package:customer/themes/show_toast_dialog.dart';
import 'package:customer/utils/utils.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:dropdown_textfield/dropdown_textfield.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart' hide Trans;
import 'package:get/get.dart';
import '../../constant/constant.dart';
import '../../controllers/book_parcel_controller.dart';
import '../../controllers/theme_controller.dart';
@@ -65,14 +65,14 @@ class BookParcelScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Book Your Document Delivery".tr(),
"Book Your Document Delivery".tr,
style: AppThemeData.boldTextStyle(
fontSize: 18,
color: AppThemeData.grey900,
),
),
Text(
"Schedule a secure and timely pickup & delivery".tr(),
"Schedule a secure and timely pickup & delivery".tr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppThemeData.mediumTextStyle(
@@ -100,7 +100,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 16),
buildInfoSectionView(
title: "Sender Information".tr(),
title: "Sender Information".tr,
locationController: controller.senderLocationController.value,
nameController: controller.senderNameController.value,
mobileController: controller.senderMobileController.value,
@@ -134,7 +134,7 @@ class BookParcelScreen extends StatelessWidget {
} else {
ShowToastDialog.showToast(
"Service is unavailable at the selected address."
.tr(),
.tr,
);
}
}
@@ -162,7 +162,7 @@ class BookParcelScreen extends StatelessWidget {
} else {
ShowToastDialog.showToast(
"Service is unavailable at the selected address."
.tr(),
.tr,
);
}
// ✅ <-- Add this
@@ -173,7 +173,7 @@ class BookParcelScreen extends StatelessWidget {
),
const SizedBox(height: 16),
buildInfoSectionView(
title: "Receiver Information".tr(),
title: "Receiver Information".tr,
locationController:
controller.receiverLocationController.value,
nameController: controller.receiverNameController.value,
@@ -209,7 +209,7 @@ class BookParcelScreen extends StatelessWidget {
} else {
ShowToastDialog.showToast(
"Service is unavailable at the selected address."
.tr(),
.tr,
);
}
}
@@ -237,7 +237,7 @@ class BookParcelScreen extends StatelessWidget {
} else {
ShowToastDialog.showToast(
"Service is unavailable at the selected address."
.tr(),
.tr,
);
}
}
@@ -249,7 +249,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 15),
RoundedButtonFill(
title: "Continue".tr(),
title: "Continue".tr,
onPress: () {
controller.bookNow();
},
@@ -283,7 +283,7 @@ class BookParcelScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Select delivery type".tr(),
"Select delivery type".tr,
style: AppThemeData.boldTextStyle(
color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500,
fontSize: 13,
@@ -305,7 +305,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(width: 20),
Expanded(
child: Text(
"As soon as possible".tr(),
"As soon as possible".tr,
style: AppThemeData.semiBoldTextStyle(
color:
isDark
@@ -348,7 +348,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(width: 20),
Expanded(
child: Text(
"Scheduled".tr(),
"Scheduled".tr,
style: AppThemeData.semiBoldTextStyle(
color:
isDark
@@ -377,7 +377,7 @@ class BookParcelScreen extends StatelessWidget {
GestureDetector(
onTap: () => controller.pickScheduledDate(context),
child: TextFieldWidget(
hintText: "When to pickup at this address".tr(),
hintText: "When to pickup at this address".tr,
controller: controller.scheduledDateController.value,
enable: false,
backgroundColor:
@@ -398,7 +398,7 @@ class BookParcelScreen extends StatelessWidget {
GestureDetector(
onTap: () => controller.pickScheduledTime(context),
child: TextFieldWidget(
hintText: "When to pickup at this address".tr(),
hintText: "When to pickup at this address".tr,
controller: controller.scheduledTimeController.value,
enable: false,
// onchange: (v) => controller.pickScheduledTime(context),
@@ -439,7 +439,7 @@ class BookParcelScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Upload parcel image".tr(),
"Upload parcel image".tr,
style: AppThemeData.boldTextStyle(
color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500,
fontSize: 13,
@@ -469,7 +469,7 @@ class BookParcelScreen extends StatelessWidget {
),
const SizedBox(height: 10),
Text(
"Upload Parcel Image".tr(),
"Upload Parcel Image".tr,
style: AppThemeData.mediumTextStyle(
fontSize: 16,
color:
@@ -480,7 +480,7 @@ class BookParcelScreen extends StatelessWidget {
),
const SizedBox(height: 4),
Text(
"Supported: .jpg, .jpeg, .png".tr(),
"Supported: .jpg, .jpeg, .png".tr,
style: AppThemeData.semiBoldTextStyle(
fontSize: 12,
color:
@@ -490,7 +490,7 @@ class BookParcelScreen extends StatelessWidget {
),
),
Text(
"Max size 1MB".tr(),
"Max size 1MB".tr,
style: AppThemeData.semiBoldTextStyle(
fontSize: 12,
color:
@@ -501,7 +501,7 @@ class BookParcelScreen extends StatelessWidget {
),
const SizedBox(height: 8),
RoundedButtonFill(
title: "Browse Image".tr(),
title: "Browse Image".tr,
onPress: () {
controller.onCameraClick(Get.context!);
},
@@ -597,7 +597,7 @@ class BookParcelScreen extends StatelessWidget {
GestureDetector(
onTap: onTap,
child: TextFieldWidget(
hintText: "Your Location".tr(),
hintText: "Your Location".tr,
controller: locationController,
suffix: const Padding(
@@ -614,7 +614,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
hintText: "Name".tr(),
hintText: "Name".tr,
controller: nameController,
backgroundColor:
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
@@ -624,7 +624,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
hintText: "Enter Mobile number".tr(),
hintText: "Enter Mobile number".tr,
controller: mobileController,
textInputType: TextInputType.number,
inputFormatters: [
@@ -686,7 +686,7 @@ class BookParcelScreen extends StatelessWidget {
clearOption: false,
enableSearch: false,
textFieldDecoration: InputDecoration(
hintText: "Select parcel Weight".tr(),
hintText: "Select parcel Weight".tr,
hintStyle: AppThemeData.regularTextStyle(
fontSize: 14,
color:
@@ -715,9 +715,9 @@ class BookParcelScreen extends StatelessWidget {
dropDownList:
controller.parcelWeight.map((e) {
return DropDownValueModel(
name: e.title ?? 'Normal'.tr(),
name: e.title ?? 'Normal'.tr,
value:
e.title ?? 'Normal'.tr(), // safer to use title string
e.title ?? 'Normal'.tr, // safer to use title string
);
}).toList(),
onChanged: (val) {
@@ -734,7 +734,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
hintText: "Notes (Optional)".tr(),
hintText: "Notes (Optional)".tr,
controller: noteController,
backgroundColor:
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,