From b3fd1cb93dfe3d2e9a101112ebf708d2d3da2ad4 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 17 Aug 2021 14:40:51 +0300 Subject: [PATCH] lab result detail flow chart screen & improvement. --- lib/config/localized_values.dart | 1 + lib/uitl/translations_delegate_base.dart | 2 + lib/uitl/utils.dart | 44 ++++- .../medical/LabResult/FlowChartPage.dart | 56 ++++-- .../medical/LabResult/LabResultWidget.dart | 61 ++----- .../LabResult/Lab_Result_details_wideget.dart | 108 +++--------- .../medical/LabResult/LineChartCurved.dart | 161 ++++++++---------- .../lab_result_chart_and_detials.dart | 102 +++++++++-- .../LabResult/laboratory_result_widget.dart | 13 +- lib/widgets/new_design/doctor_header.dart | 13 +- .../others/app_expandable_notifier.dart | 60 ++++--- 11 files changed, 328 insertions(+), 293 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a4c1ea94..ddad32c1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -945,6 +945,7 @@ const Map localizedValues = { "insur-cards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, 'labResult': {"en": "Lab results", "ar": "نتائج التحاليل المخبرية"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, + 'graph-details': {'en': 'Graph Details', 'ar': 'التفاصيل الرسم البياني'}, "age": {"en": "Age", "ar": "العمر"}, "active-insurence": {"en": "Active", "ar": "نشطة"}, "not-active": {"en": "Not Active", "ar": "غير نشط"}, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d340c515..21a52b55 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1416,6 +1416,8 @@ class TranslationBase { String get details => localizedValues['details'][locale.languageCode]; + String get graphDetails => localizedValues['graph-details'][locale.languageCode]; + String get age => localizedValues['age'][locale.languageCode]; String get activeInsurence => localizedValues['active-insurence'][locale.languageCode]; diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 0f1422d2..9c93d5f2 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -20,7 +20,7 @@ import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart' import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; @@ -813,6 +813,48 @@ class Utils { ); }); } + + static Widget tableColumnTitle(String text) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 6), + Text( + text, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), + SizedBox(height: 6), + Divider( + height: 1, + color: Color(0xff2E303A), + thickness: 1, + ) + ], + ); + } + + static Widget tableColumnValue(String text, {bool isLast = false}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 12), + Text( + text.toLowerCase().capitalizeFirstofEach, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + SizedBox(height: 12), + if (!isLast) + Divider( + height: 1, + color: Color(0xffEFEFEF), + thickness: 1, + ) + ], + ); + } + } Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart index 2cc9acd6..6d4e84ee 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -1,10 +1,14 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'LineChartCurved.dart'; import 'lab_result_chart_and_detials.dart'; class FlowChartPage extends StatelessWidget { @@ -16,28 +20,58 @@ class FlowChartPage extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, procedure: filterName), + onModelReady: (model) => model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF8F8F8), body: SingleChildScrollView( - child: model. labOrdersResultsList.isNotEmpty - ? Container( - child: LabResultChartAndDetails( - name: filterName, - labResult: model.labOrdersResultsList, - ), + child: model.labOrdersResultsList.isNotEmpty + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: double.infinity, + padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12), + margin: EdgeInsets.only(left: 21, right: 21, top: 21), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + ), + child: LineChartCurved( + title: filterName, + labResult: model.labOrdersResultsList, + ), + ), + LabResultChartAndDetails( + name: filterName, + labResult: model.labOrdersResultsList, + ), + ], ) : Center( - child: Container( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height *0.42), + child: Container( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.42), child: Center( child: Texts('No Data'), ), ), - ), + ), ), ), ); diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 09d62f3f..aed50f8f 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -2,11 +2,12 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; + import '../../text.dart'; import 'FlowChartPage.dart'; @@ -28,12 +29,13 @@ class LabResultWidget extends StatelessWidget { children: [ SizedBox(height: 8), Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( filterName, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.56, height: 21 / 14), - ),SizedBox(width: 16), + ), + SizedBox(width: 16), InkWell( onTap: () { Navigator.push( @@ -71,9 +73,9 @@ class LabResultWidget extends StatelessWidget { tableRow.add( TableRow( children: [ - _tableColumnTitle(TranslationBase.of(context).description), - _tableColumnTitle(TranslationBase.of(context).value), - _tableColumnTitle(TranslationBase.of(context).range), + Utils.tableColumnTitle(TranslationBase.of(context).description), + Utils.tableColumnTitle(TranslationBase.of(context).value), + Utils.tableColumnTitle(TranslationBase.of(context).range), ], ), ); @@ -82,53 +84,12 @@ class LabResultWidget extends StatelessWidget { tableRow.add( TableRow( children: [ - _tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)), - _tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: i == (labResultList.length - 1)), - _tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1)), + Utils.tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)), + Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: i == (labResultList.length - 1)), + Utils.tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1)), ], ), ); return tableRow; } - - Widget _tableColumnTitle(String text) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox(height: 6), - Text( - text, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), - ), - SizedBox(height: 6), - Divider( - height: 1, - color: Color(0xff2E303A), - thickness: 1, - ) - ], - ); - } - - Widget _tableColumnValue(String text, {bool isLast = false}) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox(height: 12), - Text( - text.toLowerCase().capitalizeFirstofEach, - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), - ), - SizedBox(height: 12), - if (!isLast) - Divider( - height: 1, - color: Color(0xffEFEFEF), - thickness: 1, - ) - ], - ); - } } diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index 68d01e4a..bc83ae5f 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -24,96 +25,35 @@ class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return Container( - decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), - border: Border.all(color: Colors.grey, width: 1), - ), - margin: EdgeInsets.all(20), - child: Container( - color: Colors.transparent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), - ), - children: fullData(projectViewModel), - ), - ], - ), - ), + return Table( + columnWidths: { + 0: FlexColumnWidth(2), + 1: FlexColumnWidth(1), + }, + children: fullData(widget.labResult, context), ); } - List fullData(ProjectViewModel projectViewModel) { + List fullData(List labOrderResultList, context) { List tableRow = []; - tableRow.add(TableRow(children: [ - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context).date, - color: Colors.white, - ), - ), - height: 60, - ), + tableRow.add( + TableRow( + children: [ + Utils.tableColumnTitle(TranslationBase.of(context).date), + Utils.tableColumnTitle(TranslationBase.of(context).labResults), + ], ), - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), - ), - ), - child: Center( - child: Texts(TranslationBase.of(context).labResult, color: Colors.white), - ), - height: 60), - ) - ])); - widget.labResult.forEach((vital) { - var date =DateUtil.convertStringToDate(vital.verifiedOnDateTime); - tableRow.add(TableRow(children: [ - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${projectViewModel.isArabic? DateUtil.getWeekDayArabic(date.weekday): DateUtil.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtil.getMonthArabic(date.month) : DateUtil.getMonth(date.month)} ${date.year}', - textAlign: TextAlign.center, - ), - ), - ), - ), - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${vital.resultValue}', - textAlign: TextAlign.center, - ), - ), - ), + ); + + for (int i = 0; i < labOrderResultList.length; i++) + tableRow.add( + TableRow( + children: [ + Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime)), isLast: i == (labOrderResultList.length - 1)), + Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)), + ], ), - ])); - }); + ); return tableRow; } } diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart index 5b0a4568..420fa7b1 100644 --- a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -38,46 +38,34 @@ class LineChartCurvedState extends State { @override Widget build(BuildContext context) { - return AspectRatio( - aspectRatio: 1.23, - child: Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(18)), - // color: Colors.white, - ), - child: Stack( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox( - height: 4, - ), - Text( - widget.title, - style: TextStyle( - color: Colors.black, - fontSize: 32, - fontWeight: FontWeight.bold, - letterSpacing: 2), - textAlign: TextAlign.center, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.only(right: 16.0, left: 6.0), - child: LineChart( - sampleData1(), - swapAnimationDuration: const Duration(milliseconds: 250), - ), + return Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.title, + style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + SizedBox(height: 16), + AspectRatio( + aspectRatio: 333 / 288, + child: Padding( + padding: EdgeInsets.only(right: 16.0, left: 6.0), + child: LineChart( + sampleData1(), + swapAnimationDuration: const Duration(milliseconds: 250), ), ), - const SizedBox( - height: 10, - ), - ], - ), - ], - ), + ), + ], + ), + ], ), ); } @@ -91,17 +79,13 @@ class LineChartCurvedState extends State { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: false, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontSize: 12, - ), - margin: 22, - rotateAngle:-65, + getTextStyles: (value) => TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), + margin: 8, + rotateAngle: -0, getTitles: (value) { print(value); DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); @@ -111,27 +95,20 @@ class LineChartCurvedState extends State { } else return ''; } else { - if (value.toInt() == 0) - return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResult.length - 1) - return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; } } - - return ''; }, ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), + getTextStyles: (value) => TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), + getTitles: (value) { return '${value.toInt()}'; }, @@ -140,22 +117,22 @@ class LineChartCurvedState extends State { ), ), borderData: FlBorderData( - show: true, - border: const Border( - bottom: BorderSide( - color: Colors.black, - width: 0.5, - ), - left: BorderSide( - color: Colors.black, - ), - right: BorderSide( - color: Colors.black, - ), - top: BorderSide( - color: Colors.transparent, - ), - ), + show: false, + // border: const Border( + // bottom: BorderSide( + // color: Colors.black, + // width: 0.5, + // ), + // // left: BorderSide( + // // color: Colors.black, + // // ), + // // right: BorderSide( + // // color: Colors.black, + // // ), + // top: BorderSide( + // color: Colors.transparent, + // ), + // ), ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), @@ -168,10 +145,10 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { - try{ - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble > max) max = resultValueDouble;} - catch(e){ + try { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble; + } catch (e) { print(e); } }); @@ -181,13 +158,14 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; - try{ - min = double.parse(widget.labResult[0].resultValue); - - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble < min) min = resultValueDouble; - });}catch(e){ + try { + min = double.parse(widget.labResult[0].resultValue); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble < min) min = resultValueDouble; + }); + } catch (e) { print(e); } int value = min.toInt(); @@ -198,21 +176,22 @@ class LineChartCurvedState extends State { List getData() { List spots = List(); for (int index = 0; index < widget.labResult.length; index++) { - try{ - var resultValueDouble = double.parse(widget.labResult[index].resultValue); - spots.add(FlSpot(index.toDouble(), resultValueDouble)); - }catch(e){ + try { + var resultValueDouble = double.parse(widget.labResult[index].resultValue); + print("$index:$resultValueDouble"); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } catch (e) { print(e); spots.add(FlSpot(index.toDouble(), 0.0)); - } } final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Theme.of(context).primaryColor], - barWidth: 5, + //preventCurveOverShooting : true, + colors: [Color(0xffD02127)], + barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( show: false, diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart index 767649a8..58ea2294 100644 --- a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:flutter/material.dart'; @@ -20,23 +21,98 @@ class LabResultChartAndDetails extends StatelessWidget { final List labResult; final String name; - @override Widget build(BuildContext context) { - return Column( - children: [ - AppExpandableNotifier( - headerWidget: Padding( - padding: const EdgeInsets.all(8.0), - child: LineChartCurved(title: name,labResult:labResult,), + return Container( + padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12), + margin: EdgeInsets.only(left: 21, right: 21, top: 12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), ), - bodyWidget: LabResultDetailsWidget( - labResult: labResult.reversed.toList(), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + TranslationBase.of(context).graphDetails, + style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + ), + ], ), - isExpand: true, - ), - ], + SizedBox(height: 8), + LabResultDetailsWidget( + labResult: labResult.reversed.toList(), + ) + ], + ), ); + // todo old was expandable, but new is not expandable + // Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // child: Text( + // TranslationBase.of(context).generalResult, + // style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + // ), + // ), + // ], + // ), + // LabResultDetailsWidget( + // labResult: labResult.reversed.toList(), + // ), + // AppExpandableNotifier( + // // headerWidget: Container( + // // padding: EdgeInsets.only(left: 17, top: 12, right: 13, bottom: 12), + // // margin: EdgeInsets.only(left: 21, right: 21, top: 21), + // // decoration: BoxDecoration( + // // shape: BoxShape.rectangle, + // // color: Colors.white, + // // borderRadius: BorderRadius.all( + // // Radius.circular(10.0), + // // ), + // // boxShadow: [ + // // BoxShadow( + // // color: Color(0xff000000).withOpacity(.05), + // // //spreadRadius: 5, + // // blurRadius: 27, + // // offset: Offset(0, -3), + // // ), + // // ], + // // ), + // // child: LineChartCurved( + // // title: name, + // // labResult: labResult + // // ), + // // ), + // title: TranslationBase.of(context).delete, + // bodyWidget: LabResultDetailsWidget( + // labResult: labResult.reversed.toList(), + // ), + // isExpand: true, + // ), + // ], + // ); } - } diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 6cc3607c..641a0bed 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -53,7 +53,7 @@ class _LaboratoryResultWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ DoctorHeader( - headerModel: new HeaderModel( + headerModel: HeaderModel( widget.patientLabOrder.doctorName, widget.patientLabOrder.doctorImageURL, widget.patientLabOrder.speciality, @@ -105,14 +105,9 @@ class _LaboratoryResultWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( - child: Row( - children: [ - Text( - TranslationBase.of(context).generalResult, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - // todo 'sikander' discuss about chart flow chart - ], + child: Text( + TranslationBase.of(context).generalResult, + style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), Icon( diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index f433db60..376b1e67 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -20,6 +20,8 @@ class DoctorHeader extends StatelessWidget { @override Widget build(BuildContext context) { + String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : ""; + return Container( color: Colors.white, child: Column( @@ -44,7 +46,7 @@ class DoctorHeader extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - (headerModel?.speciality?.toString()?.toLowerCase()?.capitalizeFirstofEach ?? ""), + _speciality, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), ), myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo), @@ -64,10 +66,10 @@ class DoctorHeader extends StatelessWidget { DateUtil.formatDateToTime(headerModel.orderDate), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), - ), + // Padding( + // padding: const EdgeInsets.only(top: 8.0), + // child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), + // ), ], ) ], @@ -109,7 +111,6 @@ class DoctorHeader extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - // todo: 'change icon for send email' SvgPicture.asset('assets/images/new/email.svg', width: 19.0), SizedBox(width: 6), Text( diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index ad97ba11..51fa0f03 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -65,38 +65,42 @@ class _AppExpandableNotifier extends State { ), header: Padding( padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (_title.isNotEmpty) - Text( - _title, - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), - ), - Text( - _subTitle, - maxLines: 1, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), + child: InkWell( + onTap: (){ + setState(() { + widget.expandFlag = !widget.expandFlag; + widget.controller.expanded = widget.expandFlag; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (_title.isNotEmpty) + Text( + _title, + style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), + ), + Text( + _subTitle, + maxLines: 1, + style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), + ), + ], ), - ], - ), - ), - IconButton( - icon: Icon( - widget.expandFlag ?Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + ), + Icon( + widget.expandFlag ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Color(0xff2E303A), // size: 30.0, ), - onPressed: () { - setState(() { - widget.expandFlag = !widget.expandFlag; - widget.controller.expanded = widget.expandFlag; - }); - }), - ]), + ], + ), + ), ), collapsed: widget.collapsed ?? Container(), expanded: widget.bodyWidget,