From 57fcd2cdeb84f6cb8c24894ffb9086f374414ecf Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 18 May 2021 14:40:54 +0300 Subject: [PATCH] fix home page design --- .../lab_order/labs_service.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 35 ------------------- lib/landing_page.dart | 4 +-- lib/screens/home/dashboard_swipe_widget.dart | 9 ++--- .../patient_profile_screen.dart | 7 ++-- lib/widgets/dashboard/activity_button.dart | 4 +-- lib/widgets/dashboard/out_patient_stack.dart | 8 ++--- 7 files changed, 18 insertions(+), 51 deletions(-) diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 4eee522a..d7fc3aab 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -105,7 +105,7 @@ class LabsService extends BaseService { await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - patientLabSpecialResult.clear(); + // patientLabSpecialResult.clear(); labResultList.clear(); if (isInpatient) { diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 32a40e7e..8e6f8989 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -257,41 +257,6 @@ class ProcedureViewModel extends BaseViewModel { } } - getPatientLabResult( - {PatientLabOrders patientLabOrder, PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder, patient: patient); - if (_labsService.hasError) { - error = _labsService.error; - setState(ViewState.Error); - } else { - _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists - .where( - (elementClinic) => elementClinic.filterName == element.testCode) - .toList(); - - if (patientLabOrdersClinic.length != 0) { - var value = - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .where((e) => - e.sampleCollectedOn == element.sampleCollectedOn && - e.resultValue == element.resultValue) - .toList(); - if (value.isEmpty) - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); - } else { - labResultLists - .add(LabResultList(filterName: element.testCode, lab: element)); - } - }); - setState(ViewState.Idle); - } - } getPatientLabOrdersResults( {PatientLabOrders patientLabOrder, diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 0e1e2c48..cd7a8171 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -62,9 +62,7 @@ class _LandingPageState extends State { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - ShowCaseWidget( - builder: Builder(builder: (context) => HomeScreen()), - ), + HomeScreen(), MyScheduleScreen(), QrReaderScreen(), DoctorReplyScreen( diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index a6dc12eb..de5cc05f 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -28,8 +29,8 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { return Container( - // height: MediaQuery.of(context).size.height * 0.35, - height: 230, + height: MediaQuery.of(context).size.height * 0.35, + // height: 230, child: Swiper( onIndexChanged: (index) { if (mounted) { @@ -210,12 +211,12 @@ class _DashboardSwipeWidgetState extends State { widget.model .getPatientCount(dashboardItemList[2]) .toString(), - fontSize: 28, + fontSize: SizeConfig.textMultiplier * 3.0, fontWeight: FontWeight.bold, ) ], ), - top: MediaQuery.of(context).size.height * 0.12, + top: MediaQuery.of(context).size.height * 0.13, left: 0, right: 0) ]), diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 2424da36..7a0305e4 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -27,7 +27,7 @@ class _PatientProfileScreenState extends State PatiantInformtion patient; bool isFromSearch = false; - bool isFromLiveCare = true; + bool isFromLiveCare = false; bool isInpatient = false; @@ -73,6 +73,9 @@ class _PatientProfileScreenState extends State if (routeArgs.containsKey("isSearchAndOut")) { isSearchAndOut = routeArgs['isSearchAndOut']; } + if(routeArgs.containsKey("isFromLiveCare")) { + isFromLiveCare = routeArgs['isFromLiveCare']; + } if (isInpatient) _activeTab = 0; else @@ -287,7 +290,7 @@ class _PatientProfileScreenState extends State ), ], ), - ) : Container(), + ) : null, ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index a46fc334..ff9db962 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -9,12 +9,12 @@ class GetActivityButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 110, + width: MediaQuery.of(context).size.height * 0.125, padding: EdgeInsets.all(5), margin: EdgeInsets.all(5), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(15), ), child: Padding( padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 2b982e20..fe05d69d 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -14,7 +14,7 @@ class GetOutPatientStack extends StatelessWidget { var list = new List(); value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value))}); + {list.add(getStack(result, value.summaryoptions.first.value,context))}); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -32,7 +32,7 @@ class GetOutPatientStack extends StatelessWidget { ); } - getStack(Summaryoptions value, max) { + getStack(Summaryoptions value, max,context) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), @@ -55,7 +55,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? (150 * value.value) / max : 0, + height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), @@ -63,7 +63,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: 150, + height: (MediaQuery.of(context).size.height * 0.24 ), margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox(