From e84dd573fed60e453a8e4b9cd1075d8c755b8074 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 5 Apr 2021 14:53:19 +0300 Subject: [PATCH] fix the Procedure Card --- lib/screens/procedures/ProcedureCard.dart | 189 ++++++------ lib/screens/procedures/procedure_screen.dart | 7 +- lib/widgets/shared/doctor_card_insurance.dart | 282 +++++++++--------- 3 files changed, 245 insertions(+), 233 deletions(-) diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d023dbc2..4fd632cf 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -25,116 +25,113 @@ class ProcedureCard extends StatelessWidget { borderRadius: BorderRadius.circular(15), color: Colors.white, ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: MediaQuery.of(context).size.height * .20, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10), - ), - color: entityList.orderType == 1 - ? Colors.red[500] - : Colors.black, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), ), + color: entityList.orderType == 1 + ? Colors.red[500] + : Colors.black, ), - Expanded( - child: Container( - padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - entityList.orderType == 0 - ? 'Routine' - : 'Urgent', - color: entityList.orderType == 0 - ? Colors.black - : Colors.red[800], - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 5, - ), - Texts( - entityList.procedureName, - bold: true, - fontSize: 14, - ), - ], - ), - ), - SizedBox( - width: 5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.end, + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, + entityList.orderType == 0 + ? 'Routine' + : 'Urgent', + color: entityList.orderType == 0 + ? Colors.black + : Colors.red[800], fontWeight: FontWeight.w600, - fontSize: 14, + ), + SizedBox( + height: 5, ), Texts( - '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], + entityList.procedureName, + bold: true, fontSize: 14, ), ], ), - ], - ), - Row( - children: [ - Texts( - TranslationBase.of(context).orderNo, - color: Colors.grey, - fontSize: 12, - ), - Texts( - entityList.orderNo.toString(), - color: Colors.grey, - fontSize: 12, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - entityList.remarks ?? '', - fontSize: 12, - ), - Icon(Icons.edit) - ], - ) - ], - ), - onTap: onTap, + ), + SizedBox( + width: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + Texts( + '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).orderNo, + color: Colors.grey, + fontSize: 12, + ), + Texts( + entityList.orderNo.toString(), + color: Colors.grey, + fontSize: 12, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + entityList.remarks ?? '', + fontSize: 12, + ), + Icon(Icons.edit) + ], + ) + ], ), + onTap: onTap, ), ), - ], - ), + ), + ], ), ), ); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index ca658661..3c46cd3f 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -27,8 +28,8 @@ class ProcedureScreen extends StatelessWidget { onModelReady: (model) => model.getProcedure(mrn: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).orderProcedure, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -37,8 +38,6 @@ class ProcedureScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign( - patient, arrivalType ?? '0', patientType), SizedBox( height: 12, ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 4c2bc6d1..498763af 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -1,14 +1,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; - -import 'StarRating.dart'; import 'Text.dart'; class DoctorCardInsurance extends StatelessWidget { @@ -41,142 +36,163 @@ class DoctorCardInsurance extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( + width: double.maxFinite, + height: 160, margin: EdgeInsets.all(10), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: approvalStatus == "Approved" - ? Color(0xff359846) - : Color(0xffD02127), - width: 3.5), - top: BorderSide(color: Colors.white, width: 0.5), - bottom: BorderSide(color: Colors.white, width: 0.5), - right: BorderSide(color: Colors.white, width: 0.5), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: InkWell( - onTap: onTap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - "$approvalStatus", - color: approvalStatus == "Approved" - ? Color(0xff359846) - : Color(0xffD02127), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(25.0), - ), - color: Color(0xff2E303A)), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Texts( - '$patientOut', - color: Colors.white, - fontSize: 15.0, - ), - ), - ) - ], - ), - Row( - children: [ - Expanded( - child: Texts( - doctorName, - bold: true, - )), - ], + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: 160, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + color: approvalStatus == "Approved" ? Color(0xff359846) : Color(0xffD02127), ), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - child: LargeAvatar( - name: doctorName, - url: profileUrl, - ), - width: 55, - height: 55, - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - Texts( - 'order No:', - color: Colors.grey[500], - ), - Texts( - orderNo ?? '', - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - Texts( - 'Invoice:', - color: Colors.grey[500], - ), - Texts( - invoiceNO, - ) - ], - ), - if (isPrescriptions) - Row( - children: [ - Texts( - 'Clinic: ', - color: Colors.grey[500], - ), - Expanded( - child: Texts( - clinic, - ), - ) - ], + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + "$approvalStatus", + color: approvalStatus == "Approved" + ? Color(0xff359846) + : Color(0xffD02127), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(25.0), + ), + color: Color(0xff2E303A)), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Texts( + '$patientOut', + color: Colors.white, + fontSize: 13.0, ), - if (branch != null) - Row( - children: [ - Texts( - 'Approval No: ', - color: Colors.grey[500], - ), - Texts( - branch, - ) - ], - ) - ]), - ), + ), + ) + ], + ), + Row( + children: [ + Expanded( + child: Texts( + doctorName, + bold: true, + )), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 55, + height: 55, + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + Texts( + 'order No:', + color: Colors.grey[500], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[500], + ), + Texts( + invoiceNO, + ) + ], + ), + if (isPrescriptions) + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[500], + ), + Expanded( + child: Texts( + clinic, + ), + ) + ], + ), + if (branch != null) + Row( + children: [ + Texts( + 'Approval No: ', + color: Colors.grey[500], + ), + Texts( + branch, + ) + ], + ) + ]), + ), + ), + Icon( + EvaIcons.eye, + size: 38.0, + ) + ], + ), + ], ), - Icon( - EvaIcons.eye, - size: 38.0, - ) - ], + ), ), - ], - ), + ), + ], ), ), ); } } + + + +