diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 41e65f70..3c58fe30 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -310,7 +310,7 @@ "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", - "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework", + "${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework", "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", "${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework", ); @@ -352,7 +352,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework", ); diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index cd41db0d..cbb2b24a 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/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'; import 'package:flutter/cupertino.dart'; @@ -20,6 +21,7 @@ import 'package:flutter/material.dart'; import '../../util/helpers.dart'; import '../../widgets/shared/errors/error_message.dart'; +///TODO Elham* the design should be fixed By roaa class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { @@ -54,23 +56,6 @@ class PrescriptionsPage extends StatelessWidget { SizedBox( height: 12, ), - if (model.prescriptionsList.isNotEmpty && - patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions, - ), - ], - ), - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -163,7 +148,13 @@ class PrescriptionsPage extends StatelessWidget { child: ListView( physics: BouncingScrollPhysics(), children: [ - ListView.builder( + + model.medicationForInPatient.length == 0? + Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .noPrescriptionsFound, + )): ListView.builder( scrollDirection: Axis.vertical, physics: NeverScrollableScrollPhysics(), shrinkWrap: true, @@ -171,22 +162,23 @@ class PrescriptionsPage extends StatelessWidget { itemBuilder: (context, index) { //model.medicationForInPatient.length, return InkWell( - child: DoctorCard( - doctorName: Helpers.convertToTitleCase( - model.medicationForInPatient[index] - .pHRItemDescription, - ), - profileUrl: model.prescriptionsList[index] - .doctorImageURL, - branch: model.prescriptionsList[index].name, - clinic: model.prescriptionsList[index] - .clinicDescription, + child: InPatientDoctorCard( + doctorName: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .pHRItemDescription), + profileUrl: 'sss', + branch: 'hamza', + clinic: 'basheer', isPrescriptions: true, appointmentDate: AppDateUtils .getDateTimeFromServerFormat( model.medicationForInPatient[index] .prescriptionDatetime, ), + createdBy: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .doctorName + .toString()), ), onTap: () => Navigator.push( context, @@ -194,7 +186,7 @@ class PrescriptionsPage extends StatelessWidget { page: PrescriptionItemsInPatientPage( prescriptionIndex: index, prescriptions: - model.medicationForInPatient[index], + model.medicationForInPatient[index], patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -213,12 +205,6 @@ class PrescriptionsPage extends StatelessWidget { ), ); }), - if (model.medicationForInPatient.length == 0) - Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, - )) ], ), ), diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart new file mode 100644 index 00000000..9197a4a1 --- /dev/null +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -0,0 +1,196 @@ +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/widgets/shared/app_texts_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InPatientDoctorCard extends StatelessWidget { + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final Function onTap; + final bool isPrescriptions; + final String clinic; + final createdBy; + + InPatientDoctorCard( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.createdBy}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: AppText( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (!isPrescriptions) + AppText( + '${AppDateUtils.getHour(appointmentDate)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + children: [ + AppText( + 'CreatedBy ', + //bold: true, + ), + Expanded( + child: AppText( + createdBy, + bold: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Container( + // child: LargeAvatar( + // name: doctorName, + // url: profileUrl, + // ), + // width: 55, + // height: 55, + // ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // if (orderNo != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderNo + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // orderNo ?? '', + // fontSize: 14, + // ) + // ], + // ), + // if (invoiceNO != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .invoiceNo + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // invoiceNO, + // fontSize: 14, + // ) + // ], + // ), + // if (clinic != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).clinic + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // clinic, + // fontSize: 14, + // ) + // ], + // ), + // if (branch != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // branch, + // fontSize: 14, + // ) + // ], + // ) + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +}