From a6164c6c6b31e60d756f29e8d37f89ca6ba40d0e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 25 Aug 2025 17:00:49 +0300 Subject: [PATCH] updates --- lib/config/localized_values.dart | 2 +- lib/core/service/client/base_app_client.dart | 4 +- lib/core/service/medical/labs_service.dart | 2 +- .../full_screen_lab_result_graph.dart | 89 ++++++++++--------- lib/widgets/others/app_scaffold_widget.dart | 35 ++++---- 5 files changed, 69 insertions(+), 63 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f915e9fe..c58cf8e1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2843,6 +2843,6 @@ const Map localizedValues = { "pleaseEnterValidMobile": {"en": "Please enter valid phone number", "ar": "الرجاء إدخال رقم هاتف صالح"}, "pleaseEnterNationalIdOrFileNo": {"en": "Please enter National id or File no", "ar": "الرجاء إدخال رقم الهوية الوطنية أو رقم الملف"}, "thisResult": {"en": "This Result", "ar": "هذه النتيجة"}, - "seeAllGraphValues": {"en": "See all values", "ar": "شاهد جميع القيم"}, + "seeAllGraphValues": {"en": "View all results", "ar": "عرض جميع النتائج"}, "verify-with-biometric": {"en": "Biometric", "ar": "الحيوية"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 6ecdef8d..bf7dc5b7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -187,8 +187,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - body['PatientID'] = 1018977; //4609100 - body['TokenID'] = "@dm!n"; + // body['PatientID'] = 53320; //4609100 + // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index b7106f46..a204630b 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -325,7 +325,7 @@ class LabsService extends BaseService { return bDate.compareTo(aDate); // descending }); - print("the copied item are $copy"); + // print("the copied item are $copy"); labOrdersResultsList = copy; return copy.take(3).toList(); } diff --git a/lib/widgets/data_display/medical/LabResult/full_screen_lab_result_graph.dart b/lib/widgets/data_display/medical/LabResult/full_screen_lab_result_graph.dart index af516642..5720891d 100644 --- a/lib/widgets/data_display/medical/LabResult/full_screen_lab_result_graph.dart +++ b/lib/widgets/data_display/medical/LabResult/full_screen_lab_result_graph.dart @@ -6,55 +6,60 @@ import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; class FullScreenGraph extends StatelessWidget { - final List completeeGraphValues ; - final List threshold ; - final double maxY ; + final List completeeGraphValues; + + final List threshold; + + final double maxY; + + const FullScreenGraph({super.key, required this.completeeGraphValues, required this.threshold, required this.maxY}); - const FullScreenGraph({super.key, required this.completeeGraphValues, required this.threshold, required this. maxY}); @override Widget build(BuildContext context) { return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labResult, - showNewAppBar: true, - showNewAppBarTitle: true, - backgroundColor: Color(0xffF8F8F8), - body: RotatedBox( - quarterTurns: 1, - child: SizedBox( - // width: MediaQuery.sizeOf(context).height, - height: MediaQuery.sizeOf(context).width, - child: Material( - color: Colors.white, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18), - child: DynamicResultChart( - dataPoints: completeeGraphValues, - thresholds: threshold, - maxY : maxY, - // width:((completeeGraphValues.length <=2)? MediaQuery.sizeOf(context).height : (MediaQuery.sizeOf(context).height* ( - // completeeGraphValues.length <= 3 - // ? 1 - // : (completeeGraphValues.length/3)) - // ) )-77, - width: MediaQuery.sizeOf(context).height-100, - scrollDirection: Axis.horizontal, - height: MediaQuery.sizeOf(context).width, - isFullScreenGraph: true, - ), + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).labResult, + showNewAppBar: true, + showNewAppBarTitle: true, + showHomeAppBarIcon: false, + backgroundColor: Color(0xffF8F8F8), + body: RotatedBox( + quarterTurns: 1, + child: SizedBox( + // width: MediaQuery.sizeOf(context).height, + height: MediaQuery.sizeOf(context).width, + child: Material( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18), + child: DynamicResultChart( + dataPoints: completeeGraphValues, + thresholds: threshold, + maxY: maxY, + // width:((completeeGraphValues.length <=2)? MediaQuery.sizeOf(context).height : (MediaQuery.sizeOf(context).height* ( + // completeeGraphValues.length <= 3 + // ? 1 + // : (completeeGraphValues.length/3)) + // ) )-77, + width: MediaQuery.sizeOf(context).height - 100, + scrollDirection: Axis.horizontal, + height: MediaQuery.sizeOf(context).width, + isFullScreenGraph: true, + // isFullScreenGraph: false, ), ), ), ), - ); + ), + ); } - // double getMax(List dataPoints) { - // double max = double.negativeInfinity; - // for (var point in dataPoints) { - // if (point.value > max) { - // max = point.y; - // } - // } - // return max; - // } +// double getMax(List dataPoints) { +// double max = double.negativeInfinity; +// for (var point in dataPoints) { +// if (point.value > max) { +// max = point.y; +// } +// } +// return max; +// } } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index c61f1add..f10d08ed 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -262,6 +262,7 @@ class _AppScaffoldState extends State { showCenterLogo: widget.showCenteredLogo, isShowLanguageChanger: widget.isShowLanguageChanger, showSavedLoginBar: widget.showLastLoginScreenBar, + showHomeAppBarIcon: widget.showHomeAppBarIcon, onTap: () { widget.onTap; }, @@ -297,11 +298,7 @@ class _AppScaffoldState extends State { icon: widget.icon, ) : widget.baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(context), - baseViewModel: widget.baseViewModel, - showLoader : widget.showLoader - ) + ? NetworkBaseView(child: buildBodyWidget(context), baseViewModel: widget.baseViewModel, showLoader: widget.showLoader) : buildBodyWidget(context), ), bottomNavigationBar: widget.isBottomBar @@ -369,6 +366,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget { final bool isShowLanguageChanger; final bool showCenterLogo; final bool showSavedLoginBar; + final bool? showHomeAppBarIcon; String currentLang = 'ar'; @@ -388,6 +386,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget { this.isShowLanguageChanger = false, this.showCenterLogo = false, this.showSavedLoginBar = false, + this.showHomeAppBarIcon = true, }) : super(key: key); @override @@ -586,17 +585,19 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget { if (appBarIcons != null) ...appBarIcons! else - IconButton( - onPressed: () { - AppSharedPreferences().remove(IS_LIVECARE_APPOINTMENT); - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route route) => false, - ); - }, - icon: Icon(Icons.home), - ), + showHomeAppBarIcon! + ? IconButton( + onPressed: () { + AppSharedPreferences().remove(IS_LIVECARE_APPOINTMENT); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + }, + icon: Icon(Icons.home), + ) + : Container(), ], ); } @@ -623,7 +624,7 @@ class AppBarWidget extends StatefulWidget implements PreferredSizeWidget { AppBarWidget( {this.appBarTitle, - this.showHomeAppBarIcon, + this.showHomeAppBarIcon = true, this.appBarIcons, this.isPharmacy = true, this.isshowBackButton = true,