From b1ddd9935c3771a1e976d159105970d1d8bd8112 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 17 Feb 2022 10:11:43 +0200 Subject: [PATCH] finish add Prescription --- .../prescription/new_prescriptions_page.dart | 2 +- .../prescription/old_prescriptions_page.dart | 89 ++++++++++++++----- 2 files changed, 66 insertions(+), 25 deletions(-) diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart index 71653de9..e5403139 100644 --- a/lib/screens/prescription/new_prescriptions_page.dart +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -161,7 +161,7 @@ class NewPrescriptionsPage extends StatelessWidget { ), ], ), - )); + ),); }), ), ), diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart index c969397d..19d12416 100644 --- a/lib/screens/prescription/old_prescriptions_page.dart +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -11,8 +12,10 @@ import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; @@ -121,14 +124,22 @@ class OldPrescriptionsPage extends StatelessWidget { ), ), ) - : NetworkBaseView( - baseViewModel: model, - child: FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), + : Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - + SizedBox( + height: 12, + ), + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context) + .prescriptions + "(${TranslationBase.of(context) + .old }) ", + ), model.medicationForInPatient.length == 0? Center( child: ErrorMessage( @@ -142,23 +153,52 @@ class OldPrescriptionsPage extends StatelessWidget { itemBuilder: (context, index) { //model.medicationForInPatient.length, return InkWell( - child: InPatientDoctorCard( - doctorName: Helpers.convertToTitleCase(model - .medicationForInPatient[index] - .pHRItemDescription), - profileUrl: 'sss', - branch: 'hamza', - clinic: 'basheer', - isPrescriptions: true, - appointmentDate: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .prescriptionDatetime, + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .pHRItemDescription), + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: "Doctor Name :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .doctorName + .toString()), + ), + CustomRow( + label: "Status :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .statusDescription + .toString()), + ), + CustomRow( + label: "dose :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .dose + .toString()), + ), CustomRow( + label: "comments :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .comments + .toString()), + ), + + ], ), - createdBy: Helpers.convertToTitleCase(model - .medicationForInPatient[index] - .doctorName - .toString()), ), onTap: () => Navigator.push( context, @@ -188,6 +228,7 @@ class OldPrescriptionsPage extends StatelessWidget { ], ), ), - ))); + ), + ))); } }