pull/219/head
Sultan khan 4 months ago
parent acff5d220c
commit a5f7bd80b2

@ -45,12 +45,15 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.summary != null && analysis.summary!.isNotEmpty) {
expandableItems.add(
ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.summary.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
initiallyExpanded: true,
children: [
SizedBox(height: 10.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFF0B85F7))),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFF0B85F7))),
padding: EdgeInsets.all(16.r),
child: (analysis.summary ?? "").toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400),
),
@ -64,6 +67,9 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.aiGeneratedAttributes != null && analysis.aiGeneratedAttributes!.isNotEmpty) {
expandableItems.add(
ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.labResults.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [
SizedBox(height: 10.h),
@ -84,11 +90,13 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.aiPredictions != null && analysis.aiPredictions!.isNotEmpty) {
expandableItems.add(
ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.prediction.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [
SizedBox(height: 10.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFFFFAF15))),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, side: BorderSide(width: 1, color: Color(0xFFFFAF15))),
padding: EdgeInsets.all(16.r),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -105,12 +113,13 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.aiRecommendations != null && analysis.aiRecommendations!.isNotEmpty) {
expandableItems.add(
ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.suggestions.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [
SizedBox(height: 10.h),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent
, borderRadius: 12.r),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r),
padding: EdgeInsets.all(16.r),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -153,6 +162,8 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.riskFactors != null && analysis.riskFactors!.isNotEmpty) {
expandableItems.add(
ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.riskFactors.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [
SizedBox(height: 10.h),
@ -222,6 +233,8 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.prevention != null && analysis.prevention!.isNotEmpty) {
expandableItems.add(
ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.prevention.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [
SizedBox(height: 10.h),
@ -309,10 +322,11 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
else
CustomExpandableList(
expansionMode: ExpansionMode.exactlyOne,
dividerColor: Color(0xff2b353e1a),
dividerColor: AppColors.dividerColor,
itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h),
items: expandableItems,
theme: ExpandableListTheme.custom(
defaultTrailingIcon: Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w, iconColor: AppColors.textColor),
),
).paddingSymmetrical(16.w, 0.0),

@ -12,7 +12,6 @@ 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;
@ -295,9 +294,13 @@ class TextInputWidget extends StatelessWidget {
Widget _buildTextField(BuildContext context) {
double fontS = fontSize ?? 14.f;
final isArabic = getIt.get<AppState>().isArabic();
return Builder(
builder: (context) {
return Localizations.override(
return Directionality(
textDirection: isArabic ? TextDirection.rtl : TextDirection.ltr,
child: Localizations.override(
context: context,
locale: const Locale('en', 'US'), // Force English locale for TextField
child: TextField(
@ -308,7 +311,7 @@ class TextInputWidget extends StatelessWidget {
controller: controller,
readOnly: isReadOnly,
textAlignVertical: TextAlignVertical.top,
textAlign: TextAlign.left,
textAlign: isArabic ? TextAlign.right : TextAlign.left,
textDirection: TextDirection.ltr,
onChanged: onChange,
focusNode: focusNode ?? _focusNode,
@ -333,7 +336,6 @@ class TextInputWidget extends StatelessWidget {
fontWeight: FontWeight.w600,
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
),
@ -341,7 +343,14 @@ class TextInputWidget extends StatelessWidget {
counterText: "",
isDense: true,
hintText: hintText,
hintStyle: TextStyle(fontSize: 14.f, height: 21 / 16, fontWeight: FontWeight.w600, color: hintColor != null ? AppColors.textColor : Color(0xff898A8D), letterSpacing: -0.75),
hintStyle: TextStyle(
fontFamily: isArabic ? 'CairoArabic' : 'Poppins',
fontSize: 14.f,
height: 21 / 16,
fontWeight: FontWeight.w600,
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, isBold: true),
contentPadding: EdgeInsets.zero,
@ -350,6 +359,7 @@ class TextInputWidget extends StatelessWidget {
enabledBorder: InputBorder.none,
),
),
),
);
},
);

Loading…
Cancel
Save