From ed3449bcf4e5d05f5d4780d36ccbf1db2c739a89 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 29 Apr 2021 16:43:31 +0300 Subject: [PATCH] fix the doctor card in lab result and radiology --- ios/Podfile.lock | 2 +- .../profile/lab_result/labs_home_page.dart | 10 ++++-- .../radiology/radiology_home_page.dart | 7 ++-- lib/widgets/patients/PatientCard.dart | 34 ------------------- 4 files changed, 13 insertions(+), 40 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a365fcf4..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 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 290f9569..dfba4578 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; @@ -12,6 +13,7 @@ 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'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class LabsHomePage extends StatefulWidget { @override @@ -37,6 +39,7 @@ class _LabsHomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( @@ -131,15 +134,16 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) color: model.patientLabOrdersList[index].isLiveCareAppointment ? Colors.red[900] : !model.patientLabOrdersList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + 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( diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 81e0e6cf..d96a908a 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -39,6 +39,7 @@ class _RadiologyHomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), @@ -140,8 +141,10 @@ class _RadiologyHomePageState extends State { ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + 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) ), ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index fd60b21d..aa6f114f 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -398,39 +398,5 @@ class PatientCard extends StatelessWidget { ])); } - convertDateFormat2(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } }