arabic fixes

pull/184/head
Haroon Amjad 2 months ago
parent 4ce1e912ce
commit a4573c8710

@ -110,7 +110,7 @@ class DateUtil {
} }
static String formatDateToTime(DateTime date) { 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) { static String yearMonthDay(DateTime dateTime) {

@ -987,4 +987,17 @@ class Utils {
return isAllowed; 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;
}
} }

@ -23,8 +23,7 @@ extension CapExtension on String {
extension EmailValidator on String { extension EmailValidator on String {
Widget get toWidget => Text(this); Widget get toWidget => Text(this);
Widget toText8({Color? color, FontWeight? fontWeight, bool isBold = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => Widget toText8({Color? color, FontWeight? fontWeight, bool isBold = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => Text(
Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
overflow: textOverflow, overflow: textOverflow,
@ -38,7 +37,8 @@ extension EmailValidator on String {
); );
Widget toText10( Widget toText10(
{Color? color, {bool isEnglishOnly = false,
Color? color,
FontWeight? weight, FontWeight? weight,
bool isBold = false, bool isBold = false,
bool isUnderLine = false, bool isUnderLine = false,
@ -59,19 +59,20 @@ extension EmailValidator on String {
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
decoration: isUnderLine ? TextDecoration.underline : null, decoration: isUnderLine ? TextDecoration.underline : null,
fontFamily: isEnglishOnly ? "Poppins" : getIt.get<AppState>().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins',
decorationColor: color ?? AppColors.blackColor), decorationColor: color ?? AppColors.blackColor),
); );
Widget toText9( Widget toText9(
{Color? color, {Color? color,
FontWeight? weight, FontWeight? weight,
bool isBold = false, bool isBold = false,
bool isUnderLine = false, bool isUnderLine = false,
bool isCenter = false, bool isCenter = false,
int? maxlines, int? maxlines,
FontStyle? fontStyle, FontStyle? fontStyle,
TextOverflow? textOverflow, TextOverflow? textOverflow,
double letterSpacing = 0}) => double letterSpacing = 0}) =>
Text( Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
@ -87,15 +88,7 @@ extension EmailValidator on String {
decorationColor: color ?? AppColors.blackColor), decorationColor: color ?? AppColors.blackColor),
); );
Widget toText11( Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isCenter = false, bool isBold = false, int maxLine = 0, double letterSpacing = 0}) => Text(
{Color? color,
FontWeight? weight,
bool isUnderLine = false,
bool isCenter = false,
bool isBold = false,
int maxLine = 0,
double letterSpacing = 0}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
@ -110,7 +103,7 @@ extension EmailValidator on String {
); );
Widget toText12( Widget toText12(
{Color? color, {bool isEnglishOnly = false, Color? color,
bool isUnderLine = false, bool isUnderLine = false,
TextAlign textAlignment = TextAlign.start, TextAlign textAlignment = TextAlign.start,
bool isBold = false, bool isBold = false,
@ -131,6 +124,7 @@ extension EmailValidator on String {
height: height, height: height,
decorationColor: isUnderLine ? AppColors.blackColor : null, decorationColor: isUnderLine ? AppColors.blackColor : null,
decoration: isUnderLine ? TextDecoration.underline : null, decoration: isUnderLine ? TextDecoration.underline : null,
fontFamily: isEnglishOnly ? "Poppins" : getIt.get<AppState>().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins',
), ),
); );
@ -176,15 +170,7 @@ extension EmailValidator on String {
), ),
); );
Widget toText13( Widget toText13({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0, FontWeight? weight, double? letterSpacing = 0}) => Text(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0,
FontWeight? weight,
double? letterSpacing = 0}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
@ -197,6 +183,7 @@ extension EmailValidator on String {
); );
Widget toText14({ Widget toText14({
bool isEnglishOnly = false,
Color? color, Color? color,
bool isUnderLine = false, bool isUnderLine = false,
bool isBold = false, bool isBold = false,
@ -219,18 +206,11 @@ extension EmailValidator on String {
height: height, height: height,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
decoration: isUnderLine ? TextDecoration.underline : null, decoration: isUnderLine ? TextDecoration.underline : null,
fontFamily: isEnglishOnly ? "Poppins" : getIt.get<AppState>().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins',
decorationColor: color ?? AppColors.blackColor), decorationColor: color ?? AppColors.blackColor),
); );
Widget toText15( Widget toText15({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, FontWeight? weight, int? maxlines, double? letterSpacing = -1}) => Text(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
FontWeight? weight,
int? maxlines,
double? letterSpacing = -1}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: maxlines, maxLines: maxlines,
@ -270,11 +250,10 @@ extension EmailValidator on String {
decorationColor: decorationColor), 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, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 17.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, fontFamily: isEnglishOnly ? "Poppins" : getIt.get<AppState>().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'),
color: color ?? AppColors.blackColor, fontSize: 17.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText18({Color? color, FontWeight? weight, bool isBold = false, bool isCenter = false, int? maxlines, TextOverflow? textOverflow}) => Text( 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, textAlign: isCenter ? TextAlign.center : null,
this, this,
overflow: textOverflow, overflow: textOverflow,
style: TextStyle( style: TextStyle(fontSize: 18.f, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4),
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( Widget toText19({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(fontSize: 19.f, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4),
fontSize: 19.f, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4),
); );
Widget toText20({ Widget toText20({
@ -302,86 +276,51 @@ extension EmailValidator on String {
}) => }) =>
Text( Text(
this, this,
style: TextStyle( style: TextStyle(fontSize: 20.f, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4),
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( Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
style: TextStyle( style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 21.f, letterSpacing: -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
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( Widget toText22({Color? color, bool isBold = false, bool isCenter = false}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(height: 1, color: color ?? AppColors.blackColor, fontSize: 22.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
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( Widget toText24({Color? color, bool isBold = false, bool isCenter = false, FontWeight? fontWeight, double? letterSpacing}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(
height: 23 / 24, height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal),
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( Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(
height: height ?? 23 / 26, height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.f, letterSpacing: letterSpacing ?? -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
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, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( 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<AppState>().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'),
height: height ?? 23 / 28,
color: color ?? AppColors.blackColor,
fontSize: 28.f,
letterSpacing: letterSpacing ?? -1,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText32({FontWeight? weight, Color? color, bool isBold = false, bool isCenter = false}) => Text( Widget toText32({FontWeight? weight, Color? color, bool isBold = false, bool isCenter = false}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(
height: 32 / 32, height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 32.f, letterSpacing: -1, fontFamily: "Poppins", fontWeight: isBold ? FontWeight.bold : weight ?? FontWeight.normal),
color: color ?? AppColors.blackColor,
fontSize: 32.f,
letterSpacing: -1,
fontWeight: isBold ? FontWeight.bold : weight ?? FontWeight.normal),
); );
Widget toText44({Color? color, bool isBold = false}) => Text( Widget toText44({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle( style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 44.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
height: 32 / 32,
color: color ?? AppColors.blackColor,
fontSize: 44.f,
letterSpacing: -1,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) { Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
@ -417,9 +356,7 @@ extension EmailValidator on String {
} }
bool isValidEmail() { bool isValidEmail() {
return RegExp( 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);
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() { String toFormattedDate() {

@ -75,6 +75,8 @@ class AuthenticationViewModel extends ChangeNotifier {
dobController = TextEditingController(), dobController = TextEditingController(),
nameController = TextEditingController(), nameController = TextEditingController(),
emailController = TextEditingController(); emailController = TextEditingController();
CountryEnum selectedCountrySignup = CountryEnum.saudiArabia; CountryEnum selectedCountrySignup = CountryEnum.saudiArabia;
MaritalStatusTypeEnum? maritalStatus; MaritalStatusTypeEnum? maritalStatus;
GenderTypeEnum? genderType; GenderTypeEnum? genderType;

@ -228,7 +228,7 @@ class MyApp extends StatelessWidget {
return MaterialApp( return MaterialApp(
title: 'Dr. AlHabib', title: 'Dr. AlHabib',
builder: (context, mchild) { 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, showSemanticsDebugger: false,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,

@ -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/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.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 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'dart:ui' as ui;
class AppointmentCard extends StatelessWidget { class AppointmentCard extends StatelessWidget {
final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel; final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel;
@ -39,20 +40,20 @@ class AppointmentCard extends StatelessWidget {
final ContactUsViewModel? contactUsViewModel; final ContactUsViewModel? contactUsViewModel;
final BookAppointmentsViewModel bookAppointmentsViewModel; final BookAppointmentsViewModel bookAppointmentsViewModel;
final bool isForRate; final bool isForRate;
const AppointmentCard({
super.key, const AppointmentCard(
required this.patientAppointmentHistoryResponseModel, {super.key,
required this.myAppointmentsViewModel, required this.patientAppointmentHistoryResponseModel,
required this.bookAppointmentsViewModel, required this.myAppointmentsViewModel,
this.isLoading = false, required this.bookAppointmentsViewModel,
this.isFromHomePage = false, this.isLoading = false,
this.isFromMedicalReport = false, this.isFromHomePage = false,
this.isForEyeMeasurements = false, this.isFromMedicalReport = false,
this.isForFeedback = false, this.isForEyeMeasurements = false,
this.medicalFileViewModel, this.isForFeedback = false,
this.contactUsViewModel, this.medicalFileViewModel,
this.isForRate =false this.contactUsViewModel,
}); this.isForRate = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -64,11 +65,11 @@ class AppointmentCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
isForRate ? SizedBox(): _buildHeader(context, appState), isForRate ? SizedBox() : _buildHeader(context, appState),
SizedBox(height: 16.h), SizedBox(height: 16.h),
_buildDoctorRow(context), _buildDoctorRow(context),
SizedBox(height: 16.h), 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), textColor: isLoading ? AppColors.textColor : (isLiveCare ? AppColors.whiteColor : AppColors.textColor),
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
AppCustomChipWidget( AppCustomChipWidget(
labelText: isLoading labelText:
? 'OutPatient' isLoading ? 'OutPatient' : (appState.isArabic() ? patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN! : patientAppointmentHistoryResponseModel.isInOutPatientDescription!),
: (appState.isArabic()
? patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN!
: patientAppointmentHistoryResponseModel.isInOutPatientDescription!),
backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.1), backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.1),
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
AppCustomChipWidget( AppCustomChipWidget(
labelText: isLoading labelText: isLoading ? 'Booked' : AppointmentType.getAppointmentStatusType(patientAppointmentHistoryResponseModel.patientStatusType!),
? 'Booked'
: AppointmentType.getAppointmentStatusType(patientAppointmentHistoryResponseModel.patientStatusType!),
backgroundColor: AppColors.successColor.withValues(alpha: 0.1), backgroundColor: AppColors.successColor.withValues(alpha: 0.1),
textColor: AppColors.successColor, textColor: AppColors.successColor,
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
@ -188,13 +184,17 @@ class AppointmentCard extends StatelessWidget {
? '${(patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").substring(0, 15)}...' ? '${(patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").substring(0, 15)}...'
: patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital") : patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital")
.toShimmer2(isShow: isLoading), .toShimmer2(isShow: isLoading),
AppCustomChipWidget( Directionality(
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), textDirection: ui.TextDirection.ltr,
icon: AppAssets.appointment_calendar_icon, child: AppCustomChipWidget(
labelText: isLoading labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
? 'Cardiology' icon: AppAssets.appointment_calendar_icon,
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}", richText: isLoading
).toShimmer2(isShow: isLoading), ? 'Cardiology'.toText10().toShimmer2(isShow: isLoading)
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}"
.toText10(isEnglishOnly: true),
),
),
// AppCustomChipWidget( // AppCustomChipWidget(
// labelPadding: EdgeInsetsDirectional.only(start: -2.w, end: 6.w), // labelPadding: EdgeInsetsDirectional.only(start: -2.w, end: 6.w),

@ -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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.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 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'dart:ui' as ui;
class AppointmentDoctorCard extends StatelessWidget { class AppointmentDoctorCard extends StatelessWidget {
const AppointmentDoctorCard( const AppointmentDoctorCard(
@ -98,13 +99,16 @@ class AppointmentDoctorCard extends StatelessWidget {
labelText: patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital", labelText: patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital",
labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w),
), ),
AppCustomChipWidget( Directionality(
labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w), textDirection: ui.TextDirection.ltr,
icon: AppAssets.doctor_calendar_icon, child: AppCustomChipWidget(
labelText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang( labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w),
DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), icon: AppAssets.doctor_calendar_icon,
false, richText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(
)}", DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate),
false,
)}".toText10(isEnglishOnly: true),
),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w),

@ -90,6 +90,7 @@ class LoginScreenState extends State<LoginScreen> {
leadingIcon: AppAssets.student_card, leadingIcon: AppAssets.student_card,
errorMessage: LocaleKeys.enterValidIDorIqama.tr(context: context), errorMessage: LocaleKeys.enterValidIDorIqama.tr(context: context),
hasError: false, hasError: false,
fontFamily: "Poppins",
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
CustomButton( CustomButton(

@ -100,6 +100,7 @@ class _RegisterNew extends State<RegisterNew> {
hintText: "xxxxxxxxx", hintText: "xxxxxxxxx",
controller: authVm.nationalIdController, controller: authVm.nationalIdController,
focusNode: _nationalIdFocusNode, focusNode: _nationalIdFocusNode,
keyboardType: TextInputType.number,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
isAllowRadius: true, isAllowRadius: true,
@ -108,6 +109,7 @@ class _RegisterNew extends State<RegisterNew> {
autoFocus: true, autoFocus: true,
padding: EdgeInsets.symmetric(vertical: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h),
leadingIcon: AppAssets.student_card, leadingIcon: AppAssets.student_card,
fontFamily: "Poppins",
).withVerticalPadding(8), ).withVerticalPadding(8),
Divider(height: 1), Divider(height: 1),
TextInputWidget( TextInputWidget(
@ -125,6 +127,7 @@ class _RegisterNew extends State<RegisterNew> {
selectionType: SelectionTypeEnum.calendar, selectionType: SelectionTypeEnum.calendar,
onCalendarTypeChanged: authVm.onCalenderTypeChange, onCalendarTypeChanged: authVm.onCalenderTypeChange,
onChange: authVm.onDobChange, onChange: authVm.onDobChange,
fontFamily: "Poppins",
).withVerticalPadding(8), ).withVerticalPadding(8),
], ],
), ),

@ -185,7 +185,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
children: [ children: [
LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true),
Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.amount!.toText16(isBold: true), AppColors.blackColor, 13, 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), ).paddingSymmetrical(24.h, 0.h),
Row( Row(
@ -194,7 +194,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
Utils.getPaymentAmountWithSymbol( Utils.getPaymentAmountWithSymbol(
immediateLiveCareVM.liveCareImmediateAppointmentFeesList.tax!.toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13, 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), ).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 17.h), SizedBox(height: 17.h),
@ -203,7 +203,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget {
children: [ children: [
SizedBox(width: 150.h, child: Utils.getPaymentMethods()), SizedBox(width: 150.h, child: Utils.getPaymentMethods()),
Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true), AppColors.blackColor, 17, 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), ).paddingSymmetrical(24.h, 0.h),
(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0") (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total == "0.0")

@ -38,7 +38,7 @@ class DoctorCard extends StatelessWidget {
hasShadow: false, hasShadow: false,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.only(top: 14.h,bottom: 20.h), padding: EdgeInsets.only(top: 14.h, bottom: 20.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -91,9 +91,7 @@ class DoctorCard extends StatelessWidget {
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: (isLoading ? "Dr John Smith" : "${doctorsListResponseModel.doctorTitle} ${doctorsListResponseModel.name}") child: (isLoading ? "Dr John Smith" : "${doctorsListResponseModel.doctorTitle} ${doctorsListResponseModel.name}").toString().toText16(isBold: true, maxlines: 1),
.toString()
.toText16(isBold: true, maxlines: 1),
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
], ],
), ),
@ -135,12 +133,14 @@ class DoctorCard extends StatelessWidget {
).toShimmer2(isShow: isLoading), ).toShimmer2(isShow: isLoading),
bookAppointmentsViewModel.isNearestAppointmentSelected bookAppointmentsViewModel.isNearestAppointmentSelected
? doctorsListResponseModel.nearestFreeSlot != null ? doctorsListResponseModel.nearestFreeSlot != null
? AppCustomChipWidget( ? AppCustomChipWidget(
labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), // labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)),
backgroundColor: AppColors.successColor, richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot))
textColor: AppColors.whiteColor, .toText10(isEnglishOnly: true, color: AppColors.whiteColor),
).toShimmer2(isShow: isLoading) backgroundColor: AppColors.successColor,
: SizedBox.shrink() textColor: AppColors.whiteColor,
).toShimmer2(isShow: isLoading)
: SizedBox.shrink()
: SizedBox.shrink(), : SizedBox.shrink(),
], ],
), ),
@ -149,8 +149,7 @@ class DoctorCard extends StatelessWidget {
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown) child: Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown).toShimmer2(isShow: isLoading),
.toShimmer2(isShow: isLoading),
), ),
], ],
), ),

@ -140,6 +140,7 @@ class PatientInformationStepState extends State<PatientInformationStep> {
controller: _phoneController, controller: _phoneController,
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins",
onChange: (value) { onChange: (value) {
formManager.updatePatientPhone(value ?? ''); formManager.updatePatientPhone(value ?? '');
}, },

@ -73,6 +73,7 @@ class SearchEReferralFormFormState extends State<SearchEReferralFormForm> {
hintText: formManager.searchCriteria == 0 ? "Enter Identification Number" : "Enter Referral Number", hintText: formManager.searchCriteria == 0 ? "Enter Identification Number" : "Enter Referral Number",
labelText: formManager.searchCriteria == 0 ? "Identification Number" : "Referral Number", labelText: formManager.searchCriteria == 0 ? "Identification Number" : "Referral Number",
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins",
errorMessage: formManager.errors.searchValue, errorMessage: formManager.errors.searchValue,
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.searchValue), hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.searchValue),
onChange: (value) { onChange: (value) {
@ -94,6 +95,7 @@ class SearchEReferralFormFormState extends State<SearchEReferralFormForm> {
controller: _phoneController, controller: _phoneController,
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins",
onChange: (value) { onChange: (value) {
formManager.updateSearchPhone(value ?? ''); formManager.updateSearchPhone(value ?? '');
// _validateForm(formManager); // _validateForm(formManager);

@ -98,11 +98,12 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
autoFocus: true, autoFocus: true,
fontSize: 40, fontSize: 40.f,
padding: EdgeInsets.symmetric(horizontal: 8.h, vertical: 0.h), padding: EdgeInsets.symmetric(horizontal: 8.h, vertical: 0.h),
focusNode: textFocusNode, focusNode: textFocusNode,
isWalletAmountInput: true, isWalletAmountInput: true,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
fontFamily: "Poppins",
// leadingIcon: AppAssets.student_card, // leadingIcon: AppAssets.student_card,
), ),
), ),
@ -217,12 +218,11 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
autoFocus: true, autoFocus: false,
isAllowRadius: true, isAllowRadius: true,
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
leadingIcon: AppAssets.notes_icon, leadingIcon: AppAssets.notes_icon,
errorMessage: LocaleKeys.enterValidIDorIqama.tr(context: context),
hasError: false, hasError: false,
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),

@ -75,10 +75,11 @@ class PatientInsuranceCard extends StatelessWidget {
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.doctor_calendar_icon, 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), 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), SizedBox(height: 10.h),

@ -250,7 +250,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.file_icon, 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), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
), ),
AppCustomChipWidget( AppCustomChipWidget(
@ -1602,6 +1602,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: value.toText17( child: value.toText17(
isBold: true, isBold: true,
color: AppColors.textColor, color: AppColors.textColor,
isEnglishOnly: true
), ),
), ),
if (unit.isNotEmpty) ...[ if (unit.isNotEmpty) ...[

@ -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/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'dart:ui' as ui;
class MedicalFileAppointmentCard extends StatelessWidget { class MedicalFileAppointmentCard extends StatelessWidget {
final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel; final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel;
final MyAppointmentsViewModel myAppointmentsViewModel; final MyAppointmentsViewModel myAppointmentsViewModel;
@ -39,11 +41,12 @@ class MedicalFileAppointmentCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false) richText: Directionality(
.toText12( textDirection: ui.TextDirection.ltr,
color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, child: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)
fontWeight: FontWeight.w500) .toText12(color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, fontWeight: FontWeight.w500, isEnglishOnly: true)
.paddingOnly(left: 8.w), .paddingSymmetrical(8.w, 0),
),
icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon, icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon,
iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
iconSize: 16.w, iconSize: 16.w,
@ -71,9 +74,7 @@ class MedicalFileAppointmentCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(patientAppointmentHistoryResponseModel.doctorNameObj ?? "") (patientAppointmentHistoryResponseModel.doctorNameObj ?? "").toText14(isBold: true, maxlines: 1).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
.toText14(isBold: true, maxlines: 1)
.toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
(patientAppointmentHistoryResponseModel.clinicName ?? "") (patientAppointmentHistoryResponseModel.clinicName ?? "")
.toText12(maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor) .toText12(maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor)
.toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), .toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
@ -103,10 +104,8 @@ class MedicalFileAppointmentCard extends StatelessWidget {
// widget.myAppointmentsViewModel.getPatientAppointments(true, false); // widget.myAppointmentsViewModel.getPatientAppointments(true, false);
}); });
}, },
backgroundColor: backgroundColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15),
AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15), borderColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
borderColor:
AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction),
fontSize: 14.f, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,

@ -148,6 +148,7 @@ class _VitalSignDetailsPageState extends State<VitalSignDetailsPage> {
isBold: true, isBold: true,
color: scheme.iconFg, color: scheme.iconFg,
letterSpacing: -2, letterSpacing: -2,
isEnglishOnly: true
), ),
), ),
SizedBox(width: 4.h), SizedBox(width: 4.h),

@ -358,6 +358,7 @@ class _VitalSignPageState extends State<VitalSignPage> {
value.toText17( value.toText17(
isBold: true, isBold: true,
color: AppColors.textColor, color: AppColors.textColor,
isEnglishOnly: true
), ),
if (unit.isNotEmpty) ...[ if (unit.isNotEmpty) ...[
SizedBox(width: 3.w), SizedBox(width: 3.w),

@ -158,9 +158,10 @@ class GenericBottomSheetState extends State<GenericBottomSheet> {
prefix: widget.isForEmail ? null : widget.countryCode, prefix: widget.isForEmail ? null : widget.countryCode,
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
fontSize: 13, fontSize: 18.f,
isCountryDropDown: widget.isEnableCountryDropdown, isCountryDropDown: widget.isEnableCountryDropdown,
leadingIcon: widget.isForEmail ? AppAssets.email : AppAssets.smart_phone, leadingIcon: widget.isForEmail ? AppAssets.email : AppAssets.smart_phone,
fontFamily: "Poppins",
) )
: SizedBox(), : SizedBox(),
], ],

@ -100,7 +100,7 @@ class CustomCountryDropdownState extends State<CustomCountryDropdown> {
children: [ children: [
Text( Text(
selectedCountry!.countryCode, 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), SizedBox(width: 4.h),
if (widget.isEnableTextField) if (widget.isEnableTextField)
@ -111,7 +111,7 @@ class CustomCountryDropdownState extends State<CustomCountryDropdown> {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: TextField( child: TextField(
focusNode: textFocusNode, 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), decoration: InputDecoration(hintText: "", isDense: true, border: InputBorder.none, contentPadding: EdgeInsets.zero),
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
onChanged: widget.onPhoneNumberChanged, onChanged: widget.onPhoneNumberChanged,

@ -54,6 +54,7 @@ class FamilyFileAddWidget extends StatelessWidget {
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
autoFocus: true, autoFocus: true,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins",
padding: EdgeInsets.symmetric(vertical: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h),
leadingIcon: AppAssets.student_card, leadingIcon: AppAssets.student_card,
).paddingOnly(top: 8.h, bottom: 8.h), ).paddingOnly(top: 8.h, bottom: 8.h),
@ -69,6 +70,7 @@ class FamilyFileAddWidget extends StatelessWidget {
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
autoFocus: true, autoFocus: true,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins",
padding: EdgeInsets.symmetric(vertical: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h),
leadingIcon: AppAssets.smart_phone, leadingIcon: AppAssets.smart_phone,
).paddingOnly(top: 8.h, bottom: 4.h), ).paddingOnly(top: 8.h, bottom: 4.h),

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hijri_gregorian_calendar/hijri_gregorian_calendar.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_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/dropdown/country_dropdown_widget.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 'package:hmg_patient_app_new/widgets/time_picker_widget.dart';
import 'dart:ui' as ui;
class TextInputWidget extends StatelessWidget { class TextInputWidget extends StatelessWidget {
final String labelText; final String labelText;
@ -48,6 +50,8 @@ class TextInputWidget extends StatelessWidget {
final bool? isHideSwitcher; final bool? isHideSwitcher;
final bool? isArrowTrailing; final bool? isArrowTrailing;
final String? fontFamily;
// final List<Country> countryList; // final List<Country> countryList;
// final Function(Country)? onCountryChange; // final Function(Country)? onCountryChange;
@ -86,6 +90,7 @@ class TextInputWidget extends StatelessWidget {
this.maxLines = 6, this.maxLines = 6,
this.isHideSwitcher, this.isHideSwitcher,
this.isArrowTrailing, this.isArrowTrailing,
this.fontFamily,
// this.countryList = const [], // this.countryList = const [],
// this.onCountryChange, // this.onCountryChange,
}); });
@ -226,11 +231,8 @@ class TextInputWidget extends StatelessWidget {
initialDate: DateTime.now(), initialDate: DateTime.now(),
showCalendarToggle: isHideSwitcher == true ? false : true, showCalendarToggle: isHideSwitcher == true ? false : true,
fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins", fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins",
okWidget: okWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.confirm, width: 24.h, height: 24.h)),
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)),
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) { onCalendarTypeChanged: (bool value) {
isGregorian = value; isGregorian = value;
}); });
@ -300,51 +302,103 @@ class TextInputWidget extends StatelessWidget {
Widget _buildTextField(BuildContext context) { Widget _buildTextField(BuildContext context) {
double fontS = fontSize ?? 14.f; double fontS = fontSize ?? 14.f;
return TextField( return Builder(
hintLocales: const [Locale('en', 'US')], builder: (context) {
enabled: isEnable, return Localizations.override(
scrollPadding: EdgeInsets.zero, context: context,
keyboardType: isMultiline ? TextInputType.multiline : keyboardType, locale: const Locale('en', 'US'), // Force English locale for TextField
controller: controller, child: TextField(
readOnly: isReadOnly, hintLocales: const [Locale('en', 'US')],
textAlignVertical: TextAlignVertical.top, enabled: isEnable,
textAlign: TextAlign.left, scrollPadding: EdgeInsets.zero,
textDirection: TextDirection.ltr, keyboardType: isMultiline ? TextInputType.multiline : keyboardType,
onChanged: onChange, controller: controller,
focusNode: focusNode ?? _focusNode, readOnly: isReadOnly,
autofocus: autoFocus, textAlignVertical: TextAlignVertical.top,
textInputAction: TextInputAction.done, textAlign: TextAlign.left,
cursorHeight: isWalletAmountInput! ? 40.h : 20.h, textDirection: TextDirection.ltr,
onTapOutside: (event) { onChanged: onChange,
FocusManager.instance.primaryFocus?.unfocus(); 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<AppState>().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) { _buildTrailingIconForSearch(BuildContext context) {

Loading…
Cancel
Save