From 4c7db58489c4b6b3729f4f21c1abb259b460a28e Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Tue, 1 Mar 2022 10:05:28 +0200 Subject: [PATCH 1/7] replace the TabBar in refer-patient-screen-in-patient with our custom TabBar in tab_utils --- .../refer-patient-screen-in-patient.dart | 169 +++++++++++++----- lib/utils/tab_utils.dart | 2 - 2 files changed, 125 insertions(+), 46 deletions(-) diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 42bfab5f..a8bcbc5b 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -3,11 +3,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/utils/tab_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; @@ -22,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -31,8 +34,9 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget { _PatientMakeInPatientReferralScreenState(); } -class _PatientMakeInPatientReferralScreenState - extends State { +class _PatientMakeInPatientReferralScreenState extends State with SingleTickerProviderStateMixin{ + TabController _tabController; + int index = 0; PatiantInformtion patient; List referToList; dynamic _referTo; @@ -54,6 +58,20 @@ class _PatientMakeInPatientReferralScreenState var recognizedWord; var event = RobotProvider(); + + + _handleTabSelection() { + setState(() { + index = _tabController.index; + }); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + @override void initState() { requestPermissions(); @@ -65,6 +83,8 @@ class _PatientMakeInPatientReferralScreenState } }); super.initState(); + _tabController = TabController(length: 3, vsync: this); + _tabController.addListener(_handleTabSelection); } onVoiceText() async { @@ -489,6 +509,9 @@ class _PatientMakeInPatientReferralScreenState ), ], ), + SizedBox( + height: 100, + ) ], ), ) @@ -587,52 +610,110 @@ class _PatientMakeInPatientReferralScreenState } Widget priorityBar(BuildContext _context, Size screenSize) { - List _priorities = [ - TranslationBase.of(context).veryUrgent.toUpperCase(), - TranslationBase.of(context).urgent.toUpperCase(), - TranslationBase.of(context).routine.toUpperCase(), - ]; - return Container( - height: screenSize.height * 0.070, - width: screenSize.width * 0.95, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - return Expanded( - child: InkWell( - child: Center( + ProjectViewModel projectsProvider = Provider.of(context); + return Center( + child: Container( + width: SizeConfig.widthMultiplier * 120, + height: TabHelper.getTabHeight(context), + color: TabHelper.getBgTabColor(), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: index == 0, + isFirst: true, + projectViewModel: projectsProvider), + child: Center( + child: TabHelper.getTabText( + title: TranslationBase.of(context).veryUrgent.toUpperCase(), + isActive: index == 0)), + ), + Center( child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? Color(0XFFB8382B) : Colors.white, - _isActive ? Color(0XFFB8382B) : Colors.white), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive ? Colors.white : Colors.black, - //Colors.black, - fontWeight: FontWeight.bold, - ), - ), - )), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: index == 1, + isMiddle: true, + projectViewModel: projectsProvider), + child: Center( + child: TabHelper.getTabText( + title: TranslationBase.of(context).urgent.toUpperCase(), + isActive: index == 1)), + ), ), - onTap: () { - print(_priorities.indexOf(item)); - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }, - ), - ); - }).toList(), + Center( + child: Container( + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: index == 2, + isLast: true, + projectViewModel: projectsProvider), + child: Center( + child: TabHelper.getTabText( + title: TranslationBase.of(context).routine.toUpperCase(), + isActive: index == 2), + ), + ), + ), + ], + ), + ), ), ); + // List _priorities = [ + // TranslationBase.of(context).veryUrgent.toUpperCase(), + // TranslationBase.of(context).urgent.toUpperCase(), + // TranslationBase.of(context).routine.toUpperCase(), + // ]; + // return Container( + // height: screenSize.height * 0.070, + // width: screenSize.width * 0.95, + // decoration: + // containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: _priorities.map((item) { + // bool _isActive = _priorities[_activePriority] == item ? true : false; + // return Expanded( + // child: InkWell( + // child: Center( + // child: Container( + // height: screenSize.height * 0.070, + // decoration: containerBorderDecoration( + // _isActive ? Color(0XFFB8382B) : Colors.white, + // _isActive ? Color(0XFFB8382B) : Colors.white), + // child: Center( + // child: Text( + // item, + // style: TextStyle( + // fontSize: 12, + // color: _isActive ? Colors.white : Colors.black, + // //Colors.black, + // fontWeight: FontWeight.bold, + // ), + // ), + // )), + // ), + // onTap: () { + // print(_priorities.indexOf(item)); + // setState(() { + // _activePriority = _priorities.indexOf(item); + // }); + // }, + // ), + // ); + // }).toList(), + // ), + // ); } String getPriority() { diff --git a/lib/utils/tab_utils.dart b/lib/utils/tab_utils.dart index c4a023d4..b5981450 100644 --- a/lib/utils/tab_utils.dart +++ b/lib/utils/tab_utils.dart @@ -1,7 +1,5 @@ - import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; - import '../config/config.dart'; import '../config/size_config.dart'; import '../core/viewModel/project_view_model.dart'; From dc37e2e559e4a4e5e8822a176c9cece744e2d67c Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Tue, 1 Mar 2022 14:55:35 +0200 Subject: [PATCH 2/7] replace the TabBar in refer-patient-screen-in-patient with our dropDownList --- .../viewModel/patient-referral-viewmodel.dart | 2 + .../refer-patient-screen-in-patient.dart | 126 +++++++++--------- 2 files changed, 63 insertions(+), 65 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 85ecfbae..3f757606 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -41,6 +41,8 @@ class PatientReferralViewModel extends BaseViewModel { List doctorsList = []; + List priority = ['One', 'Two', 'Free', 'Four']; + List get clinicDoctorsList => _referralPatientService.doctorsList; diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index a8bcbc5b..53ecff07 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/tab_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -44,6 +45,7 @@ class _PatientMakeInPatientReferralScreenState extends State _priorityList = List(); + _priorityList.add( + priority1,); + _priorityList.add( + priority2,); + _priorityList.add( + priority3,); + + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; @@ -408,22 +433,39 @@ class _PatientMakeInPatientReferralScreenState extends State _priorities = [ - // TranslationBase.of(context).veryUrgent.toUpperCase(), - // TranslationBase.of(context).urgent.toUpperCase(), - // TranslationBase.of(context).routine.toUpperCase(), - // ]; - // return Container( - // height: screenSize.height * 0.070, - // width: screenSize.width * 0.95, - // decoration: - // containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), - // child: Row( - // mainAxisSize: MainAxisSize.max, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: _priorities.map((item) { - // bool _isActive = _priorities[_activePriority] == item ? true : false; - // return Expanded( - // child: InkWell( - // child: Center( - // child: Container( - // height: screenSize.height * 0.070, - // decoration: containerBorderDecoration( - // _isActive ? Color(0XFFB8382B) : Colors.white, - // _isActive ? Color(0XFFB8382B) : Colors.white), - // child: Center( - // child: Text( - // item, - // style: TextStyle( - // fontSize: 12, - // color: _isActive ? Colors.white : Colors.black, - // //Colors.black, - // fontWeight: FontWeight.bold, - // ), - // ), - // )), - // ), - // onTap: () { - // print(_priorities.indexOf(item)); - // setState(() { - // _activePriority = _priorities.indexOf(item); - // }); - // }, - // ), - // ); - // }).toList(), - // ), - // ); } String getPriority() { @@ -729,11 +725,11 @@ class _PatientMakeInPatientReferralScreenState extends State Date: Tue, 1 Mar 2022 16:25:57 +0300 Subject: [PATCH 3/7] change the file structure --- lib/routes.dart | 6 +- lib/screens/home/home_screen.dart | 2 +- .../ReplySummeryOnReferralPatient.dart | 115 ------------------ .../refer-patient-screen-in-patient.dart | 0 .../refer-patient-screen.dart | 0 .../referred-patient-screen.dart | 4 +- .../referred_patient_detail_in-paint.dart | 2 +- .../add_replay_on_referral_patient.dart | 0 .../my-referral-detail-screen.dart | 0 .../my-referral-inpatient-screen.dart | 8 +- .../patient_referral_screen.dart | 4 +- .../referral_patient_detail_in-paint.dart | 4 +- 12 files changed, 15 insertions(+), 130 deletions(-) delete mode 100644 lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart rename lib/screens/patients/profile/referral/{ => refer_details}/refer-patient-screen-in-patient.dart (100%) rename lib/screens/patients/profile/referral/{ => refer_details}/refer-patient-screen.dart (100%) rename lib/screens/patients/profile/referral/{ => refer_details}/referred-patient-screen.dart (98%) rename lib/screens/patients/profile/referral/{ => refer_details}/referred_patient_detail_in-paint.dart (99%) rename lib/screens/patients/profile/referral/{ => referral_details}/add_replay_on_referral_patient.dart (100%) rename lib/screens/patients/profile/referral/{ => referral_details}/my-referral-detail-screen.dart (100%) rename lib/screens/patients/profile/referral/{ => referral_details}/my-referral-inpatient-screen.dart (97%) rename lib/screens/patients/profile/referral/{ => referral_details}/patient_referral_screen.dart (97%) rename lib/screens/patients/profile/referral/{ => referral_details}/referral_patient_detail_in-paint.dart (99%) diff --git a/lib/routes.dart b/lib/routes.dart index 917b1c6c..b4d2c171 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -21,7 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/pending_orders/pendi import 'package:doctor_app_flutter/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/new_prescriptions_page.dart'; @@ -36,8 +36,8 @@ import 'screens/patients/profile/admission-request/admission-request-first-scree import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; -import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; -import 'screens/patients/profile/referral/refer-patient-screen.dart'; +import 'screens/patients/profile/referral/referral_details/my-referral-detail-screen.dart'; +import 'screens/patients/profile/referral/refer_details/refer-patient-screen.dart'; const String INIT_ROUTE = ROOT; const String ROOT = 'root'; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 4f5b9762..826bb230 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -16,7 +16,7 @@ import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart' import 'package:doctor_app_flutter/screens/patients/In_patient/in_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_details/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPatientPage.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart deleted file mode 100644 index e63656e9..00000000 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ /dev/null @@ -1,115 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:flutter/material.dart'; - -class ReplySummeryOnReferralPatient extends StatefulWidget { - final MyReferralPatientModel referredPatient; - final String doctorReply; - - ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply); - - @override - _ReplySummeryOnReferralPatientState createState() => - _ReplySummeryOnReferralPatientState(this.referredPatient); -} - -class _ReplySummeryOnReferralPatientState - extends State { - final MyReferralPatientModel referredPatient; - - _ReplySummeryOnReferralPatientState(this.referredPatient); - - @override - Widget build(BuildContext context) { - return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply, - body: Container( - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Container( - width: double.infinity, - margin: EdgeInsets.symmetric( - horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric( - horizontal: 16, vertical: 16), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - border: Border.fromBorderSide(BorderSide( - color: Colors.white, - width: 1.0, - )), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).reply, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 2.4 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), - AppText( - widget.doctorReply ?? '', - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), - SizedBox( - height: 8, - ), - ], - ), - ), - ), - ), - Container( - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: Row( - children: [ - Expanded( - child: AppButton( - onPressed: () { - Navigator.of(context).pop(); - }, - title: TranslationBase.of(context).cancel, - fontColor: Colors.white, - color: Colors.red[600], - ), - ), - SizedBox( - width: 4, - ), - Expanded( - child: AppButton( - onPressed: () {}, - title: TranslationBase.of(context).noteConfirm, - fontColor: Colors.white, - color: AppGlobal.appGreenColor, - ), - ), - ], - ), - ), - ], - ), - ), - )); - } -} diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart similarity index 100% rename from lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart rename to lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart similarity index 100% rename from lib/screens/patients/profile/referral/refer-patient-screen.dart rename to lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/refer_details/referred-patient-screen.dart similarity index 98% rename from lib/screens/patients/profile/referral/referred-patient-screen.dart rename to lib/screens/patients/profile/referral/refer_details/referred-patient-screen.dart index 6edfad8a..c0bf43d6 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred-patient-screen.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import '../../../../widgets/shared/errors/error_message.dart'; +import '../../../../../widgets/shared/errors/error_message.dart'; class ReferredPatientScreen extends StatefulWidget { @override diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart similarity index 99% rename from lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart rename to lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart index bf4b1c24..1d4f7223 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import '../../../../routes.dart'; +import '../../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { final MyReferredPatientModel referredPatient; diff --git a/lib/screens/patients/profile/referral/add_replay_on_referral_patient.dart b/lib/screens/patients/profile/referral/referral_details/add_replay_on_referral_patient.dart similarity index 100% rename from lib/screens/patients/profile/referral/add_replay_on_referral_patient.dart rename to lib/screens/patients/profile/referral/referral_details/add_replay_on_referral_patient.dart diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/referral_details/my-referral-detail-screen.dart similarity index 100% rename from lib/screens/patients/profile/referral/my-referral-detail-screen.dart rename to lib/screens/patients/profile/referral/referral_details/my-referral-detail-screen.dart diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/referral_details/my-referral-inpatient-screen.dart similarity index 97% rename from lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart rename to lib/screens/patients/profile/referral/referral_details/my-referral-inpatient-screen.dart index ea418ebe..0e22ab25 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/referral_details/my-referral-inpatient-screen.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-detail-screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_details/my-referral-detail-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_details/referral_patient_detail_in-paint.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/referred-patient-screen.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import '../../../../widgets/shared/errors/error_message.dart'; +import '../../../../../widgets/shared/errors/error_message.dart'; class MyReferralInPatientScreen extends StatefulWidget { @override diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/referral_details/patient_referral_screen.dart similarity index 97% rename from lib/screens/patients/profile/referral/patient_referral_screen.dart rename to lib/screens/patients/profile/referral/referral_details/patient_referral_screen.dart index c36c8251..2417cef8 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/referral_details/patient_referral_screen.dart @@ -1,14 +1,14 @@ import 'dart:ui'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/referred-patient-screen.dart'; import 'package:doctor_app_flutter/utils/tab_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../ReferralDischargedPatientPage.dart'; +import '../../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; class PatientReferralScreen extends StatefulWidget { diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_details/referral_patient_detail_in-paint.dart similarity index 99% rename from lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart rename to lib/screens/patients/profile/referral/referral_details/referral_patient_detail_in-paint.dart index 814df03e..b901056e 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_details/referral_patient_detail_in-paint.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/add_replay_on_referral_patient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_details/add_replay_on_referral_patient.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -17,7 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/material.dart'; -import '../../../../routes.dart'; +import '../../../../../routes.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; From 95321a9305f9a9c82a7d945f981aaf17552637c0 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 1 Mar 2022 16:28:59 +0300 Subject: [PATCH 4/7] fix the bug --- .../refer_details/refer-patient-screen-in-patient.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index 53ecff07..90dc98e5 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -147,7 +147,7 @@ class _PatientMakeInPatientReferralScreenState extends State Date: Tue, 1 Mar 2022 16:10:42 +0200 Subject: [PATCH 5/7] replace the TabBar in refer-patient-screen-in-patient with our dropDownList --- .../refer-patient-screen-in-patient.dart | 92 +------------------ 1 file changed, 4 insertions(+), 88 deletions(-) diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index 90dc98e5..a3306116 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -3,14 +3,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/tab_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; @@ -25,7 +23,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -35,9 +32,7 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget { _PatientMakeInPatientReferralScreenState(); } -class _PatientMakeInPatientReferralScreenState extends State with SingleTickerProviderStateMixin{ - TabController _tabController; - int index = 0; +class _PatientMakeInPatientReferralScreenState extends State{ PatiantInformtion patient; List referToList; dynamic _referTo; @@ -50,7 +45,6 @@ class _PatientMakeInPatientReferralScreenState extends State _priorityList = List(); - _priorityList.add( - priority1,); - _priorityList.add( - priority2,); - _priorityList.add( - priority3,); + _priorityList.add(priority1); + _priorityList.add(priority2); + _priorityList.add(priority3); final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -652,67 +629,6 @@ class _PatientMakeInPatientReferralScreenState extends State(context); - return Center( - child: Container( - width: SizeConfig.widthMultiplier * 120, - height: TabHelper.getTabHeight(context), - color: TabHelper.getBgTabColor(), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - decoration: TabHelper.getBoxTabsBoxDecoration( - isActive: index == 0, - isFirst: true, - projectViewModel: projectsProvider), - child: Center( - child: TabHelper.getTabText( - title: TranslationBase.of(context).veryUrgent.toUpperCase(), - isActive: index == 0)), - ), - Center( - child: Container( - decoration: TabHelper.getBoxTabsBoxDecoration( - isActive: index == 1, - isMiddle: true, - projectViewModel: projectsProvider), - child: Center( - child: TabHelper.getTabText( - title: TranslationBase.of(context).urgent.toUpperCase(), - isActive: index == 1)), - ), - ), - Center( - child: Container( - decoration: TabHelper.getBoxTabsBoxDecoration( - isActive: index == 2, - isLast: true, - projectViewModel: projectsProvider), - child: Center( - child: TabHelper.getTabText( - title: TranslationBase.of(context).routine.toUpperCase(), - isActive: index == 2), - ), - ), - ), - ], - ), - ), - ), - ); - } - String getPriority() { DateTime date = DateTime.now(); switch (_activePriority) { From 7962d9b1be5d701654e14384a08414943b1a7041 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Wed, 2 Mar 2022 11:22:20 +0200 Subject: [PATCH 6/7] fix the remark validation, make the bottomSheet show after loading and edit the order numbers of priority refer-patient-screen-in-patient --- .../viewModel/patient-referral-viewmodel.dart | 8 +- .../all_lab_special_result_page.dart | 3 +- .../profile/lab_result/labs_home_page.dart | 4 +- .../special_lab_result_details_page.dart | 2 +- .../radiology/radiology_home_page.dart | 3 +- .../refer-patient-screen-in-patient.dart | 152 ++++++++++-------- lib/screens/procedures/procedure_screen.dart | 3 +- 7 files changed, 96 insertions(+), 79 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 3f757606..45c48c18 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -252,8 +252,12 @@ class PatientReferralViewModel extends BaseViewModel { int priority, String referralDate, String remarks, - String ext}) async { - setState(ViewState.Busy); + String ext, + bool isLocalBusy = false}) async { + if(isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); await _referralService.referralPatient( patientID: patient.patientId, roomID: patient.roomId, diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 24b4a9b8..ab05548b 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -4,8 +4,9 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; + +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index ff64a406..05e86a7f 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -5,14 +5,12 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; 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/app_texts_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/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index 721a0c2d..fca8fb35 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 2aa1b1fc..244fd37f 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -5,13 +5,12 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; 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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index a3306116..dfdb6f3d 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -50,6 +50,7 @@ class _PatientMakeInPatientReferralScreenState extends State Date: Wed, 2 Mar 2022 12:46:15 +0200 Subject: [PATCH 7/7] fix the remark validation, make the bottomSheet show after loading and edit the order numbers of priority refer-patient-screen-in-patient --- lib/core/viewModel/patient-referral-viewmodel.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 45c48c18..d4cc986f 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -41,8 +41,6 @@ class PatientReferralViewModel extends BaseViewModel { List doctorsList = []; - List priority = ['One', 'Two', 'Free', 'Four']; - List get clinicDoctorsList => _referralPatientService.doctorsList;