pull/219/head
Sultan khan 1 month ago
parent acff5d220c
commit a5f7bd80b2

@ -45,12 +45,15 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.summary != null && analysis.summary!.isNotEmpty) { if (analysis.summary != null && analysis.summary!.isNotEmpty) {
expandableItems.add( expandableItems.add(
ExpandableListItem( ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.summary.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor), title: LocaleKeys.summary.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
initiallyExpanded: true, initiallyExpanded: true,
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
Container( 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), padding: EdgeInsets.all(16.r),
child: (analysis.summary ?? "").toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400), 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) { if (analysis.aiGeneratedAttributes != null && analysis.aiGeneratedAttributes!.isNotEmpty) {
expandableItems.add( expandableItems.add(
ExpandableListItem( ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.labResults.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor), title: LocaleKeys.labResults.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
@ -84,11 +90,13 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.aiPredictions != null && analysis.aiPredictions!.isNotEmpty) { if (analysis.aiPredictions != null && analysis.aiPredictions!.isNotEmpty) {
expandableItems.add( expandableItems.add(
ExpandableListItem( ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.prediction.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor), title: LocaleKeys.prediction.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
Container( 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), padding: EdgeInsets.all(16.r),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -105,12 +113,13 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.aiRecommendations != null && analysis.aiRecommendations!.isNotEmpty) { if (analysis.aiRecommendations != null && analysis.aiRecommendations!.isNotEmpty) {
expandableItems.add( expandableItems.add(
ExpandableListItem( ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.suggestions.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor), title: LocaleKeys.suggestions.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
Container( Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r),
, borderRadius: 12.r),
padding: EdgeInsets.all(16.r), padding: EdgeInsets.all(16.r),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -153,6 +162,8 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.riskFactors != null && analysis.riskFactors!.isNotEmpty) { if (analysis.riskFactors != null && analysis.riskFactors!.isNotEmpty) {
expandableItems.add( expandableItems.add(
ExpandableListItem( ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.riskFactors.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor), title: LocaleKeys.riskFactors.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
@ -222,6 +233,8 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
if (analysis.prevention != null && analysis.prevention!.isNotEmpty) { if (analysis.prevention != null && analysis.prevention!.isNotEmpty) {
expandableItems.add( expandableItems.add(
ExpandableListItem( ExpandableListItem(
backgroundColor: Colors.transparent,
expandedBackgroundColor:Colors.transparent ,
title: LocaleKeys.prevention.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor), title: LocaleKeys.prevention.tr(context: context).toText18(weight: FontWeight.w700, color: AppColors.blackColor),
children: [ children: [
SizedBox(height: 10.h), SizedBox(height: 10.h),
@ -309,10 +322,11 @@ class _LabAiAnalysisDetailedPageState extends State<LabAiAnalysisDetailedPage> {
else else
CustomExpandableList( CustomExpandableList(
expansionMode: ExpansionMode.exactlyOne, expansionMode: ExpansionMode.exactlyOne,
dividerColor: Color(0xff2b353e1a), dividerColor: AppColors.dividerColor,
itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h), itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h),
items: expandableItems, items: expandableItems,
theme: ExpandableListTheme.custom( theme: ExpandableListTheme.custom(
defaultTrailingIcon: Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w, iconColor: AppColors.textColor), defaultTrailingIcon: Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w, iconColor: AppColors.textColor),
), ),
).paddingSymmetrical(16.w, 0.0), ).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/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;
@ -295,9 +294,13 @@ class TextInputWidget extends StatelessWidget {
Widget _buildTextField(BuildContext context) { Widget _buildTextField(BuildContext context) {
double fontS = fontSize ?? 14.f; double fontS = fontSize ?? 14.f;
final isArabic = getIt.get<AppState>().isArabic();
return Builder( return Builder(
builder: (context) { builder: (context) {
return Localizations.override( return Directionality(
textDirection: isArabic ? TextDirection.rtl : TextDirection.ltr,
child: Localizations.override(
context: context, context: context,
locale: const Locale('en', 'US'), // Force English locale for TextField locale: const Locale('en', 'US'), // Force English locale for TextField
child: TextField( child: TextField(
@ -308,7 +311,7 @@ class TextInputWidget extends StatelessWidget {
controller: controller, controller: controller,
readOnly: isReadOnly, readOnly: isReadOnly,
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
textAlign: TextAlign.left, textAlign: isArabic ? TextAlign.right : TextAlign.left,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
onChanged: onChange, onChanged: onChange,
focusNode: focusNode ?? _focusNode, focusNode: focusNode ?? _focusNode,
@ -333,7 +336,6 @@ class TextInputWidget extends StatelessWidget {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
letterSpacing: -1, letterSpacing: -1,
// fontFamily: keyboardType == TextInputType.number ? getIt.get<AppState>().isArabic() ? 'GESSTwo' : 'Poppins' : 'Poppins',
fontFamily: fontFamily, fontFamily: fontFamily,
locale: const Locale('en', 'US'), // Force English locale for text style locale: const Locale('en', 'US'), // Force English locale for text style
), ),
@ -341,7 +343,14 @@ class TextInputWidget extends StatelessWidget {
counterText: "", counterText: "",
isDense: true, isDense: true,
hintText: hintText, 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), prefixIconConstraints: BoxConstraints(minWidth: 30.h),
prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, isBold: true), prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, isBold: true),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
@ -350,6 +359,7 @@ class TextInputWidget extends StatelessWidget {
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
), ),
), ),
),
); );
}, },
); );

Loading…
Cancel
Save