From 6ca3baf7cb3288755e7cf01b60730131dc6c4575 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 12 Sep 2021 12:35:24 +0300 Subject: [PATCH] solve lab results design issue --- .../patients/DischargedPatientPage.dart | 6 +- .../profile/lab_result/LabResultWidget.dart | 102 ++++++++++-------- .../profile/lab_result/labs_home_page.dart | 64 ++++++----- lib/widgets/shared/card_with_bg_widget.dart | 9 +- lib/widgets/shared/doctor_card.dart | 9 +- pubspec.lock | 6 +- 6 files changed, 109 insertions(+), 87 deletions(-) diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 7f314c0e..8fba00d0 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -323,7 +323,11 @@ class _DischargedPatientState extends State { ), ], ), - ) + ), + Icon( + Icons.arrow_forward, + size: 24, + ), ], ) ], diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index ecbaa919..153dfc6e 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -121,43 +121,6 @@ class LabResultWidget extends StatelessWidget { (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: - patientLabResultList[index].description, - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient, - ), - // page: LabResultHistoryPage( - // filterName: patientLabResultList[index].description, - // patientLabOrder: patientLabOrder, - // patient: patient, - // ), - ), - ); - }, - // child: AppText( - // " (show details)", - // color: Colors.blue, - // fontSize: 12, - // ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - fontSize: 12, - ), - ], - ), - ), Row( children: [ Expanded( @@ -191,20 +154,67 @@ class LabResultWidget extends StatelessWidget { ), ), Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: AppText( - patientLabResultList[index].referanceRange, - textAlign: TextAlign.center, - isCopyable: true, + child: Column( + children: [ + Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + patientLabResultList[index].referanceRange, + textAlign: TextAlign.center, + isCopyable: true, + ), + ), ), - ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: + patientLabResultList[index].description, + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient, + ), + // page: LabResultHistoryPage( + // filterName: patientLabResultList[index].description, + // patientLabOrder: patientLabOrder, + // patient: patient, + // ), + ), + ); + }, + // child: AppText( + // " (show details)", + // color: Colors.blue, + // fontSize: 12, + // ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, + fontSize: 12, + ), + ], + ), + ) + ], ), ), ], ), + // SizedBox( + // height: 12, + // ), Divider(), ], )) diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 48c35952..2c6dbb0c 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -136,37 +137,44 @@ class _LabsHomePageState extends State { Radius.circular(8.0), ), color: Colors.white), - child: Row( + child: Stack( children: [ - Container( - width: 20, - height: 160, - decoration: BoxDecoration( - color: model.patientLabOrdersList[index].isLiveCareAppointment - ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), + Positioned( + bottom: 1, + top: 1, + left: 1, + child: Container( + width: 20, + decoration: BoxDecoration( + color: model.patientLabOrdersList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), ), - Expanded( + Container( + color: Colors.white, + padding: EdgeInsets.all(0), + margin: EdgeInsets.only(left: 20), child: DoctorCard( isNoMargin: true, onTap: () => Navigator.push( diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index d414f557..c8e187a1 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -26,7 +25,7 @@ class CardWithBgWidget extends StatelessWidget { Radius.circular(10.0), ), border: Border.all( - color: hasBorder ? HexColor('#707070') : Colors.transparent, + color: hasBorder ? Color(0xFF707070) : Colors.transparent, width: hasBorder ? 0.30 : 0), ), child: Material( @@ -37,8 +36,7 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? HexColor('#58434F'), - + color: bgColor ?? Color(0xFF58434F), borderRadius: BorderRadius.only( topRight: Radius.circular(10), bottomRight: Radius.circular(10),),), @@ -52,8 +50,7 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? HexColor('#58434F'), - + color: bgColor ?? Color(0xFF58434F), borderRadius: BorderRadius.only( topLeft: Radius.circular(10), bottomLeft: Radius.circular(10),),), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index faa4379a..5bd12bb8 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -157,6 +157,7 @@ class DoctorCard extends StatelessWidget { ), if (branch != null) Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context).branch + @@ -164,9 +165,11 @@ class DoctorCard extends StatelessWidget { fontSize: 14, color: Colors.grey[500], ), - AppText( - branch, - fontSize: 14, + Expanded( + child: AppText( + branch, + fontSize: 14, + ), ) ], ) diff --git a/pubspec.lock b/pubspec.lock index 53035a4a..43aefcb2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -692,7 +692,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -1026,7 +1026,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1231,5 +1231,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0"