fixed issues of changing the lang

fatima_dev
Fatimah.Alshammari 2 weeks ago
parent eb4b286d32
commit ffdad47bdd

@ -123,7 +123,7 @@ class _AppointmentPageState extends State<AppointmentPage> {
const SizedBox(height: 25),
EmptyWidget(
spacerWidget: const SizedBox(height: 25),
text: appointmentsVM.appointmentFiltersCounter > 0 ? "No appointments that match your search" : LocaleKeys.noAppointmentFound.tr(),
text: appointmentsVM.appointmentFiltersCounter > 0 ? LocaleKeys.noAppointmentsMatchSearch.tr() : LocaleKeys.noAppointmentFound.tr(),
),
if (appointmentsVM.appointmentFiltersCounter > 0) ...[
const SizedBox(height: 16),
@ -131,9 +131,9 @@ class _AppointmentPageState extends State<AppointmentPage> {
onTap: () {
appointmentsVM.clearAppointmentFilters();
},
child: const Text(
"Clear Filters",
style: TextStyle(
child: Text(
LocaleKeys.clearFilters.tr(),
style: const TextStyle(
color: MyColors.darkPrimaryColor,
fontSize: 16,
fontWeight: FontWeight.w600,

@ -53,7 +53,7 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
"ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? "",
},
);
// await serviceVM.getBranchAndServices();
serviceVM.filterUserBranchCategories();
});
}
@ -123,9 +123,9 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
},
);
} else if (widget.branchData.branchStatus == BranchStatusEnum.pending) {
actionWidget = pendingApprovalAction(pendingText: "Approval Pending");
actionWidget = pendingApprovalAction(pendingText: LocaleKeys.approvalPending.tr(),);
} else if (widget.branchData.branchStatus == BranchStatusEnum.deactivated) {
actionWidget = pendingApprovalAction(pendingText: "Activate Now");
actionWidget = pendingApprovalAction(pendingText: LocaleKeys.activateNow.tr(),);
} else if (widget.branchData.branchStatus == BranchStatusEnum.rejected) {
actionWidget = Column(
children: [
@ -180,9 +180,11 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
isArabic
? serviceVM.categories[pIndex].categoryNameN.toString().toText(fontSize: 14, maxLines: 2)
: serviceVM.categories[pIndex].categoryName.toString().toText(fontSize: 14, maxLines: 2),
(isArabic ? (serviceVM.categories[pIndex].categoryNameN ?? serviceVM.categories[pIndex].categoryName)
: serviceVM.categories[pIndex].categoryName).toString().toText(fontSize: 16),
// isArabic
// ? serviceVM.categories[pIndex].categoryNameN.toString().toText(fontSize: 14, maxLines: 2)
// : serviceVM.categories[pIndex].categoryName.toString().toText(fontSize: 14, maxLines: 2),
],
),
8.height,
@ -390,6 +392,8 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
] else ...[
ListView.separated(
itemBuilder: (context, pIndex) {
print("Category English ===== ${serviceVM.categories[pIndex].categoryName}");
print("Category Arabic ===== ${serviceVM.categories[pIndex].categoryNameN}");
return buildServiceTileWidget(pIndex, serviceVM).onPress(() {
serviceVM.categories[pIndex].branchId = widget.branchData.id.toString();
serviceVM.categories[pIndex].branchName = widget.branchData.branchName.toString();

@ -32,12 +32,14 @@ class CreateBranchModel {
final String? categoryName;
final ServiceModel? serviceProviderService;
final bool isForEdit;
final String? categoryNameN;
CreateBranchModel({
required this.branchId,
required this.branchName,
this.categoryId,
this.categoryName,
this.categoryNameN,
this.serviceProviderService,
required this.isForEdit,
});
@ -90,6 +92,8 @@ class _ServicesListPageState extends State<ServicesListPage> {
Widget buildCategoryTileWidget() {
bool isArabic = AppState().isArabic(context);
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@ -113,7 +117,9 @@ class _ServicesListPageState extends State<ServicesListPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(child: isArabic ? categoryData.categoryNameN.toString().toText(fontSize: 16) : categoryData.categoryName.toString().toText(fontSize: 16)),
Flexible(
child: (isArabic ? (categoryData.categoryNameN ?? categoryData.categoryName)
: categoryData.categoryName).toString().toText(fontSize: 16)),
],
),
// 5.height,
@ -312,6 +318,7 @@ class _ServicesListPageState extends State<ServicesListPage> {
branchName: categoryData.branchName ?? '',
categoryId: categoryData.id.toString(),
categoryName: categoryData.categoryName,
categoryNameN: categoryData.categoryNameN,
serviceProviderService: filteredServices[index],
isForEdit: true,
),

@ -247,7 +247,7 @@ class GeneralAppointmentWidget extends StatelessWidget {
),
if (!isNeedTotalPayment)
if (appointmentListModel.customerAppointmentList != null && appointmentListModel.customerAppointmentList!.length > 1)
"${appointmentListModel.customerAppointmentList!.length - 1}+ appts".toText(fontSize: 8).toContainer(
"${appointmentListModel.customerAppointmentList!.length - 1}+ ${LocaleKeys.appts.tr()}".toText(fontSize: 8).toContainer(
borderRadius: 15,
backgroundColor: MyColors.lightGreyEAColor,
padding: const EdgeInsets.symmetric(

Loading…
Cancel
Save