From a4573c8710c0f17a796b2b45318d1b4a4a457166 Mon Sep 17 00:00:00 2001 From: Haroon Amjad <> Date: Sun, 8 Feb 2026 22:28:17 +0300 Subject: [PATCH] arabic fixes --- lib/core/utils/date_util.dart | 2 +- lib/core/utils/utils.dart | 13 ++ lib/extensions/string_extensions.dart | 131 ++++----------- .../authentication_view_model.dart | 2 + lib/main.dart | 2 +- .../widgets/appointment_card.dart | 62 ++++---- .../widgets/appointment_doctor_card.dart | 18 ++- lib/presentation/authentication/login.dart | 1 + lib/presentation/authentication/register.dart | 3 + .../immediate_livecare_payment_details.dart | 6 +- .../book_appointment/widgets/doctor_card.dart | 23 ++- .../widget/e_referral_patient_info.dart | 1 + .../widget/search_e_referral_form.dart | 2 + .../habib_wallet/recharge_wallet_page.dart | 6 +- .../widgets/patient_insurance_card.dart | 5 +- .../medical_file/medical_file_page.dart | 3 +- .../medical_file_appointment_card.dart | 23 ++- .../vital_sign/vital_sign_details_page.dart | 1 + .../vital_sign/vital_sign_page.dart | 1 + .../bottomsheet/generic_bottom_sheet.dart | 3 +- .../dropdown/country_dropdown_widget.dart | 4 +- .../family_files/family_file_add_widget.dart | 2 + lib/widgets/input_widget.dart | 150 ++++++++++++------ 23 files changed, 243 insertions(+), 221 deletions(-) diff --git a/lib/core/utils/date_util.dart b/lib/core/utils/date_util.dart index d495b7f..2b13473 100644 --- a/lib/core/utils/date_util.dart +++ b/lib/core/utils/date_util.dart @@ -110,7 +110,7 @@ class DateUtil { } static String formatDateToTime(DateTime date) { - return DateFormat('hh:mm a').format(date); + return DateFormat('hh:mm a', "en-US").format(date); } static String yearMonthDay(DateTime dateTime) { diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 68838cd..60925bc 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -987,4 +987,17 @@ class Utils { return isAllowed; } + + static String toEnglishNumbers(String input) { + const english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + const arabic = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; + const persian = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; + + String result = input; + for (int i = 0; i < 10; i++) { + result = result.replaceAll(arabic[i], english[i]); + result = result.replaceAll(persian[i], english[i]); + } + return result; + } } diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 909d57d..ee5feed 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -23,8 +23,7 @@ extension CapExtension on String { extension EmailValidator on String { Widget get toWidget => Text(this); - Widget toText8({Color? color, FontWeight? fontWeight, bool isBold = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => - Text( + Widget toText8({Color? color, FontWeight? fontWeight, bool isBold = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => Text( this, maxLines: maxlines, overflow: textOverflow, @@ -38,7 +37,8 @@ extension EmailValidator on String { ); Widget toText10( - {Color? color, + {bool isEnglishOnly = false, + Color? color, FontWeight? weight, bool isBold = false, bool isUnderLine = false, @@ -59,19 +59,20 @@ extension EmailValidator on String { color: color ?? AppColors.blackColor, letterSpacing: letterSpacing, decoration: isUnderLine ? TextDecoration.underline : null, + fontFamily: isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins', decorationColor: color ?? AppColors.blackColor), ); Widget toText9( - {Color? color, - FontWeight? weight, - bool isBold = false, - bool isUnderLine = false, - bool isCenter = false, - int? maxlines, - FontStyle? fontStyle, - TextOverflow? textOverflow, - double letterSpacing = 0}) => + {Color? color, + FontWeight? weight, + bool isBold = false, + bool isUnderLine = false, + bool isCenter = false, + int? maxlines, + FontStyle? fontStyle, + TextOverflow? textOverflow, + double letterSpacing = 0}) => Text( this, textAlign: isCenter ? TextAlign.center : null, @@ -87,15 +88,7 @@ extension EmailValidator on String { decorationColor: color ?? AppColors.blackColor), ); - Widget toText11( - {Color? color, - FontWeight? weight, - bool isUnderLine = false, - bool isCenter = false, - bool isBold = false, - int maxLine = 0, - double letterSpacing = 0}) => - Text( + Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isCenter = false, bool isBold = false, int maxLine = 0, double letterSpacing = 0}) => Text( this, textAlign: isCenter ? TextAlign.center : null, maxLines: (maxLine > 0) ? maxLine : null, @@ -110,7 +103,7 @@ extension EmailValidator on String { ); Widget toText12( - {Color? color, + {bool isEnglishOnly = false, Color? color, bool isUnderLine = false, TextAlign textAlignment = TextAlign.start, bool isBold = false, @@ -131,6 +124,7 @@ extension EmailValidator on String { height: height, decorationColor: isUnderLine ? AppColors.blackColor : null, decoration: isUnderLine ? TextDecoration.underline : null, + fontFamily: isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins', ), ); @@ -176,15 +170,7 @@ extension EmailValidator on String { ), ); - Widget toText13( - {Color? color, - bool isUnderLine = false, - bool isBold = false, - bool isCenter = false, - int maxLine = 0, - FontWeight? weight, - double? letterSpacing = 0}) => - Text( + Widget toText13({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0, FontWeight? weight, double? letterSpacing = 0}) => Text( this, textAlign: isCenter ? TextAlign.center : null, maxLines: (maxLine > 0) ? maxLine : null, @@ -197,6 +183,7 @@ extension EmailValidator on String { ); Widget toText14({ + bool isEnglishOnly = false, Color? color, bool isUnderLine = false, bool isBold = false, @@ -219,18 +206,11 @@ extension EmailValidator on String { height: height, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), decoration: isUnderLine ? TextDecoration.underline : null, + fontFamily: isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins', decorationColor: color ?? AppColors.blackColor), ); - Widget toText15( - {Color? color, - bool isUnderLine = false, - bool isBold = false, - bool isCenter = false, - FontWeight? weight, - int? maxlines, - double? letterSpacing = -1}) => - Text( + Widget toText15({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, FontWeight? weight, int? maxlines, double? letterSpacing = -1}) => Text( this, textAlign: isCenter ? TextAlign.center : null, maxLines: maxlines, @@ -270,11 +250,10 @@ extension EmailValidator on String { decorationColor: decorationColor), ); - Widget toText17({Color? color, bool isBold = false, bool isCenter = false}) => Text( + Widget toText17({bool isEnglishOnly = false, Color? color, bool isBold = false, bool isCenter = false}) => Text( this, textAlign: isCenter ? TextAlign.center : null, - style: TextStyle( - color: color ?? AppColors.blackColor, fontSize: 17.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), + style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 17.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, fontFamily: isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'), ); Widget toText18({Color? color, FontWeight? weight, bool isBold = false, bool isCenter = false, int? maxlines, TextOverflow? textOverflow}) => Text( @@ -282,17 +261,12 @@ extension EmailValidator on String { textAlign: isCenter ? TextAlign.center : null, this, overflow: textOverflow, - style: TextStyle( - fontSize: 18.f, - fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), - color: color ?? AppColors.blackColor, - letterSpacing: -0.4), + style: TextStyle(fontSize: 18.f, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4), ); Widget toText19({Color? color, bool isBold = false}) => Text( this, - style: TextStyle( - fontSize: 19.f, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4), + style: TextStyle(fontSize: 19.f, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4), ); Widget toText20({ @@ -302,86 +276,51 @@ extension EmailValidator on String { }) => Text( this, - style: TextStyle( - fontSize: 20.f, - fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), - color: color ?? AppColors.blackColor, - letterSpacing: -0.4), + style: TextStyle(fontSize: 20.f, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4), ); Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text( this, maxLines: maxlines, - style: TextStyle( - color: color ?? AppColors.blackColor, - fontSize: 21.f, - letterSpacing: -1, - fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), + style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 21.f, letterSpacing: -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), ); Widget toText22({Color? color, bool isBold = false, bool isCenter = false}) => Text( this, textAlign: isCenter ? TextAlign.center : null, - style: TextStyle( - height: 1, - color: color ?? AppColors.blackColor, - fontSize: 22.f, - letterSpacing: -1, - fontWeight: isBold ? FontWeight.bold : FontWeight.normal), + style: TextStyle(height: 1, color: color ?? AppColors.blackColor, fontSize: 22.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), ); Widget toText24({Color? color, bool isBold = false, bool isCenter = false, FontWeight? fontWeight, double? letterSpacing}) => Text( this, textAlign: isCenter ? TextAlign.center : null, style: TextStyle( - height: 23 / 24, - color: color ?? AppColors.blackColor, - fontSize: 24.f, - letterSpacing: letterSpacing ?? -1, - fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal), + height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal), ); Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text( this, textAlign: isCenter ? TextAlign.center : null, style: TextStyle( - height: height ?? 23 / 26, - color: color ?? AppColors.blackColor, - fontSize: 26.f, - letterSpacing: letterSpacing ?? -1, - fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), + height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.f, letterSpacing: letterSpacing ?? -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), ); - Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false, double? letterSpacing}) => Text( + Widget toText28({bool isEnglishOnly = false, Color? color, bool isBold = false, double? height, bool isCenter = false, double? letterSpacing}) => Text( this, textAlign: isCenter ? TextAlign.center : null, - style: TextStyle( - height: height ?? 23 / 28, - color: color ?? AppColors.blackColor, - fontSize: 28.f, - letterSpacing: letterSpacing ?? -1, - fontWeight: isBold ? FontWeight.bold : FontWeight.normal), + style: TextStyle(height: height ?? 23 / 28, color: color ?? AppColors.blackColor, fontSize: 28.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, fontFamily: isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'), ); Widget toText32({FontWeight? weight, Color? color, bool isBold = false, bool isCenter = false}) => Text( this, textAlign: isCenter ? TextAlign.center : null, style: TextStyle( - height: 32 / 32, - color: color ?? AppColors.blackColor, - fontSize: 32.f, - letterSpacing: -1, - fontWeight: isBold ? FontWeight.bold : weight ?? FontWeight.normal), + height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 32.f, letterSpacing: -1, fontFamily: "Poppins", fontWeight: isBold ? FontWeight.bold : weight ?? FontWeight.normal), ); Widget toText44({Color? color, bool isBold = false}) => Text( this, - style: TextStyle( - height: 32 / 32, - color: color ?? AppColors.blackColor, - fontSize: 44.f, - letterSpacing: -1, - fontWeight: isBold ? FontWeight.bold : FontWeight.normal), + style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 44.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), ); Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) { @@ -417,9 +356,7 @@ extension EmailValidator on String { } bool isValidEmail() { - return RegExp( - r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') - .hasMatch(this); + return RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(this); } String toFormattedDate() { diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 689b0b4..c79e8ec 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -75,6 +75,8 @@ class AuthenticationViewModel extends ChangeNotifier { dobController = TextEditingController(), nameController = TextEditingController(), emailController = TextEditingController(); + + CountryEnum selectedCountrySignup = CountryEnum.saudiArabia; MaritalStatusTypeEnum? maritalStatus; GenderTypeEnum? genderType; diff --git a/lib/main.dart b/lib/main.dart index a782ae1..e034cf9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -228,7 +228,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Dr. AlHabib', builder: (context, mchild) { - return MediaQuery(data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), child: mchild!); + return MediaQuery(data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling, alwaysUse24HourFormat: true,), child: mchild!, ); }, showSemanticsDebugger: false, debugShowCheckedModeBanner: false, diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 493d15b..49aad51 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -26,6 +26,7 @@ import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; +import 'dart:ui' as ui; class AppointmentCard extends StatelessWidget { final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel; @@ -39,20 +40,20 @@ class AppointmentCard extends StatelessWidget { final ContactUsViewModel? contactUsViewModel; final BookAppointmentsViewModel bookAppointmentsViewModel; final bool isForRate; - const AppointmentCard({ - super.key, - required this.patientAppointmentHistoryResponseModel, - required this.myAppointmentsViewModel, - required this.bookAppointmentsViewModel, - this.isLoading = false, - this.isFromHomePage = false, - this.isFromMedicalReport = false, - this.isForEyeMeasurements = false, - this.isForFeedback = false, - this.medicalFileViewModel, - this.contactUsViewModel, - this.isForRate =false - }); + + const AppointmentCard( + {super.key, + required this.patientAppointmentHistoryResponseModel, + required this.myAppointmentsViewModel, + required this.bookAppointmentsViewModel, + this.isLoading = false, + this.isFromHomePage = false, + this.isFromMedicalReport = false, + this.isForEyeMeasurements = false, + this.isForFeedback = false, + this.medicalFileViewModel, + this.contactUsViewModel, + this.isForRate = false}); @override Widget build(BuildContext context) { @@ -64,11 +65,11 @@ class AppointmentCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - isForRate ? SizedBox(): _buildHeader(context, appState), + isForRate ? SizedBox() : _buildHeader(context, appState), SizedBox(height: 16.h), _buildDoctorRow(context), SizedBox(height: 16.h), - isForRate ? SizedBox(): _buildActionArea(context, appState), + isForRate ? SizedBox() : _buildActionArea(context, appState), ], ), ), @@ -101,18 +102,13 @@ class AppointmentCard extends StatelessWidget { textColor: isLoading ? AppColors.textColor : (isLiveCare ? AppColors.whiteColor : AppColors.textColor), ).toShimmer2(isShow: isLoading), AppCustomChipWidget( - labelText: isLoading - ? 'OutPatient' - : (appState.isArabic() - ? patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN! - : patientAppointmentHistoryResponseModel.isInOutPatientDescription!), + labelText: + isLoading ? 'OutPatient' : (appState.isArabic() ? patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN! : patientAppointmentHistoryResponseModel.isInOutPatientDescription!), backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.1), textColor: AppColors.primaryRedColor, ).toShimmer2(isShow: isLoading), AppCustomChipWidget( - labelText: isLoading - ? 'Booked' - : AppointmentType.getAppointmentStatusType(patientAppointmentHistoryResponseModel.patientStatusType!), + labelText: isLoading ? 'Booked' : AppointmentType.getAppointmentStatusType(patientAppointmentHistoryResponseModel.patientStatusType!), backgroundColor: AppColors.successColor.withValues(alpha: 0.1), textColor: AppColors.successColor, ).toShimmer2(isShow: isLoading), @@ -188,13 +184,17 @@ class AppointmentCard extends StatelessWidget { ? '${(patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").substring(0, 15)}...' : patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital") .toShimmer2(isShow: isLoading), - AppCustomChipWidget( - labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), - icon: AppAssets.appointment_calendar_icon, - labelText: isLoading - ? 'Cardiology' - : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}", - ).toShimmer2(isShow: isLoading), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), + icon: AppAssets.appointment_calendar_icon, + richText: isLoading + ? 'Cardiology'.toText10().toShimmer2(isShow: isLoading) + : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}" + .toText10(isEnglishOnly: true), + ), + ), // AppCustomChipWidget( // labelPadding: EdgeInsetsDirectional.only(start: -2.w, end: 6.w), diff --git a/lib/presentation/appointments/widgets/appointment_doctor_card.dart b/lib/presentation/appointments/widgets/appointment_doctor_card.dart index 0e3ade7..7e43069 100644 --- a/lib/presentation/appointments/widgets/appointment_doctor_card.dart +++ b/lib/presentation/appointments/widgets/appointment_doctor_card.dart @@ -12,6 +12,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; +import 'dart:ui' as ui; class AppointmentDoctorCard extends StatelessWidget { const AppointmentDoctorCard( @@ -98,13 +99,16 @@ class AppointmentDoctorCard extends StatelessWidget { labelText: patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital", labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), ), - AppCustomChipWidget( - labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w), - icon: AppAssets.doctor_calendar_icon, - labelText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang( - DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), - false, - )}", + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w), + icon: AppAssets.doctor_calendar_icon, + richText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang( + DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), + false, + )}".toText10(isEnglishOnly: true), + ), ), AppCustomChipWidget( labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w), diff --git a/lib/presentation/authentication/login.dart b/lib/presentation/authentication/login.dart index 2e6869d..9f64bde 100644 --- a/lib/presentation/authentication/login.dart +++ b/lib/presentation/authentication/login.dart @@ -90,6 +90,7 @@ class LoginScreenState extends State { leadingIcon: AppAssets.student_card, errorMessage: LocaleKeys.enterValidIDorIqama.tr(context: context), hasError: false, + fontFamily: "Poppins", ), SizedBox(height: 16.h), CustomButton( diff --git a/lib/presentation/authentication/register.dart b/lib/presentation/authentication/register.dart index 71bddb3..2a26a72 100644 --- a/lib/presentation/authentication/register.dart +++ b/lib/presentation/authentication/register.dart @@ -100,6 +100,7 @@ class _RegisterNew extends State { hintText: "xxxxxxxxx", controller: authVm.nationalIdController, focusNode: _nationalIdFocusNode, + keyboardType: TextInputType.number, isEnable: true, prefix: null, isAllowRadius: true, @@ -108,6 +109,7 @@ class _RegisterNew extends State { autoFocus: true, padding: EdgeInsets.symmetric(vertical: 8.h), leadingIcon: AppAssets.student_card, + fontFamily: "Poppins", ).withVerticalPadding(8), Divider(height: 1), TextInputWidget( @@ -125,6 +127,7 @@ class _RegisterNew extends State { selectionType: SelectionTypeEnum.calendar, onCalendarTypeChanged: authVm.onCalenderTypeChange, onChange: authVm.onDobChange, + fontFamily: "Poppins", ).withVerticalPadding(8), ], ), diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart index 6b2620b..e9e79cb 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart @@ -185,7 +185,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { children: [ LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.amount!.toText16(isBold: true), AppColors.blackColor, 13, - isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"), + isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال"), ], ).paddingSymmetrical(24.h, 0.h), Row( @@ -194,7 +194,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), Utils.getPaymentAmountWithSymbol( immediateLiveCareVM.liveCareImmediateAppointmentFeesList.tax!.toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13, - isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"), + isSaudiCurrency: (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال")), ], ).paddingSymmetrical(24.h, 0.h), SizedBox(height: 17.h), @@ -203,7 +203,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { children: [ SizedBox(width: 150.h, child: Utils.getPaymentMethods()), Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true), AppColors.blackColor, 17, - isSaudiCurrency: immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar"), + isSaudiCurrency: (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال")), ], ).paddingSymmetrical(24.h, 0.h), (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0") diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index e2009bb..ddb43e9 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -38,7 +38,7 @@ class DoctorCard extends StatelessWidget { hasShadow: false, ), child: Padding( - padding: EdgeInsets.only(top: 14.h,bottom: 20.h), + padding: EdgeInsets.only(top: 14.h, bottom: 20.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -91,9 +91,7 @@ class DoctorCard extends StatelessWidget { children: [ SizedBox( width: MediaQuery.of(context).size.width * 0.55, - child: (isLoading ? "Dr John Smith" : "${doctorsListResponseModel.doctorTitle} ${doctorsListResponseModel.name}") - .toString() - .toText16(isBold: true, maxlines: 1), + child: (isLoading ? "Dr John Smith" : "${doctorsListResponseModel.doctorTitle} ${doctorsListResponseModel.name}").toString().toText16(isBold: true, maxlines: 1), ).toShimmer2(isShow: isLoading), ], ), @@ -135,12 +133,14 @@ class DoctorCard extends StatelessWidget { ).toShimmer2(isShow: isLoading), bookAppointmentsViewModel.isNearestAppointmentSelected ? doctorsListResponseModel.nearestFreeSlot != null - ? AppCustomChipWidget( - labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), - backgroundColor: AppColors.successColor, - textColor: AppColors.whiteColor, - ).toShimmer2(isShow: isLoading) - : SizedBox.shrink() + ? AppCustomChipWidget( + // labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), + richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)) + .toText10(isEnglishOnly: true, color: AppColors.whiteColor), + backgroundColor: AppColors.successColor, + textColor: AppColors.whiteColor, + ).toShimmer2(isShow: isLoading) + : SizedBox.shrink() : SizedBox.shrink(), ], ), @@ -149,8 +149,7 @@ class DoctorCard extends StatelessWidget { ), Expanded( flex: 1, - child: Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown) - .toShimmer2(isShow: isLoading), + child: Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown).toShimmer2(isShow: isLoading), ), ], ), diff --git a/lib/presentation/e_referral/widget/e_referral_patient_info.dart b/lib/presentation/e_referral/widget/e_referral_patient_info.dart index 0cc5c7e..61b92c7 100644 --- a/lib/presentation/e_referral/widget/e_referral_patient_info.dart +++ b/lib/presentation/e_referral/widget/e_referral_patient_info.dart @@ -140,6 +140,7 @@ class PatientInformationStepState extends State { controller: _phoneController, padding: const EdgeInsets.all(8), keyboardType: TextInputType.number, + fontFamily: "Poppins", onChange: (value) { formManager.updatePatientPhone(value ?? ''); }, diff --git a/lib/presentation/e_referral/widget/search_e_referral_form.dart b/lib/presentation/e_referral/widget/search_e_referral_form.dart index fa3ae19..33697d5 100644 --- a/lib/presentation/e_referral/widget/search_e_referral_form.dart +++ b/lib/presentation/e_referral/widget/search_e_referral_form.dart @@ -73,6 +73,7 @@ class SearchEReferralFormFormState extends State { hintText: formManager.searchCriteria == 0 ? "Enter Identification Number" : "Enter Referral Number", labelText: formManager.searchCriteria == 0 ? "Identification Number" : "Referral Number", keyboardType: TextInputType.number, + fontFamily: "Poppins", errorMessage: formManager.errors.searchValue, hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.searchValue), onChange: (value) { @@ -94,6 +95,7 @@ class SearchEReferralFormFormState extends State { controller: _phoneController, padding: const EdgeInsets.all(8), keyboardType: TextInputType.number, + fontFamily: "Poppins", onChange: (value) { formManager.updateSearchPhone(value ?? ''); // _validateForm(formManager); diff --git a/lib/presentation/habib_wallet/recharge_wallet_page.dart b/lib/presentation/habib_wallet/recharge_wallet_page.dart index 22e854a..78608e8 100644 --- a/lib/presentation/habib_wallet/recharge_wallet_page.dart +++ b/lib/presentation/habib_wallet/recharge_wallet_page.dart @@ -98,11 +98,12 @@ class _RechargeWalletPageState extends State { isBorderAllowed: false, isAllowLeadingIcon: true, autoFocus: true, - fontSize: 40, + fontSize: 40.f, padding: EdgeInsets.symmetric(horizontal: 8.h, vertical: 0.h), focusNode: textFocusNode, isWalletAmountInput: true, keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), + fontFamily: "Poppins", // leadingIcon: AppAssets.student_card, ), ), @@ -217,12 +218,11 @@ class _RechargeWalletPageState extends State { keyboardType: TextInputType.text, isEnable: true, prefix: null, - autoFocus: true, + autoFocus: false, isAllowRadius: true, isBorderAllowed: false, isAllowLeadingIcon: true, leadingIcon: AppAssets.notes_icon, - errorMessage: LocaleKeys.enterValidIDorIqama.tr(context: context), hasError: false, ), SizedBox(height: 8.h), diff --git a/lib/presentation/insurance/widgets/patient_insurance_card.dart b/lib/presentation/insurance/widgets/patient_insurance_card.dart index 84fdee4..c9ec790 100644 --- a/lib/presentation/insurance/widgets/patient_insurance_card.dart +++ b/lib/presentation/insurance/widgets/patient_insurance_card.dart @@ -75,10 +75,11 @@ class PatientInsuranceCard extends StatelessWidget { children: [ AppCustomChipWidget( icon: AppAssets.doctor_calendar_icon, - labelText: "${LocaleKeys.expiryDate.tr(context: context)} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceCardDetailsModel.cardValidTo), false)}", + // labelText: "${LocaleKeys.expiryDate.tr(context: context)} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceCardDetailsModel.cardValidTo), false)}", + richText: "${LocaleKeys.expiryDate.tr(context: context)} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceCardDetailsModel.cardValidTo), false)}".toText10(isEnglishOnly: true), labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.h), ), - AppCustomChipWidget(labelText: LocaleKeys.patientCardID.tr(namedArgs: {'id': insuranceCardDetailsModel.patientCardID ?? ''}, context: context)), + AppCustomChipWidget(richText: LocaleKeys.patientCardID.tr(namedArgs: {'id': insuranceCardDetailsModel.patientCardID ?? ''}, context: context).toText10(isEnglishOnly: true)), ], ), SizedBox(height: 10.h), diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index b08f75b..ddac1bb 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -250,7 +250,7 @@ class _MedicalFilePageState extends State { children: [ AppCustomChipWidget( icon: AppAssets.file_icon, - labelText: "${LocaleKeys.fileno.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}", + richText: "${LocaleKeys.fileno.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}".toText10(isEnglishOnly: true), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), ), AppCustomChipWidget( @@ -1602,6 +1602,7 @@ class _MedicalFilePageState extends State { child: value.toText17( isBold: true, color: AppColors.textColor, + isEnglishOnly: true ), ), if (unit.isNotEmpty) ...[ diff --git a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart index 3d3624d..73dd165 100644 --- a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart +++ b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart @@ -18,6 +18,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; +import 'dart:ui' as ui; + class MedicalFileAppointmentCard extends StatelessWidget { final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel; final MyAppointmentsViewModel myAppointmentsViewModel; @@ -39,11 +41,12 @@ class MedicalFileAppointmentCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppCustomChipWidget( - richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false) - .toText12( - color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, - fontWeight: FontWeight.w500) - .paddingOnly(left: 8.w), + richText: Directionality( + textDirection: ui.TextDirection.ltr, + child: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false) + .toText12(color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, fontWeight: FontWeight.w500, isEnglishOnly: true) + .paddingSymmetrical(8.w, 0), + ), icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon, iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, iconSize: 16.w, @@ -71,9 +74,7 @@ class MedicalFileAppointmentCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - (patientAppointmentHistoryResponseModel.doctorNameObj ?? "") - .toText14(isBold: true, maxlines: 1) - .toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), + (patientAppointmentHistoryResponseModel.doctorNameObj ?? "").toText14(isBold: true, maxlines: 1).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), (patientAppointmentHistoryResponseModel.clinicName ?? "") .toText12(maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor) .toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), @@ -103,10 +104,8 @@ class MedicalFileAppointmentCard extends StatelessWidget { // widget.myAppointmentsViewModel.getPatientAppointments(true, false); }); }, - backgroundColor: - AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15), - borderColor: - AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), + backgroundColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15), + borderColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), fontSize: 14.f, fontWeight: FontWeight.w500, diff --git a/lib/presentation/vital_sign/vital_sign_details_page.dart b/lib/presentation/vital_sign/vital_sign_details_page.dart index 980357d..75b6ec9 100644 --- a/lib/presentation/vital_sign/vital_sign_details_page.dart +++ b/lib/presentation/vital_sign/vital_sign_details_page.dart @@ -148,6 +148,7 @@ class _VitalSignDetailsPageState extends State { isBold: true, color: scheme.iconFg, letterSpacing: -2, + isEnglishOnly: true ), ), SizedBox(width: 4.h), diff --git a/lib/presentation/vital_sign/vital_sign_page.dart b/lib/presentation/vital_sign/vital_sign_page.dart index 7d8ef38..af8f5ab 100644 --- a/lib/presentation/vital_sign/vital_sign_page.dart +++ b/lib/presentation/vital_sign/vital_sign_page.dart @@ -358,6 +358,7 @@ class _VitalSignPageState extends State { value.toText17( isBold: true, color: AppColors.textColor, + isEnglishOnly: true ), if (unit.isNotEmpty) ...[ SizedBox(width: 3.w), diff --git a/lib/widgets/bottomsheet/generic_bottom_sheet.dart b/lib/widgets/bottomsheet/generic_bottom_sheet.dart index b6be36c..fd79b7c 100644 --- a/lib/widgets/bottomsheet/generic_bottom_sheet.dart +++ b/lib/widgets/bottomsheet/generic_bottom_sheet.dart @@ -158,9 +158,10 @@ class GenericBottomSheetState extends State { prefix: widget.isForEmail ? null : widget.countryCode, isBorderAllowed: false, isAllowLeadingIcon: true, - fontSize: 13, + fontSize: 18.f, isCountryDropDown: widget.isEnableCountryDropdown, leadingIcon: widget.isForEmail ? AppAssets.email : AppAssets.smart_phone, + fontFamily: "Poppins", ) : SizedBox(), ], diff --git a/lib/widgets/dropdown/country_dropdown_widget.dart b/lib/widgets/dropdown/country_dropdown_widget.dart index b6191ed..1cd387f 100644 --- a/lib/widgets/dropdown/country_dropdown_widget.dart +++ b/lib/widgets/dropdown/country_dropdown_widget.dart @@ -100,7 +100,7 @@ class CustomCountryDropdownState extends State { children: [ Text( selectedCountry!.countryCode, - style: TextStyle(fontSize: 12.f, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5), + style: TextStyle(fontSize: 12.f, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5, fontFamily: "Poppins"), ), SizedBox(width: 4.h), if (widget.isEnableTextField) @@ -111,7 +111,7 @@ class CustomCountryDropdownState extends State { alignment: Alignment.centerLeft, child: TextField( focusNode: textFocusNode, - style: TextStyle(fontSize: 12.f, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5), + style: TextStyle(fontSize: 12.f, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5, fontFamily: "Poppins"), decoration: InputDecoration(hintText: "", isDense: true, border: InputBorder.none, contentPadding: EdgeInsets.zero), keyboardType: TextInputType.phone, onChanged: widget.onPhoneNumberChanged, diff --git a/lib/widgets/family_files/family_file_add_widget.dart b/lib/widgets/family_files/family_file_add_widget.dart index abc529b..cd20c5f 100644 --- a/lib/widgets/family_files/family_file_add_widget.dart +++ b/lib/widgets/family_files/family_file_add_widget.dart @@ -54,6 +54,7 @@ class FamilyFileAddWidget extends StatelessWidget { isAllowLeadingIcon: true, autoFocus: true, keyboardType: TextInputType.number, + fontFamily: "Poppins", padding: EdgeInsets.symmetric(vertical: 8.h), leadingIcon: AppAssets.student_card, ).paddingOnly(top: 8.h, bottom: 8.h), @@ -69,6 +70,7 @@ class FamilyFileAddWidget extends StatelessWidget { isAllowLeadingIcon: true, autoFocus: true, keyboardType: TextInputType.number, + fontFamily: "Poppins", padding: EdgeInsets.symmetric(vertical: 8.h), leadingIcon: AppAssets.smart_phone, ).paddingOnly(top: 8.h, bottom: 4.h), diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index 72cfdfc..aae196c 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hijri_gregorian_calendar/hijri_gregorian_calendar.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; @@ -11,6 +12,7 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/dropdown/country_dropdown_widget.dart'; import 'package:hmg_patient_app_new/widgets/time_picker_widget.dart'; +import 'dart:ui' as ui; class TextInputWidget extends StatelessWidget { final String labelText; @@ -48,6 +50,8 @@ class TextInputWidget extends StatelessWidget { final bool? isHideSwitcher; final bool? isArrowTrailing; + final String? fontFamily; + // final List countryList; // final Function(Country)? onCountryChange; @@ -86,6 +90,7 @@ class TextInputWidget extends StatelessWidget { this.maxLines = 6, this.isHideSwitcher, this.isArrowTrailing, + this.fontFamily, // this.countryList = const [], // this.onCountryChange, }); @@ -226,11 +231,8 @@ class TextInputWidget extends StatelessWidget { initialDate: DateTime.now(), showCalendarToggle: isHideSwitcher == true ? false : true, fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins", - okWidget: - Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.confirm, width: 24.h, height: 24.h)), - cancelWidget: Padding( - padding: EdgeInsets.only(right: 8.h), - child: Utils.buildSvgWithAssets(icon: AppAssets.cancel, iconColor: Colors.white, width: 24.h, height: 24.h)), + okWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.confirm, width: 24.h, height: 24.h)), + cancelWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.cancel, iconColor: Colors.white, width: 24.h, height: 24.h)), onCalendarTypeChanged: (bool value) { isGregorian = value; }); @@ -300,51 +302,103 @@ class TextInputWidget extends StatelessWidget { Widget _buildTextField(BuildContext context) { double fontS = fontSize ?? 14.f; - return TextField( - hintLocales: const [Locale('en', 'US')], - enabled: isEnable, - scrollPadding: EdgeInsets.zero, - keyboardType: isMultiline ? TextInputType.multiline : keyboardType, - controller: controller, - readOnly: isReadOnly, - textAlignVertical: TextAlignVertical.top, - textAlign: TextAlign.left, - textDirection: TextDirection.ltr, - onChanged: onChange, - focusNode: focusNode ?? _focusNode, - autofocus: autoFocus, - textInputAction: TextInputAction.done, - cursorHeight: isWalletAmountInput! ? 40.h : 20.h, - onTapOutside: (event) { - FocusManager.instance.primaryFocus?.unfocus(); + return Builder( + builder: (context) { + return Localizations.override( + context: context, + locale: const Locale('en', 'US'), // Force English locale for TextField + child: TextField( + hintLocales: const [Locale('en', 'US')], + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: isMultiline ? TextInputType.multiline : keyboardType, + controller: controller, + readOnly: isReadOnly, + textAlignVertical: TextAlignVertical.top, + textAlign: TextAlign.left, + textDirection: TextDirection.ltr, + onChanged: onChange, + focusNode: focusNode ?? _focusNode, + autofocus: autoFocus, + textInputAction: TextInputAction.done, + cursorHeight: isWalletAmountInput! ? 40.h : 20.h, + onTapOutside: (event) { + FocusManager.instance.primaryFocus?.unfocus(); + }, + onSubmitted: onSubmitted, + minLines: isMultiline ? minLines : 1, + maxLines: isMultiline ? maxLines : 1, + style: TextStyle( + fontSize: fontS, + height: isMultiline ? 1.2 : (isWalletAmountInput! ? 1 / 4 : 0), + fontWeight: FontWeight.w500, + color: AppColors.textColor, + letterSpacing: -1, + // fontFamily: keyboardType == TextInputType.number ? getIt.get().isArabic() ? 'GESSTwo' : 'Poppins' : 'Poppins', + fontFamily: fontFamily, + locale: const Locale('en', 'US'), // Force English locale for text style + ), + decoration: InputDecoration( + isDense: true, + hintText: hintText, + hintStyle: TextStyle(fontSize: 14.f, height: 21 / 16, fontWeight: FontWeight.w500, color: hintColor != null ? AppColors.textColor : Color(0xff898A8D), letterSpacing: -0.75), + prefixIconConstraints: BoxConstraints(minWidth: 30.h), + prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, weight: FontWeight.w500), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ); }, - onSubmitted: onSubmitted, - minLines: isMultiline ? minLines : 1, - maxLines: isMultiline ? maxLines : 1, - style: TextStyle( - fontSize: fontS, - height: isMultiline ? 1.2 : (isWalletAmountInput! ? 1 / 4 : 0), - fontWeight: FontWeight.w500, - color: AppColors.textColor, - letterSpacing: -1, - ), - decoration: InputDecoration( - isDense: true, - hintText: hintText, - hintStyle: TextStyle( - fontSize: 14.f, - height: 21 / 16, - fontWeight: FontWeight.w500, - color: hintColor != null ? AppColors.textColor : Color(0xff898A8D), - letterSpacing: -0.75), - prefixIconConstraints: BoxConstraints(minWidth: 30.h), - prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, weight: FontWeight.w500), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), ); + + // TextField( + // hintLocales: const [Locale('en', 'US')], + // enabled: isEnable, + // scrollPadding: EdgeInsets.zero, + // keyboardType: isMultiline ? TextInputType.multiline : keyboardType, + // controller: controller, + // readOnly: isReadOnly, + // textAlignVertical: TextAlignVertical.top, + // textAlign: TextAlign.left, + // textDirection: TextDirection.ltr, + // onChanged: onChange, + // focusNode: focusNode ?? _focusNode, + // autofocus: autoFocus, + // textInputAction: TextInputAction.done, + // cursorHeight: isWalletAmountInput! ? 40.h : 20.h, + // onTapOutside: (event) { + // FocusManager.instance.primaryFocus?.unfocus(); + // }, + // onSubmitted: onSubmitted, + // minLines: isMultiline ? minLines : 1, + // maxLines: isMultiline ? maxLines : 1, + // style: TextStyle( + // fontSize: fontS, + // height: isMultiline ? 1.2 : (isWalletAmountInput! ? 1 / 4 : 0), + // fontWeight: FontWeight.w500, + // color: AppColors.textColor, + // letterSpacing: -1, + // ), + // decoration: InputDecoration( + // isDense: true, + // hintText: hintText, + // hintStyle: TextStyle( + // fontSize: 14.f, + // height: 21 / 16, + // fontWeight: FontWeight.w500, + // color: hintColor != null ? AppColors.textColor : Color(0xff898A8D), + // letterSpacing: -0.75), + // prefixIconConstraints: BoxConstraints(minWidth: 30.h), + // prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, weight: FontWeight.w500), + // contentPadding: EdgeInsets.zero, + // border: InputBorder.none, + // focusedBorder: InputBorder.none, + // enabledBorder: InputBorder.none, + // ), + // ); } _buildTrailingIconForSearch(BuildContext context) {