diff --git a/lib/routes.dart b/lib/routes.dart index 909b1bf4..dc905ba8 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen_history.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; @@ -108,6 +109,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss'; +const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PRESCRIPTION_HISTORY = 'prescription/prescriptionsssH'; const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; @@ -173,6 +175,7 @@ var routes = { ADD_SICKLEAVE: (_) => AddSickLeavScreen(), SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), + ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a306a93f..67e957a2 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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 PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -27,153 +26,155 @@ class PrescriptionItemsPage extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).prescriptions, baseViewModel: model, - body: Container( - height: MediaQuery.of(context).size.height * 0.8, - child: Column( - children: [ - if (!prescriptions.isInOutPatient) - ...List.generate( - model.prescriptionReportList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: - model.prescriptionReportList[index], + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), ), ), - ), - child: Container( - width: double.infinity, - margin: - EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), ), - border: Border.all( - color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index] - .imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + child: Row( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model - .prescriptionReportList[index] - .itemDescription - .isNotEmpty - ? model.prescriptionReportList[index] - .itemDescription - : model.prescriptionReportList[index] - .itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), - ), - )) - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => InkWell( - onTap: () { - PrescriptionReport prescriptionReport = - PrescriptionReport( - imageSRCUrl: model - .prescriptionReportEnhList[index].imageSRCUrl, - itemDescription: model - .prescriptionReportEnhList[index] - .itemDescription, - itemDescriptionN: model - .prescriptionReportEnhList[index] - .itemDescription, - routeN: - model.prescriptionReportEnhList[index].route, - frequency: model - .prescriptionReportEnhList[index].frequency, - frequencyN: model - .prescriptionReportEnhList[index].frequency, - doseDailyQuantity: model - .prescriptionReportEnhList[index] - .doseDailyQuantity, - days: model.prescriptionReportEnhList[index].days, - itemID: - model.prescriptionReportEnhList[index].itemID, - remarks: model - .prescriptionReportEnhList[index].remarks); - Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: prescriptionReport, - ), - ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model - .prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, ), ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), - ], + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, ), ), - ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), ), ), - ) - ], + + ], + ), ), ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 2b99e53a..d595ff0b 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -88,6 +88,7 @@ class PrescriptionsPage extends StatelessWidget { FadePage( page: PrescriptionItemsPage( prescriptions: prescriptions, + patient: patient, ), ), ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 6863362b..b5e96ec7 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -69,14 +69,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png') : PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png'),