From c7ad16cbcdb5e81e8681cf78595f1ebb9c620973 Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Thu, 4 Jun 2020 13:01:58 +0300 Subject: [PATCH] update design Radiology Screen and create Radiology Report Screen --- lib/providers/patients_provider.dart | 2 +- .../prescriptions/prescriptions_screen.dart | 14 +- .../radiology/radiology_report_screen.dart | 42 +++ .../profile/radiology/radiology_screen.dart | 152 +++++++---- .../doctor/my_referral_patient_widget.dart | 205 +++++++-------- .../doctor/my_referred_patient_widget.dart | 240 +++++++++--------- 6 files changed, 353 insertions(+), 302 deletions(-) create mode 100644 lib/screens/patients/profile/radiology/radiology_report_screen.dart diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index be972ea2..7ff73724 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -213,7 +213,7 @@ class PatientsProvider with ChangeNotifier *@return: *@desc: getPatientPrescriptions */ - getPatientPrescriptions(patient) async { + getOutPatientPrescriptions(patient) async { // isLoading = true; // notifyListeners(); setBasicData(); diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart index e06d789c..aa1d193c 100644 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -12,9 +12,7 @@ import '../../../../providers/patients_provider.dart'; import '../../../../util/dr_app_shared_pref.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_texts_widget.dart'; -import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import '../../../../widgets/shared/profile_image_widget.dart'; import '../../../../widgets/shared/errors/dr_app_embedded_error.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -47,12 +45,8 @@ class _PrescriptionScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); - // String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - // int inOutpatientType = 1; - // if (type == '0') { - // inOutpatientType = 2; - // } - // print(type); + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel( patientID: patient.patientId, projectID: patient.projectId, @@ -60,7 +54,7 @@ class _PrescriptionScreenState extends State { patientTypeID: patient.patientType, languageID: 2, setupID: 0); - patientsProv.getPatientPrescriptions(prescriptionReqModel.toJson()); + patientsProv.getOutPatientPrescriptions(prescriptionReqModel.toJson()); } @override @@ -120,7 +114,7 @@ class _PrescriptionScreenState extends State { height: 8, ), AppText( - ' ${patientsProv.patientPrescriptionsList[index].clinicDescription}', + '${patientsProv.patientPrescriptionsList[index].clinicDescription}', fontSize: 2.5 * SizeConfig.textMultiplier, color: Theme.of(context).primaryColor), SizedBox( diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart new file mode 100644 index 00000000..badb88f8 --- /dev/null +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -0,0 +1,42 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RadiologyReportScreen extends StatelessWidget { + final String reportData; + + RadiologyReportScreen({Key key, this.reportData}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Radiology Report", + showAppDrawer: false, + showBottomBar: false, + body: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + color: Colors.white, + border: Border( + bottom: BorderSide( + color: Colors.grey, width: 0.5), + top: BorderSide( + color: Colors.grey, width: 0.5), + left: BorderSide( + color: Colors.grey, width: 0.5), + right: BorderSide( + color: Colors.grey, width: 0.5), + ), + ), + child: AppText(reportData, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index e5dd68f7..10adf2d5 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_report_screen.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -88,68 +90,106 @@ class _RadiologyScreenState extends State { 0, SizeConfig.realScreenWidth * 0.05, 0), - child: ListView.builder( - itemCount: patientsProv.patientRadiologyList.length, - itemBuilder: (BuildContext ctxt, int index) { - return InkWell( - child: CardWithBgWidget( - widget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - ProfileImageWidget( + child: Container( + margin: EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(20.0), + ), + ), + child: ListView.builder( + itemCount: patientsProv.patientRadiologyList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => RadiologyReportScreen(reportData: patientsProv.patientRadiologyList[index].reportData,)),); + }, + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + border: Border( + bottom: BorderSide( + color: Colors.grey, width: 0.5), + top: BorderSide( + color: Colors.grey, width: 0.5), + left: BorderSide( + color: Colors.grey, width: 0.5), + right: BorderSide( + color: Colors.grey, width: 0.5), + ), + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + LargeAvatar( url: patientsProv .patientRadiologyList[index] - .doctorImageURL), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 0, 0, 0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - '${patientsProv.patientRadiologyList[index].doctorName}', - fontSize: 2.5 * + .doctorImageURL, + name: patientsProv + .patientLabResultOrdersList[ + index] + .doctorName, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.fromLTRB( + 8, 0, 0, 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientRadiologyList[index].doctorName}', + fontSize: 2.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold), + SizedBox( + height: 8, + ), + AppText( + 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', + fontSize: 2 * + SizeConfig + .textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText( + ' ${patientsProv.patientRadiologyList[index].clinicName}', + fontSize: 2 * SizeConfig .textMultiplier, - fontWeight: - FontWeight.bold), - SizedBox( - height: 8, - ), - AppText( - 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText( - ' ${patientsProv.patientRadiologyList[index].clinicName}', - fontSize: 2 * - SizeConfig.textMultiplier, - color: Theme.of(context) - .primaryColor, - ), - SizedBox( - height: 8, - ), - ], + color: Theme.of(context) + .primaryColor, + ), + SizedBox( + height: 8, + ), + ], + ), ), - ), - ) - ], - ), - ], + ) + ], + ), + ], + ), ), - ), - onTap: () {}, - ); - }), + ); + }), + ), ), ); } diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index a2eb5f1d..02d3f10a 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -75,113 +75,54 @@ class _MyReferralPatientWidgetState extends State { children: [ TableRow( children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'File No', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferralPatientModel.referringDoctor}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'File No', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferralPatientModel.referringDoctor}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Doctor', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.myReferralPatientModel - .referringClinicDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + Container( + margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Referring Doctor', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + widget.myReferralPatientModel + .referringClinicDescription, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), - ) + ), ] ), TableRow( children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Clinic', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferralPatientModel.referringClinicDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Frequency', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.myReferralPatientModel - .frequencyDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - ) - ] - ), - TableRow( - children: [ - Expanded( - child: Container( + Container( margin: EdgeInsets.all(2.5), padding: EdgeInsets.all(5), child: Column( @@ -189,13 +130,13 @@ class _MyReferralPatientWidgetState extends State { CrossAxisAlignment.start, children: [ AppText( - 'Priority', + 'Referring Clinic', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), AppText( - '${widget.myReferralPatientModel.priorityDescription}', + '${widget.myReferralPatientModel.referringClinicDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, @@ -203,9 +144,7 @@ class _MyReferralPatientWidgetState extends State { ], ), ), - ), - Expanded( - child: Container( + Container( margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), padding: EdgeInsets.all(5), child: Column( @@ -213,21 +152,69 @@ class _MyReferralPatientWidgetState extends State { CrossAxisAlignment.start, children: [ AppText( - 'Max Response Time', + 'Frequency', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), AppText( - Helpers.getDateFormatted(widget - .myReferralPatientModel - .mAXResponseTime), + widget.myReferralPatientModel + .frequencyDescription, fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, ) ], ), + ) + ] + ), + TableRow( + children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Priority', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferralPatientModel.priorityDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Max Response Time', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + Helpers.getDateFormatted(widget + .myReferralPatientModel + .mAXResponseTime), + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), ) ], diff --git a/lib/widgets/doctor/my_referred_patient_widget.dart b/lib/widgets/doctor/my_referred_patient_widget.dart index af5ea4f8..e4520ebb 100644 --- a/lib/widgets/doctor/my_referred_patient_widget.dart +++ b/lib/widgets/doctor/my_referred_patient_widget.dart @@ -86,144 +86,81 @@ class _MyReferredPatientWidgetState extends State { ), children: [ TableRow(children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - decoration: BoxDecoration(), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'File No', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferredPatientModel.patientId}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + decoration: BoxDecoration(), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'File No', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.patientId}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), ), - Expanded( - child: Container( - margin: EdgeInsets.only( - left: 4, - top: 2.5, - right: 2.5, - bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Referral Doctor', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Texts( - widget.myReferredPatientModel - .referralDoctorName, - maxLength: 80, - readMore: true, - ), - ], - ), + Container( + margin: EdgeInsets.only( + left: 4, + top: 2.5, + right: 2.5, + bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Referral Doctor', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + Texts( + widget.myReferredPatientModel + .referralDoctorName, + maxLength: 80, + readMore: true, + ), + ], ), ), ]), TableRow( children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Clinic', - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferredPatientModel.referralClinicDescription}', - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only( - left: 4, - top: 2.5, - right: 2.5, - bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Frequency', - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.myReferredPatientModel - .frequencyDescription, - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - ) - ], - ), - TableRow(children: [ - Expanded( - child: Container( + Container( margin: EdgeInsets.all(2.5), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ AppText( - 'Priority', - fontSize: - 1.7 * SizeConfig.textMultiplier, + 'Referring Clinic', + fontSize: 1.7 * + SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), AppText( - '${widget.myReferredPatientModel.priorityDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, + '${widget.myReferredPatientModel.referralClinicDescription}', + fontSize: 1.7 * + SizeConfig.textMultiplier, fontWeight: FontWeight.w300, ) ], ), ), - ), - Expanded( - child: Container( + Container( margin: EdgeInsets.only( left: 4, top: 2.5, @@ -232,24 +169,75 @@ class _MyReferredPatientWidgetState extends State { padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ AppText( - 'Max Response Time', - fontSize: - 1.7 * SizeConfig.textMultiplier, + 'Frequency', + fontSize: 1.7 * + SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), AppText( - Helpers.getDateFormatted(widget - .myReferredPatientModel - .maxResponseTime), - fontSize: - 1.7 * SizeConfig.textMultiplier, + widget.myReferredPatientModel + .frequencyDescription, + fontSize: 1.7 * + SizeConfig.textMultiplier, fontWeight: FontWeight.w300, ) ], ), + ) + ], + ), + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Priority', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.priorityDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only( + left: 4, + top: 2.5, + right: 2.5, + bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Max Response Time', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + Helpers.getDateFormatted(widget + .myReferredPatientModel + .maxResponseTime), + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), ) ])